[R] Post hoc Multiple comparison

Torsten Hothorn Torsten.Hothorn at rzmail.uni-erlangen.de
Mon Oct 14 14:06:10 CEST 2002


> Dear R-listers
> 
> I'm a new R-user who needs some help with a test that I want to do. I
> have done a field experiment: four treatments (cont, x, y and xy) at
> three sites (A, B and C), the response is count data (0 - 15). I've done
> a Poisson regression:
> 
> 
> >glm(response~as.factor(treatment)*as.factor(site), family=quasipoisson,
> offset(max.response), data=dat)
> 
> The "offset" is the maximum response for the sample, different for each
> sample (8 - 34). To extract, I've used:
> 
> 
> >drop1(dat.glm, .~., test="Chisq")
> 
> However, how do I do a post-hoc multiple comparison to see which
> treatment(s) and interaction(s) are giving significant effects? I have
> found the "multcomp package" with the "csimtest" but it requires the
> "parameter estimates", how do I get these for all my "treatments" and
> "sites?
> 

you can extract the parameter estimates from the model using `coef' and
their covariance matrix by `vcov'. Maybe you need to pass the constrasts
of interest to glm, for example using:

R> contrasts(treatment) <- C

where C is the MP-inverse of your contrast matrix (see MASS3, 1999, page
200 for more details). That gives you all you need for calling
csim{int,test}.

Torsten

> 
> Yours sincerely
> Micke
> 
> 
> ************************************************************************
> ******
> Mikael Niva
> Dept. of Plant Ecology
> EBC, Uppsala universitet
> 
> 
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> 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
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
> 

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