[R] warning message in a glm model

(Ted Harding) Ted.Harding at manchester.ac.uk
Fri Mar 21 17:54:00 CET 2008


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 ------------------------------



More information about the R-help mailing list