Re: [R] suggestions for nls error: false convergence

From: Christian Ritz <ritz_at_bioassay.dk>
Date: Mon 19 Dec 2005 - 08:19:49 EST

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



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Mon Dec 19 08:27:41 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:41:40 EST