[R-sig-ME] fixed effects (co)variance matrix from MCMCglmm

Ben Bolker bbolker at gmail.com
Mon Nov 19 15:58:37 CET 2012

Katie Colborn <benton at ...> writes:

> Hi:
> How do I obtain the variances (and covariances) for the fixed effects 
> from an MCMCglmm object? In a
> frequentist setting I would simply use algebra to obtain it from 
> the confidence intervals if it was not
> provided; however, I'm not sure if this is equivalent in
>  Bayesian credible intervals. Is it as simple as:
> coeff - 1.96*SE = lower 95% CI?
> Or is it sd(model$Sol)[1:3]?
> If you solve for SE in the equation above it is 
> not equal to sd(model$Sol) (even after dividing by root n).
> Thanks for your help!

  You have to be careful to distinguish between the standard deviation
and the standard error in this case, and to be aware that the posterior
distributions may not be multivariate normal.

  *If* the posteriors are multivariate normal, then

v <- var(model$Sol)  should give the variance-covariance matrix,

and sqrt(diag(v)/nrow(model$Sol))  should give the standard errors.

  If they're not multivariate normal (or at least if the marginal
posteriors aren't normal) then the credible intervals won't line
up with +/- 1.96*SE ...

  If in doubt, take a look at some density plots and scatterplots
of the posterior densities to get a better sense of what's going on.

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