Skip to content
Prev 13531 / 20628 Next

MCMCglmm predictions with new data for multi-response model

Hi Rafter,

(a) You're on the right track.

(b) The design matrix is available at m2b$X. If you take a look, you'll see
how it's formatted. Something like temp <- as.matrix(m2b$X) %*% t(m2b$Sol)
should be what you want, just replacing "as.matrix(m2b$X)" with your new
data, in the same format.

(c.1) Because your outcomes are Gaussian, you don't need to do anything
with the random effects to generate predictions that are marginalized over
the random effects. That's only an issue for other sorts of outcomes
(binary, categorical, etc.). So your steps 5 and 6 are unnecessary. Your
"temp" is already your "pred_mat".

(c.2) I believe you're looking for apply(temp, 1, function(x)
HPDinterval(as.mcmc(x))).

Cheers,
Malcolm



Date: Mon, 6 Jul 2015 16:54:52 -0500