[R] question about about the drop1

ronggui 0034058 at fudan.edu.cn
Sat Apr 23 09:40:47 CEST 2005


the data is :
>table.8.3<-data.frame(expand.grid( marijuana=factor(c("Yes","No"),levels=c("No","Yes")), cigarette=factor(c("Yes","No"),levels=c("No","Yes")), alcohol=factor(c("Yes","No"),levels=c("No","Yes"))), count=c(911,538,44,456,3,43,2,279))

>fit3<-glm(count~.^3,poisson,table.8.3)
>sumary(fit3)
...
Residual deviance: -1.5543e-15  on 0  degrees of freedom
AIC: 65.043

> drop1(fit3,.~.,test="Chisq")
Single term deletions

Model:
count ~ (marijuana + cigarette + alcohol)^3
                            Df   Deviance    AIC    LRT   Pr(Chi)    
<none>                         -1.554e-15  65.04                     
marijuana                    1     365.78 428.83 365.78 < 2.2e-16 ***
  ....                             ~~~~~~~~~~~~~~
marijuana:cigarette:alcohol  1       0.37  63.42   0.37   0.54084    
                                    ~~~~~~~~~~~~~

> update(fit3,.~.-marijuana )
...
Residual Deviance: -1.188e-13   AIC: 65.04
                   ~~~~~~~~~~~~~~~~~~~~~~~~~                   

>update(fit3,.~.-marijuana:cigarette:alcohol )
 ...
Residual Deviance: 0.374        AIC: 63.42 
                   ~~~~~~~~~~~~~~~~~~~~~~~~~

i find 0.374 and 63.42 are equal the result from drop1,but   "Residual Deviance: -1.188e-13   AIC: 65.04   " is not.

so i wonder why? what does the drop1 work exactly?

thank you !




More information about the R-help mailing list