[R-sig-ME] Jointly test multiple terms in a MCMCglmm model to be zero

vlagani at ics.forth.gr vlagani at ics.forth.gr
Wed Jun 15 14:53:31 CEST 2011

Hello listmembers,

I am interested in testing whether multiple coefficients of a MCMCglmm  
model are all zero. In particular, I have a categorical term in the  
model with four different values, and I want to check if this term is  
significant or not (that means, I want to check if *any* of the three  
coefficients encoding this term is statistically different from zero).

Please accept my apologizes if this question has already been  
answered, but I spent two days looking for an answer across mailing  
lists, MCMCglmm help pages and vignettes, and I have not found  
anything (maybe I am just not so good in searching!)

So, here a small example code:

#loading the libraries

#setting the contrasts
contrasts(BodyWeight$Diet) = contr.sum(3)

#fitting the models: I am interested in the Diet term, that is a categorical
#variable with 3 values
model.lme <- lme(weight ~ Time * Diet, data = BodyWeight, random= ~ Time)
model.lmer <- lmer(weight ~ Time * Diet +(Time|Rat) , data = BodyWeight)
model.mcmc <- MCMCglmm(weight ~ Time * Diet, data = BodyWeight,  
random= ~ Time, verbose=FALSE)

#checking the significance of the terms: the anova function will provide a
#p-value for the Diet term in the lme model, and an F value for the lme4 model
#How to obtain a similar statistic/pvalue for the MCMC model?
anova(model.lme, type = 'm')
anova(model.lmer, type = 'm')

Thanks in advance,


More information about the R-sig-mixed-models mailing list