[R] suggestions for nls error: false convergence

Christian Ritz ritz at bioassay.dk
Sun Dec 18 22:19:49 CET 2005


Hi.

An alternative is to use the package 'drc' on CRAN to fit your data!

x <- 1:100

y <- c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,1,1,1,2,2,2,2,2,3,4,4,4,5,
5,5,5,6,6,6,6,6,8,8,9,9,10,13,14,16,19,21,
24,28,33,40,42,44,50,54,69,70,93,96,110,127,127,141,157,169,
178,187,206,216,227,236,238,244,246,250,255,255,257,260,261,262,266,268,
268,270,272,272,272,273,275,275,275,276)


## Defining the function (in a bit different notation)
logi <- function(dose, parm){parm[, 1] * (1+parm[, 2]*exp(-dose/parm[, 3])) / (1+parm[, 4]*exp(-dose/parm[, 3]))}

## Fitting the function to the data (see ?multdrc for details)
library(drc)
model <- multdrc(y~x, fct = list(logi, NULL, c("a", "m", "tau", "n")), startVal=c(277, 100, 10, 101))

summary(model)
plot(model, log="")


Hope this helps?

Christian




More information about the R-help mailing list