metafor
metafor copied to clipboard
Random efffect BLUP COV
Classification:
Feature Request
Summary
I would find it useful in some applications to have the full covariance matrix from ranef()
, rather than just the standard errors.
Am I correct in assuming that vpred
here: https://github.com/wviechtb/metafor/blob/6a536012034de4dcf69152a75d822d9df2cf4af2/R/ranef.rma.mv.r#L178
is what I am looking for?
Thanks.
Yes, this is correct (vpred
is the entire var-cov matrix and then a few lines further se <- sqrt(diag(vpred))
just takes the square-root of its diagonal elements to get the SEs). So, you could just hack your own function to extract that.
Adding this feature more generally is not unreasonable and in fact there is a bit of a precedent to this in predict.rma()
, which has a vcov
argument which, when set to TRUE
, returns the var-cov matrix of the predicted values. ranef.rma.mv()
is a bit more tricky though, because it can return multiple sets of BLUPs simultaneously.