[R] How to apply SSfpl with binary data
Douglas Bates
bates at stat.wisc.edu
Fri Sep 27 20:23:36 CEST 2002
baba at muj.biglobe.ne.jp writes:
> Dear R-help subscribers
>
> Would you tell me how to apply SSfpl with binary data as below?
> Unfortunately, there is not the EXAMPLE in help(SSfpl) for binary data but for quantitative data(Chick).
>
> V1: dose
> V2: log-transformed dose
> V3: response (rate)
>
> V1 V2 V3
> 1 0.775 -0.2548922 0.1666667
> 2 5.000 1.6094379 0.8148148
> 3 10.000 2.3025851 0.5000000
> 4 20.000 2.9957323 0.6428571
>
> I also attach the error message in R 1.5.1 in following.
>
> > targan
> V1 V2 V3
> 1 0.775 -0.2548922 0.1666667
> 2 5.000 1.6094379 0.8148148
> 3 10.000 2.3025851 0.5000000
> 4 20.000 2.9957323 0.6428571
> > targan.1 <- nls(targan$V3 ~ SSlogis(targan$V2, Asym, xmid, scal), data = targan)
> Error in solve.qr(a, b, tol) : singular matrix `a' in solve
I think you want to use glm, not nls with SSfpl.
You say you have binary data but your V3 is a rate. Because you know
that you have response rate you would presumably want the predictions
at the different doses to be on the scale zero to unity. In that case
you may want to fit a logistic regression model using glm, not a
four-parameter logistic nonlinear regression model. For glm you will
need to give the number of trials at each dose and the corresponding
number of 'successes'.
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the R-help
mailing list