Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Random efffect BLUP COV #68

Open
chfleming opened this issue Jan 23, 2023 · 1 comment
Open

Random efffect BLUP COV #68

chfleming opened this issue Jan 23, 2023 · 1 comment
Labels
enhancement enhancement suggestion

Comments

@chfleming
Copy link

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:

vpred <- G - (GW %*% (I - Hmat) %*% G)

is what I am looking for?

Thanks.

@wviechtb
Copy link
Owner

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.

@wviechtb wviechtb added the enhancement enhancement suggestion label Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement enhancement suggestion
Projects
None yet
Development

No branches or pull requests

2 participants