[R] Logistic regression : dicrepancies between glm and nls ?

Prof Brian Ripley ripley at stats.ox.ac.uk
Fri Dec 14 18:45:16 CET 2001

On Fri, 14 Dec 2001, Emmanuel Charpentier wrote:

> Prof Brian Ripley wrote:
> >Your call to nls fits by least squares, whereas glm fits by maximum
> >likelihood.  Not the same thing: ml gives more weights to values with
> >fitted values near zero or one.
> >
> [ Feeling *very* dumb ... ] Quite right !
> So my only hope is to embark on ML-estimations and likelihood ratio (or
> Akaike IC) tests ...
> What would you recommend for this task ? I am not aware of a R package
> directly built to do that, except GLMM, which I do not yet know how to
> use (but I'll have a serious look at it).

For binomial GLMMs?  Well Lindsey's glmm() function only does the (very)
special case of a single random intercept, and the glmm() in GLMMgibbs
does more but is slow and often fails with binomial GLMMs, especially
binary ones.

The next version of the MASS package (on test for 1.4.0) has glmmPQL, a
wrapper around lme that does a reasonable job of estimation.  But just as
nlme is not good for testing (the likelihoods are very approximate)
so does glmmPQL.  We have better methods under development but not ready
for release yet.

As for writing your own code: deciding what to implement is hard enough.
I had a Masters' student last summer investigate a number of packages,
including R ones, and about half the answers were not credible!

Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

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