Re: [R] different F test in drop1 and anova

From: Tom Van Dooren <vdooren_at_rulsfb.leidenuniv.nl>
Date: Fri 21 Oct 2005 - 04:33:47 EST

Hi Brian,
well I wanted a test based on quasibinomial... Does it work like this then?:

x<-gl(3,2)
y<-c(0,1,0,0,1,1)

# quasibinomial models #

########################

qb1<-glm(y~x,quasibinomial)
qb2<-glm(y~1,quasibinomial)

qbdev<-(qb2$dev-qb1$dev)

qbdev # deviance I

qbdev/(qb2$df.res-qb1$df.res)/(qb1$dev /qb1$df.res) # deviance ratio II

qbdev/summary(qb1)$disp # scaled deviance III

qbdev/(qb2$df.res-qb1$df.res)/summary(qb1)$disp # scaled deviance IV

anova(qb2,qb1,test="Chisq") # Chisq test based on I
drop1(qb1,test="F") # F test, based on II
drop1(qb1,test="Chisq") # Chisq test, based on III
anova(qb2,qb1,test="F") # F test, based on IV

# binomial models #

###################

b1<-glm(y~x,binomial)
b2<-glm(y~1,binomial)

bdev<-(b2$dev-b1$dev)

bdev # deviance I

bdev/(b2$df.res-b1$df.res)/(b1$dev /b1$df.res) # deviance ratio II

drop1(b1,test="Chisq") # Chisq test, based on I
anova(b2,b1,test="Chisq") # Chisq test based on I
anova(b2,b1,test="F") # Chisq test, based on I
drop1(b1,test="F") # F test, based on II


Cheers, Tom

PS: thanks Tord ;)



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Fri Oct 21 06:19:25 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:40:46 EST