[R] multcomp and glm

Jesse.Whittington@pc.gc.ca Jesse.Whittington at pc.gc.ca
Mon May 19 23:52:14 CEST 2003

I have run the following logistic regression model:

options(contrasts=c("contr.treatment", "contr.poly"))
m <- glm(wolf.cross ~ null.cross + feature, family = "binomial")

wolf.cross = likelihood of wolves crossing a linear feature
null.cross = proportion of random paths that crossed a linear feature
feature = CATEGORY of linear feature with 5 levels: high-use road, low-use
road, high-use trail, low-use trail, and railway line

I would like to determine whether wolves are more likely to cross some
features than others and am using csimtest in the package multcomp to do

x <- coef(model)
var.cov <- vcov(model)
df <- model$df.residual
contrast.matrix <- contrMat(rep(2,length(x), type = "Tukey")
post.hoc <- csimtest(estpar = x, df=df, covm = var.cov, cmatrix =

My questions are:
(1) Have I entered my parameters for the posthoc analysis correctly and
does it matter which categorical variable I use as my reference category?

(2) How do I omit the continuous variable "null.cross" from the list of
multiple comparisons?

I would be most grateful for any assistance you can give me,
Jesse Whittington

Jasper National Park
Box 10,
Jasper, Alberta
(780) 852-6187

More information about the R-help mailing list