[R] F tests for glms with binomial error

Prof Brian D Ripley ripley at stats.ox.ac.uk
Wed Apr 4 13:30:10 CEST 2001


On Wed, 4 Apr 2001 tr217 at cam.ac.uk wrote:

> Hi, can anyone help with this:
>
> I am trying to analyse some data in the form of proportions with the glm
> function in R and S-plus.  When comparing different models with an F test,
> I get different results from R and S-plus.  Here's an example (there are
> two factors and an interaction in the full model
> "glm1<-glm(resp~time*set,family=binomial"):
>
> In R, entering "anova(glm1)" I get this:

Don't think so.  You specified an inappropriate test: the default is NULL.
See ?anova.glm for what actually happens.


> 		DF	Deviance	Resid. DF	Resid. Deviance	F		Pr(>F)
> NULL					51		213.13
> time		1	1.403		50		211.727		1.4032	0.23618
> set		6	98.527	44		113.2			16.4211	<2e-16***
> time:set    6	13.659	38		99.541		2.2765	0.03368*
>
>
> But in S-plus, I get this:
>
> 		DF	Deviance	Resid. DF	Resid. Deviance	F		Pr(>F)
> NULL					51		213.13
> time		1	1.403		50		211.727		0.6749	0.4165
> set		6	98.527	44		113.2			7.8986	0.000015***
> time:set    6	13.659	38		99.541		1.0950	0.3831
>
> Everything is the same, except for the F ratios.  Does anyone know why (as
> you can see it makes quite a difference to the significance of the
> interaction term)?

Yes. R uses a binomial as you requested. S-PLUS uses an overdispersed
binomial, which you did not request.  If that is what you wanted, specify
quasibinomial.

IMO, the author of this in S (and hence S-PLUS) was somewhat confused.

-- 
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