Message-ID: <CA+dzWjr6BDUj7ofn46XNa+xnHW5sJyxjKDjoCuLXWMtBijCq6w@mail.gmail.com>
Date: 2023-09-11T03:32:26Z
From: Yuhang Hu
Subject: [R-meta] Specifying variable names in metafor::vec2mat()
Hello Everyone,
I'm using the metafor::vec2mat() as shown in the toy example below.
However, I wonder how I should specify the order of the variables' names
defined in "dimnames=" when converting the vector of coefficients to a
correlation matrix using metafor::vec2mat()?
Is there generally a rule or a technique to order the variables' names
correctly in "vec2mat()", especially if there are many variable names?
Thanks,
Yuhang
# EXAMPLE:
tmp <- rcalc(ri ~ var1 + var2 | study, ni=ni, data=dat.craft2003)
V <- tmp$V
dat <- tmp$dat
res <- rma.mv(yi~ var1.var2 - 1, V,
random = ~ var1.var2| study, struct = "UN",
data=dat)
vec2mat(coef(res), dimnames= ??????)
[[alternative HTML version deleted]]