[R] Does Chi Square test for R differ from S-Plus?

Prof Brian Ripley ripley at stats.ox.ac.uk
Tue Mar 23 11:13:46 CET 2004


That is a linear model (why use glm when lm will do?), and test="Chisq" is
wrong as the scale has not been specified.  You need an F test.  Had you 
used lm, you would not have been able to select the wrong test ....

BTW, please do not reply to individuals only as the list does not then
know the problem has been closed.

On Tue, 23 Mar 2004, Ridwan Sala wrote:

> I used generalized linear model with the commands as follows:
>  
> For S-Plus:
> >attach(data)
> >options(contrasts=c("contr.treatment","contr.poly"))
> >model1<-glm(logcatchrate~Year+Month+Vessclass+Livebaitday+....+Vessclass:Livebaitday,family=gaussian)
> >anova(model1,test="Chisq")
>  
> For R :
> >data<-read.table("data.dat", header=T)
> >fix(data)
> >attach(data)
> >model1<-glm(logcatchrate~Year+Month+Vessclass+Livebaitday+...+Vessclass:Livebaitday,family=gaussian)>anova(model1,test="Chisq")
>  
>  
>  
> 
> Prof Brian Ripley <ripley at stats.ox.ac.uk> wrote:
> Depends on the `GLM' model and what you mean by that (general linear 
> model, generalized linear model?). And by `Anova' (capitalized), for that 
> matter.
> 
> S-PLUS (sic) does some inconsistent things with dispersion parameters in 
> glm() fits, and it is likely that you are using the wrong test. But P 
> values that near one should arouse your suspicions.
> 
> Please read the R posting guide, and then tell us enough of what you did
> so we can help you. 

-- 
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 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list