Skip to content
Prev 31614 / 398506 Next

multcomp and lme

not really, there are huge differences.
it is possible, yes, but you have to do some extra work. The package
offers two low-level functions `csimint' and `csimtest' which compute
adjusted p-values based on the estimated effects and their covariance
matrix. That means that you have to

1) compute the appropriate contrast matrix (maybe using `contrMat')
2) define the contrasts of the factor of interest (there is a section
   in MASS on how to do it)
3) fit the model
4) and compute the covariance matrix via `vcov'

and you have everything you need to proceed. I attach a short example
using glm, lme should be along the same lines...

best,

Torsten

---------------------------------------------------------------------

library(multcomp)

set.seed(290875)

# a factor at three levels
group <- factor(c(rep(1,10), rep(2, 10), rep(3,10)))

# Williams contrasts
contrasts(group) <- mginv(contrMat(table(group), type="Will"))

# a binary response
z <- factor(rbinom(30, 1, 0.5))

# estimate the model
gmod <- glm( z ~ group, family=binomial(link = "logit"))

# exclude the intercept
summary(csimtest(coef(gmod)[2:3], vcov(gmod)[2:3,2:3],
                 cmatrix=diag(2), df=27))
_______________________________________________________________________
|									|
|	Dipl.-Stat. Torsten Hothorn					|
|	Institut fuer Medizininformatik, Biometrie und Epidemiologie	|
|	Waldstrasse 6, D-91054 Erlangen, Deutschland			|
|	Tel: ++49-9131-85-22707	(dienstl.)				|
|	Fax: ++49-9131-85-25740						|
|	Email: Torsten.Hothorn at rzmail.uni-erlangen.de			|
|	Web: http://www.imbe.med.uni-erlangen.de/~hothorn		|
|_______________________________________________________________________|