[R-meta] Random slopes in rma.mv
Francisco Tapia
|r@nc|@co@n|ne| @end|ng |rom hotm@||@com
Sun May 23 20:33:27 CEST 2021
Thanks for your answers Wolfgang. I�ll clarify some points:
1. Indeed, the structure (~X | ID2/ID1) does not work. This point connected with the 2nd one, as I wanted to know how to add the random slopes just for ID2.
2. �Could the following structure work in the same way?
Random = list( ~ 1 | ID2, ID1, ~ X -1 | ID2) (Using the lmer syntax)
1. So sorry it wasn�t clear enough. I meant:
Level 1: Effect sizes.
Level 2: ID1
Level 3: ID2 and ID3
Which translates to:
ES / ID1 / (ID2 & ID3), therefore I would have the effect size Yi(jk), where the i-eth outcome is crossed between ID2 and ID3, both at the same level 3.
Thanks again for your answers!
Francisco Tapia
From: Viechtbauer, Wolfgang (SP)<mailto:wolfgang.viechtbauer using maastrichtuniversity.nl>
Sent: Sunday, May 23, 2021 12:45 PM
To: Francisco Tapia<mailto:Francisco.ninel using hotmail.com>; r-sig-meta-analysis using r-project.org<mailto:r-sig-meta-analysis using r-project.org>
Subject: RE: Random slopes in rma.mv
Dear Francisco,
See below for my responses.
Best,
Wolfgang
>-----Original Message-----
>From: R-sig-meta-analysis [mailto:r-sig-meta-analysis-bounces using r-project.org] On
>Behalf Of Francisco Tapia
>Sent: Thursday, 20 May, 2021 18:29
>To: r-sig-meta-analysis using r-project.org
>Subject: [R-meta] Random slopes in rma.mv
>
>Dear metanalysis community:
>
>A couple of days ago, Wolfgang provided me the information to add random slopes to
>rma.mv, from the metafor package
>(https://stats.stackexchange.com/questions/524144/random-slopes-in-rma-mv)
>
>By changing the struct to "GEN", I can now add random to my multilevel model. As
>the documentation is not up yet, I wanted to check some things regarding syntaxis
>of the code and the logic behind it:
>
> 1. If I have ID1 nested within ID2, my structure of random effects would be: (
>~ 1 | ID2/ID1) for random intercepts. If I want to add random slopes to ID2,
>Should I do it in another random effect? For example, If I add random slopes to (
>~ 1 | ID2/ID1), therefore -> ( ~ X | ID2/ID1), I'll be adding random slopes for
>each level of ID1 within ID2, and for ID2 as well. Should I leave ( ~ 1 |
>ID2/ID1) alone and create another random effect to add random slopes just for ID2?
~ X | ID2/ID1 doesn't work anyway (you should get an error if you try, at least if you have the 'devel' version installed).
> 2. If I create another random effect to add random slopes to ID2, for example,
>(~ X | ID2), Would I be adding another random intercept for ID2? If so, How, an
>unnecessary intercept, can affect my model? I cannot see it very clearly
Yes, you would be adding random intercepts for each level of ID2 twice. I would avoid doing so. You could do:
random = list(~ 1 | interaction(ID2,ID1), ~ X | ID2), struct="GEN"
to add random intercepts for each ID2-ID1 combination (i.e., for ID1 nested within ID2) and random intercepts and slopes for each level of ID2.
> 3. If I have a crossed random effect at the same level as ID2, let's say (~ 1 |
>ID3) for random intercepts. Can both of them, ID2 and ID3, have different random
>slopes structure from each other, despite being in the same level?
I don't understand what you mean by ID3 being 'at the same level' as ID2.
>Thanks in advance!
>
>Francisco Tapia
[[alternative HTML version deleted]]
More information about the R-sig-meta-analysis
mailing list