[R-meta] Effect coding in metafor
Yogev Kivity
yogev_k at yahoo.com
Mon Feb 26 04:37:45 CET 2018
Hi all,
I am running a meta-analysis with 2 categorical moderators, one is dichotomous and the other has 3 levels (e.g. x1 and x2). For example:
rma.mv(yi, V, mods=~factor(x1)*factor(x2), random = ~ 1 | StudyID/GroupID/EffectSizeID, data=DataF)
(the specifics of the design of the meta-analysis seemed irrelevant to me, but if I am mistaken, I am happy to provide further details)
As a first step, I am interested in the main effects of both moderators as well as the interaction effect. Therefore, to my understanding, I need both moderators to be set as effect coding factors, rather then dummy coding factors. However, I could not figure out a way to do it in metafor. For example, setting the following contrasts did not work, and essentially the output remained identical to that of the dummy variables (i.e., each estimate expresses the simple effect of the moderator within the reference category of the other moderator):
contrasts(Data$x1)<-c(-.5,.5)
Obviously, I can get around the problem by creating multiple numeric variables with weights that correspond to the desired effect coding, but I was wondering whether I am missing something and whether there is a more elegant way of doing it.
Best,Yogev
--
Yogev Kivity, Ph.D.
Postdoctoral Fellow
Department of Psychology
The Pennsylvania State University
Bruce V. Moore Building
University Park, PA 16802
Office Phone: (814) 867-2330
[[alternative HTML version deleted]]
More information about the R-sig-meta-analysis
mailing list