[R] Running a likelihood ratio test for a logit model

Chris Bergstresser chris at subtlety.com
Thu May 18 16:39:31 CEST 2006


On 5/18/06, Prof Brian Ripley <ripley at stats.ox.ac.uk> wrote:
> On Thu, 18 May 2006, Dimitris Rizopoulos wrote:
>
> > the print method for glm object already shows you the null and
> > residual deviance with the associated df; look also at the "Value"
> > section of ?glm.
>
> Note though that deviances are not (log) likelihood ratios, but
> differences in deviances are twice log LRT (pace a previous answer).

   Ah, that's what I wanted.  I was confused because the book I'm
working out of (Agresti's _An Introduction to Categorical Data
Analysis_) never refers to the components of the log LRT as deviances.

> anova() is a good way to get suitable tests out of model fits:
> in this case
>
>      anova(glm(y ~ x1, family=binomial))
>
> shows you the appropriate 2 log LRT

    I've been using that for comparing models, but got a little
confused because it didn't spit out an associated p-value.  I tried
summary(anova) but that's just ridiculous.
   Does aov compute basically the same test, but using the F
distribution rather than the chisq?

-- Chris




More information about the R-help mailing list