Re: [R] warning message in a glm model

From: Ted Harding <Ted.Harding_at_manchester.ac.uk>
Date: Fri, 21 Mar 2008 16:54:00 +0000 (GMT)


On 21-Mar-08 15:59:05, Alfonso Pérez wrote:
> Hello, my name is Alfonso. I want to apply a logistic model to my data.
> The variables are, fish length and age length as a continous variable,
> and cohort as a factor. I consider the interaction between age and
> cohort in the model. The dependent variable is the probability of being
> mature. Then the model is as follow:
>
> ogive <- glm(mature~length+(cohort*age), family=binomial,
> data=subset.cod)
>
>
> But when I run it in R I obtain a Warning message:
>
> Warning message:
> In glm.fit(x = X, y = Y, weights = weights, start = start, etastart =
> etastart, :
> fitted probabilities numerically 0 or 1 occurred
>
> I don't understand what's the problem, could you help me? thank you
> in advance.
>
> Alfonso.

There was effectively the same question from Werner Wernersen: "[R] glm.fit: "fitted probabilities numerically 0 or 1 occurr" 11 March 2008 08:58:55.

See my response to him:
"Re: [R] glm.fit: "fitted probabilities numerically 0 or 1 occurr" From: (Ted Harding) <Ted.Harding_at_manchester.ac.uk> Date: Tue, 11 Mar 2008 10:08:09 -0000 (GMT)

which covers the maun issues.

The underlying reason is that some linear function of your covariates compeletly separates the "Y=1" cases from the "Y=0" cases, so the GLM can predict probability 1 for "Y=1", and probability 0 for "Y=0".

Best wishes,
Ted.



E-Mail: (Ted Harding) <Ted.Harding_at_manchester.ac.uk> Fax-to-email: +44 (0)870 094 0861
Date: 21-Mar-08                                       Time: 16:53:54
------------------------------ XFMail ------------------------------

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Fri 21 Mar 2008 - 16:56:59 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 21 Mar 2008 - 17:30:22 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive