[R] understanding the 4 parameter logisitc regression
Dieter Menne
dieter.menne at menne-biomed.de
Fri Dec 17 10:15:16 CET 2010
1Rnwb wrote:
>
> test=data.frame(cbind(conc=c(25000, 12500, 6250, 3125, 1513, 781, 391,
> 195, 97.7, 48.4, 24, 12, 6, 3, 1.5, 0.001),
> il10=c(330269, 216875, 104613, 51372, 26842, 13256, 7255, 3049, 1849,
> 743,
> 480, 255, 241, 128, 103, 50)))
>
> nls(log(il10)~A+(B-A)/(1+(conc/xmid )^scal),data=test,
> + start = list(A=3.5, B=15,
> + xmid=600,scal=1/2.5))
> ...
> I did not understand how these values A=3.5, B=15,xmid=600,scal=1/2.5
> were obtained by Jim in the posting here
> http://www.mail-archive.com/r-help@stat.math.ethz.ch/msg25500.html.
>
>
The easiest way is to plot the function for several parameters with the
original data superimposed. It shows you, that either you copied
test=data.frame(cbind(conc=c(25000, 12500, 6250, 3125, 1513, 781, 391,
195, 97.7, 48.4, 24, 12, 6, 3, 1.5, 0.001),
il10=c(330269, 216875, 104613, 51372, 26842, 13256, 7255, 3049, 1849, 743,
480, 255, 241, 128, 103, 50)))
fn = function(conc, A,B,xmid,scal) {
A+(B-A)/(1+(conc/xmid )^scal)
}
plot(test$conc,fn(test$conc,15,3.5,600,1/2.5),type="l") # looks good
#plot(test$conc,fn(test$conc,3.5,15,600,1/2.5),type="l") # bad
points(test$conc,log(test$il10))
Which tells you that the example you cited has a typo, or the author had
mixed up parameters A and B.
Dieter
--
View this message in context: http://r.789695.n4.nabble.com/understanding-the-4-parameter-logisitc-regression-tp3091588p3092266.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list