[R] how to interpolate a plot with a logistic curve

Dylan Beaudette dylan.beaudette at gmail.com
Wed Dec 5 19:25:06 CET 2007


On Wednesday 05 December 2007, Simone Gabbriellini wrote:
> hello,
>
> I have this simple question. This is my dataset
>
> 	size
> 1	57
> 2	97
> 3	105
> 4	123
> 5	136
> 6	153
> 7	173
> 8	180
> 9	193
> 10	202
> 11	213
> 12	219
> 13	224
> 14	224
> 15	248
> 16	367
> 17	496
> 18	568
> 19	618
> 20	670
> 21	719
> 22	774
> 23	810
> 24	814
> 25	823
>
> I plot it with:
>
> plot(generalstats[,1], type="b", xlab="Mesi", ylab="Numero di
> vertici", main="");
>
> and try to interpolate with a linear regression with
>
> abline(lm(generalstats[,
> 1
> ]~
> c(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25)),
> lty=3, col="red");
>
> how to interpolate the data with a logistic curve? I cannot find the -
> I suppose easy - solution..
>
> thank you,
> Simone
>

try:

glm(formula, data, family=binomial())

require(Design)
lrm()


Cheers,

-- 
Dylan Beaudette
Soil Resource Laboratory
http://casoilresource.lawr.ucdavis.edu/
University of California at Davis
530.754.7341



More information about the R-help mailing list