[R] Extreme AIC or BIC values in glm(), logistic regression

Gavin Simpson gavin.simpson at ucl.ac.uk
Fri Mar 20 09:44:09 CET 2009


On Fri, 2009-03-20 at 12:39 +1100, Gad Abraham wrote:
> Maggie Wang wrote:
> > Hi, Dieter, Gad, and all,
> > 
> > Thank you very much for your reply!  
> > 
> > So here is my data,  you can copy it into a file names "sample.txt"
> 
> Hi Maggie,
> 
> With this data (allowing for more iterations) I get:
> 
> > lr <- glm(fo, family=binomial(link=logit), data=matrix, 
> control=glm.control(maxit=100))
> Warning message:
> In glm.fit(x = X, y = Y, weights = weights, start = start, etastart =
> etastart,  :
>    fitted probabilities numerically 0 or 1 occurred
> 
> which indicates, as Thomas has said, perfect separation, which occurs
> because you're trying to fit too many variables with not enough data.

It is worth mentioning that, in and of itself, that warning does not
necessarily indicate a separation issue - something I was unsure about
recently. You can get that warning (and I did for several data sets in a
recent problem I enquired on the list about) where the fitted values
really do become numerically 0 or 1 without separation.

For example, see this response to my original question on the list:

http://article.gmane.org/gmane.comp.lang.r.general/134472/

There Ioannis Kosmidis presents a number of ways to investigate the
results of a logit model fit for such issues.

G

> 
> Cheers,
> Gad
> 
-- 
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
 Dr. Gavin Simpson             [t] +44 (0)20 7679 0522
 ECRC, UCL Geography,          [f] +44 (0)20 7679 0565
 Pearson Building,             [e] gavin.simpsonATNOSPAMucl.ac.uk
 Gower Street, London          [w] http://www.ucl.ac.uk/~ucfagls/
 UK. WC1E 6BT.                 [w] http://www.freshwaters.org.uk
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20090320/82640797/attachment-0003.bin>


More information about the R-help mailing list