[R] logistic regression
Jack Tanner
ihok at hotmail.com
Wed Apr 4 07:35:45 CEST 2012
Melrose2012 <melissa.patrician <at> stonybrook.edu> writes:
>
> alive <- (fflies$living)
> dead <- (fflies$living[1]-alive)
> glm.fit <- glm(cbind(alive,dead)~fflies$day,family="binomial")
> summary(glm.fit)
Your call to glm() is not doing what you think it's doing. What you want to do
is probably closer to
glm.fit <- glm(living ~ day, data=fflies, family="binomial")
Where ffiles$living has exactly two values, e.g., "alive" or "dead" or some
other pair.
After you do this, you want to examine glm.fit very carefully. Make sure you can
interpret all of the output of summary(glm.fit). Until you do, there's no point
in trying to plot.
More information about the R-help
mailing list