Skip to content
Prev 6226 / 20628 Next

Jointly test multiple terms in a MCMCglmm model to be zero

Hi Paul,

thanks a lot for your answer and for the very useful reference. Yes,  
you are right when you says that is odd to test whether the Diet  
coefficients are all zeros while allowing the interaction between Diet  
and Time.

However, my question was more general: how to jointly test whether  
multiple coefficients in a MCMCglmm model are all zero. For example,  
given a model with coefficients Beta0, Beta1, ..., Beta10, I may want  
to test this null hypothesis on a given subset of coefficients:

H0: Beta1 = Beta4 = Beta5 = Beta6 = 0

Let me give another, more practical example. In the model "weight ~  
Time + Diet + Time:Diet" (weight and Time continuous, Diet categorical  
with three values), there are 6 different coefficients: intercept,  
B_time, B_diet1, B_diet2, B_(time:diet1), B_(time:diet2). If one wants  
to assess whether the time has any effect on the body weight in AT  
LEAST ONE diet, the following null hypothesis should be tested:

H0: B_time = B_(time:diet1) = B_(time:diet2) = 0

The anova.lme function provide the option "Terms" for performing such  
type of tests. After reading your email, I guess that the easiest way  
to perform a similar test in MCMCglmm models is the following:

#loading the libraries
require(MCMCglmm)
require(nlme)

#setting the contrasts and the seed
contrasts(BodyWeight$Diet) = contr.sum(3)
set.seed(1234)

#fitting the models
model.lme <- lme(weight ~ Time * Diet, data = BodyWeight, random= ~ Time)
model.mcmc <- MCMCglmm(weight ~ Time * Diet, data = BodyWeight,  
random= ~ Time, verbose=FALSE)
model.mcmc.noTime <- MCMCglmm(weight ~ Diet, data = BodyWeight,  
random= ~ Time, verbose=FALSE)

#checking the significance of the terms: the anova function with the "Terms"
#option will provide a p-value for checking if ANY coefficients  
related to Time
#is different from zero
anova(model.lme, type = 'm', Terms = c('Time', 'Time:Diet'))

#DIC- bases "test"
model.mcmc$DIC - model.mcmc.noTime$DIC

Both the DIC and the anova tests confirm that the couple of terms  
<Time, Time:Diet> is relevant, thus I conclude that at least one of  
the three coefficients is different from zero.

My final intention is to employ both MCMC and nlme models in order to  
strengthen my analysis. In particular, my idea is to compare nlme  
p-values with MCMC statistics; since there is not general agreement  
about how to calculate p-values  for mixed models, I prefer to double  
check my finding.

Ciao,

Vincenzo


Paul Johnson <Paul.Johnson at glasgow.ac.uk> ha scritto:
-- 
Vincenzo Lagani
Visiting Researcher
BioInformatics Laboratory
Institute of Computer Science
Foundation for Research and Technology - Hellas