Created
August 31, 2022 05:36
-
-
Save cmrnp/ae0bc850c45047465f1b3c34c4c2a1f6 to your computer and use it in GitHub Desktop.
Using emmeans with metafor objects - "quick and dirty reference grid"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Using emmeans with metafor objects - "quick and dirty reference grid" | |
# usage: | |
# emmeans(qdrg_metafor(my_metafor_object), "categorical_var") | |
qdrg_metafor <- function(object) { | |
coefs <- coef(object) | |
names(coefs)[1] <- "(Intercept)" | |
vcovs <- vcov(object) | |
rownames(vcovs)[1] <- "(Intercept)" | |
colnames(vcovs)[1] <- "(Intercept)" | |
qdrg( | |
formula = formula(object), | |
coef = coefs, | |
vcov = vcovs, | |
data = object$data | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment