Reputation: 5
I am trying to make a dose response model to analyze some percentage data.
I'm trying to use a Weibull 1.4 model, but I keep getting an upper limit error.
I've tried adjusting the upper limit, but get the same error regardless of value.
There's nothing on Google about this, so I'm curious as to what it is and more importantly, how to fix it?
Reproducible example:
Percent.adj <- c(".002",".005", "003",".5", ".87", "1",".001",".025", "005",".5", ".90", "1")
TempC <- c("0", "2","4","6","8","10","0", "2","4","6","8","10")
Genotype<-c("A","A", "A","A", "A","A", "B","B","B","B","B","B")
df<-data.frame(Percent.adj, TempC, Genotype)
drm(Percent.adj ~ TempC, Genotype, data=df,
fct=W1.4(),
upperl=c(NA,2,NA)) -> Leaf.drm
```
Upvotes: 0
Views: 90
Reputation: 84529
The Weibull function W1.4
is:
f(x) = c + (d-c) * exp(-exp(b * (log(x) - log(e)))).
Here, the variable x
is TempC
, and there's a zero value in TempC
, so log(x)
causes an error.
Moreover, there are four parameters, so if you want to supply upperl
, you have to enter a vector of length 4. In addition, you have to set Inf
in this vector for the non-constrained parameters, and not NA
.
Upvotes: 0