[R] warning in binomial analysis
Thomas Lumley
tlumley at u.washington.edu
Sun Sep 22 22:33:25 CEST 2002
On Fri, 20 Sep 2002, Ronaldo Reis Jr. wrote:
> Hi,
> I have make an analise with presence and absence, y=(1 e 0).
> I have a area continuous data and a sp data with 25 levels. I have 300 points.
> When I make
>
> glm((presenca/peso)~area,weights=peso,family=binomial,maxit=1000)
>
> where
>
> presenca is 0 or 1.
>
> peso is the unit = 1.
>
> area is the continuous data.
>
> The analysis is OK.
>
> When I put the sp and interactions in analysis this warning appear.
>
> glm((presenca/peso)~area*sp,weights=peso,family=binomial,maxit=1000)
>
> Warning message:
>
> fitted probabilities numerically 0 or 1 occurred
>
> in: (if (is.empty.model(mt)) glm.fit.null else
>
> glm.fit)(x = X, y = Y,
>
> Some ideas???
When you fit logistic regression models to fairly sparse data you can
often have a situation where for some combination of variables the
response variable is either all 0 or all 1. In that case the maximum
likelihood estimates for at least some of the coefficients will be
infinite. That's what R is telling you.
You should be able to tell which coefficients are infinite -- the
coefficients and their standard errors will be large.
When this happens the standard errors and the p-values reported by
summary.glm() for those variables are useless.
-thomas
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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