2

我试图运行一个 nplr 函数:

require(nplr)

b<- data.frame("Conc" = c(0.03125, 0.046875, 0.0625, 0.09375, 0.1875),"BKA" =c(1.89970905356837, 98.2543214102345, 98.0660619544754, 98.1858634263221, 98.0489474584974))

nplr(x = b$Conc, y = b$BKA)

失败并出现错误

Testing pars...
The 3-parameters model showed better performance
Error in nplr(x = b$Conc, y = b$BKA) : 
nplr failed and returned constant fitted values.
        Your data may not be appropriate for such model. 
In addition: Warning message:
In nlm(f = .sce, p = .initPars(x, y, 5), x = x, yobs 
= y, .weight,  :
  NA/Inf replaced by maximum positive value

有没有人知道为什么会出现这个错误?

4

1 回答 1

1

因为nplr期望响应值介于 0 和 1 之间,您可以通过除以 100 来重新调整 y 值并且错误消失了,例如:

require(nplr)
require(dplyr)

b<- data.frame("Conc" = c(0.03125, 0.046875, 0.0625, 0.09375, 0.1875),"BKA" =c(1.89970905356837, 98.2543214102345, 98.0660619544754, 98.1858634263221, 98.0489474584974))

b <- 
    b %>% 
    mutate(BKA = BKA/100)

nplr(x = b$Conc, y = b$BKA)
于 2018-09-10T18:41:25.703 回答