[R-sig-ME] predict.MCMCglmm() does not use random effects?

Jonas Lindeløv jonas at cnru.dk
Sun Nov 2 13:28:53 CET 2014

Hi all

I have behavioral data from a classical time (2 levels,
within-subject) x treatment (2 level between-subject) trial on human
subjects. A simple LME model with a random intercept per subject is

fit.lm = lmer(wi ~ session * treatment + (1 | id), data)
plot(na.omit(data$wi), predict(fit.lm))

This produces a nice almost-diagonal plot - the predictions fit the
data. However, fitting the same with MCCMglmm seem to ignore the
random part, just predicting from the 4 possible fixed effect
combinations. Is there a way include random effects in the prediction?
I can see that the random part does increase model fit (DIC=656.7467
vs. DIC 836.5622 without random=~id), so is it specific to the way
that predict.MCMCglmm() works? I did:

fit.mc = MCMCglmm(wi ~ treat * session, random= ~ id, data=data)
plot(data$wi, predict(fit.mc))

Background info: My primary motivation for using MCMCglmm instead of
lmer is that I have missing values on some outcome of the multiple
outcome measures per subject. Conditioning on observed outcome
measures should narrow the posterior over the missing values resulting
in less bias in the fixed effect estimates than removing incomplete
cases. So the model will be extended to be multivariate later.


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