[R] Fwd: binomial glm and sole effect of the treatment

Ben Bolker bbolker at gmail.com
Fri May 10 14:06:05 CEST 2013


Katarzyna Kulma <katarzyna.kulma <at> gmail.com> writes:

> 
> Hiya,
> 
> I'm using simple glm binomial models to test the effect of treatment
> (factor, 3 levels) on infection prevalence (infected/uninfected):
> 
> ad3<-glm(Infection~ecs, family=binomial, data=eilb)
> 
> but summary() function returns for each of the factor-level coefficients
> against the control treatment:
> 
> > summary(ad3)
> 
> 
> What I want to know is whether the treatment in general had an effect on
> infection prevalence, not the difference between respective factor levels.
> If it was a general linear model I could switch between using lm() and
> aov() functions, but how can I proceed here? I sense I'm missing something
> obvious, so I'll appreciate your help!
> 


  either

ad3B <- update(ad3,.~1)
anova(ad3,ad3B)

or

drop1(ad3,test="Chisq")

should do what you want (a likelihood ratio test between the model
containing the treatment and the model without the treatment).

Bonus, the likelihood ratio tests will be more accurate than
the Wald tests provided by summary().



More information about the R-help mailing list