[R-meta] Random Effect for Continuous Moderator in Three-Level Meta-Analysis
Viechtbauer, Wolfgang (SP)
wolfg@ng@viechtb@uer @ending from m@@@trichtuniver@ity@nl
Fri Jan 11 00:47:23 CET 2019
Hi Andrew,
Yes, this is possible if you install the 'devel' version of metafor. It includes an as-of-yet undocumented 'struct' option, namely "GEN". This allows for random effects terms, such as:
~ x1 + x2 + ... | factor
where x1, x2, and so on can be continuous (but also categorical) variables. So, for the example you used, it would be:
m2.ml <- rma.mv(yi, vi,
random = ~ I(year-1990.591)| district, struct="GEN",
method="ML",
digits = 3,
data=dat.konstantopoulos2011)
BUT:
1) Unless you want to assume that the average slope is 0, one should also include the same predictor as a fixed effect:
m2.ml <- rma.mv(yi, vi, mods = ~ I(year-1990.591),
random = ~ I(year-1990.591)| district, struct="GEN",
method="ML",
digits = 3,
data=dat.konstantopoulos2011)
2) 'year' is actually constant within districts, so the use of random slopes for this predictor doesn't make much sense.
Note: The "GEN" structure is undocumented, which implies that this feature is really still in the testing phase.
Best,
Wolfgang
>-----Original Message-----
>From: R-sig-meta-analysis [mailto:r-sig-meta-analysis-bounces using r-
>project.org] On Behalf Of Andrew Loignon
>Sent: Thursday, 10 January, 2019 21:08
>To: r-sig-meta-analysis using r-project.org
>Subject: [R-meta] Random Effect for Continuous Moderator in Three-Level
>Meta-Analysis
>
>Hi everyone,
>
>I was wondering if it was possible to specify a random effect for a
>continuous moderator in a multi-level meta-analysis using metafor. When I
>try to estimate a model, like the one below (using the Konstantopoulos
>data) I receive an error:
>
>m2.ml <- rma.mv(yi, vi,
> random = ~ I(year-1990.591)| district,
> method="ML",
> digits = 3,
> data=dat.konstantopoulos2011)
>
>Here's the error message:
>
>Error: Inner variable in '~ inner | outer' term must be a factor or
>character variable when 'struct="CS"'.
>
>Any suggestions would be very much appreciated.
>
>Thanks,
>Andrew C. Loignon
>Assistant Professor
>2716 Business Education Complex
>Rucks Department of Management
>E. J. Ourso College of Business
>Louisiana State University
>Baton Rouge, LA 70808
>Email: aloignon using lsu.edu<mailto:aloignon using lsu.edu>
>Phone: 225-578-6148
More information about the R-sig-meta-analysis
mailing list