[R-sig-ME] predict.MCMCglmm() does not use random effects?
j.hadfield at ed.ac.uk
Sun Nov 2 14:04:50 CET 2014
Quoting Jonas Lindeløv <jonas at cnru.dk> on Sun, 2 Nov 2014 13:28:53 +0100:
> 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.
> R-sig-mixed-models at r-project.org mailing list
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.
More information about the R-sig-mixed-models