Skip to content

Extracting specific samples from MCMCglmm

6 messages · Robin Jeffries, Ben Bolker, Jarrod Hadfield

#
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

  I believe that if m is a an MCMCglmm fit, m$Liab will get you the
"Posterior distribution of latent variables" (see ?MCMCglmm); I'm not
sure whether there is useful information about the structure encoded in
the object, but see if colnames(m$Liab) gets you something helpful.

  Ben Bolker
On 02/04/2011 02:50 PM, Robin Jeffries wrote:
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk1MWmMACgkQc5UpGjwzenMwQQCeKlhelTFBDkeilyB+hb7aJ+HV
FTUAoI5BeDVfdcMW+UpkJhnGlC3hDc68
=y+W5
-----END PGP SIGNATURE-----
#
Hi,

If you specify pr=TRUE in the call to MCMCglmm the posterior  
distribution of random effects will be stored. They are in m$Sol in  
columns after the fixed effects.  You can obtain your predictions "by  
hand" by extracting the relevant random effects. Alternatively you can  
use the predict function, but currently this will only predict the  
data points used in model fitting.  In your case you want to use the  
random effects in the prediction rather than marginalising them so  
specify marginal=NULL in the call to predict. To obtain prediction  
intervals instead of confidence intervals specify  
interval="prediction" in the call to predict. This obtains prediction  
intervals using posterior predictie simulation so can be slow.

Cheers,

Jarrod




Quoting Ben Bolker <bbolker at gmail.com>: