anova.glm gets test="Chisq" wrong (PR#2294)

ripley@stats.ox.ac.uk ripley@stats.ox.ac.uk
Fri, 15 Nov 2002 07:58:50 +0000 (GMT)


No, it gets it right.  You need to use a *scaled* deviance in that test,
or specify dispersion = 1.

I don't think that the test is really appropriate, in any case: an F test
would be better (as the help page says).

The usage of `deviance' is rather confused in the GLM literature,
especially in McCullagh & Nelder.

On Fri, 15 Nov 2002 robert.king@newcastle.edu.au wrote:

> Full_Name: Robert King
> Version: 1.5.0
> OS: windows
> Submission from: (NULL) (134.148.4.19)
>
>
> Also occurs in 1.6.0 on linux
>
> anova.glm(fitted.object,test="Chisq") is giving strange answers in this
> situation
>
> > resptime
>    sex task time
> 1    m    s  210
> 2    m    s  300
> 3    m    s  420
> 4    f    s  250
> 5    f    s  310
> 6    f    s  390
> 7    m    c  310
> 8    m    c  400
> 9    m    c  600
> 10   m    c  720
> 11   f    c  300
> 12   f    c  350
> 13   f    c  405
> 14   f    c  520
>
> > resp.fit1 <- glm(time~sex+task,data=resptime,family=Gamma)
>
> > anova(resp.fit1,test="Chisq")
> Analysis of Deviance Table
>
> Model: Gamma, link: inverse
>
> Response: time
>
> Terms added sequentially (first to last)
>
>
>      Df Deviance Resid. Df Resid. Dev P(>|Chi|)
> NULL                    13    1.50207
> sex   1  0.08833        12    1.41374   0.31191
> task  1  0.44008        11    0.97366   0.02400
>
> #BUT!
> > 1-pchisq(0.44008,1)
> [1] 0.5070838

-- 
Brian D. Ripley,                  ripley@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-devel 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-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._