[R-meta] meta-analysis with 2 within-subject variables

Viechtbauer, Wolfgang (NP) wo||g@ng@v|echtb@uer @end|ng |rom m@@@tr|chtun|ver@|ty@n|
Tue Dec 10 13:03:48 CET 2024


Hi Tom,

Thanks for clarifying the layout.

Given what you show, the first step would be to compute the two mean changes. In essence:

dat <- escalc(measure="MC", m1i=mean.post.N2O, sd1i=sd.post.N2O,
                            m2i=mean.pre.N2O,  sd2i=sd.pre.N2O,
                            ni=n.N2O, ri=???, data=dat, var.names=c("yi.N20","vi.N20"))
dat <- escalc(measure="MC", m1i=mean.post.PLACEBO, sd1i=sd.post.PLACEBO,
                            m2i=mean.pre.PLACEBO,  sd2i=sd.pre.PLACEBO,
                            ni=n.PLACEBO, ri=???, data=dat, var.names=c("yi.PLACEBO","vi.PLACEBO"))

Two notes:

- You need to specify ri (the pre-post correlation). If this is not reported, then you need to make an educated guess about this correlation.
- I noticed that n.N2O=14 but n.PLACEBO=15. I assume this is due to drop-out. We'll just ignore this issue (assuming it is not a major issue across studies).

Next, we restructure the dataset into long format. This can be done with reshape() and I think this should do it (but I always have to tripple check how reshape() works):

dat2 <- reshape(dat, direction="long", varying=list(c("yi.N20","yi.PLACEBO"), c("vi.N20","vi.PLACEBO")), v.names=c("yi","vi"), idvar="study")
dat2 <- sort_by(dat2, ~ study + time)

Then you would want to use vcalc() to compute the var-cov matrix of the estimates, since the two 'yi' values within a study are not independent. This requires some idea about the correlation between the two measurement occasions (N2O vs PLACEBO). Again, presumably this is something you would have to 'guestimate'. Then:

V <- vcalc(dat2, cluster=study, obs=time, rho=???, data=dat2)

Then I would use:

rma.mv(yi, V, mods = 0 + factor(time), random = ~ time | study, struct="UN", data=dat2)

for fitting a bivariate model to these estimates.

I think this should do it.

Best,
Wolfgang

> -----Original Message-----
> From: zeffiro neurometrika.org <zeffiro using neurometrika.org>
> Sent: Friday, December 6, 2024 15:46
> To: r-sig-meta-analysis using r-project.org
> Cc: Viechtbauer, Wolfgang (NP) <wolfgang.viechtbauer using maastrichtuniversity.nl>
> Subject: [R-meta] meta-analysis with 2 within-subject variables
>
> Hi Wolfgang,
>
> Thanks for looking at the problem. I expected that much of the answer lay in
> proper combination of the effects in escalc.
>
> For the relatively simple example we want to explore, the behavioral measures
> are the same across the studies, are continuous, and all on the same scale -
> measureed using self-report scales of depression.
>
> It is a cross-over design comparing treatment(N2O) to placebo, so each subject
> is measured 4 times over a course of 8-12 weeks -  pre/post treatment and in
> N2O/placebo conditions. We are interested in exploring the consistency of the
> treatment vs placebo effect across studies, properly accounting for the expected
> within-subject correlations.
>
> Here is the data layout:
> Author   Year  n.N2O mean.pre.N2O   sd.pre.N2O  mean.post.N2O  sd.post.N2O
> n.PLACEBO   mean.pre.PLACEBO  sd.pre.PLACEBO mean.post.PLACEBO sd.post.PLACEBO
> Study
> xxxx     20xx     14          19.1        4.25           12.1         7.28
> 15               17.1            8.87              11.7            5.89       1
> ...
>
> So, to rephrase the question:
> * How can escalc be used in this context to estimate the effect sizes, sampling
> variances and covariances for rma.mv()?
> * What would the subsequent call to rma.mv() look like?
> Regards,
> Tom
>
> Date: Fri, 6 Dec 2024 09:13:09 +0000
> From: "Viechtbauer, Wolfgang (NP)"
>         <mailto:wolfgang.viechtbauer using maastrichtuniversity.nl>
> To: R Special Interest Group for Meta-Analysis
>         <mailto:r-sig-meta-analysis using r-project.org>
> Cc: zeffiro neurometrika.org <mailto:zeffiro using neurometrika.org>
> Subject: Re: [R-meta] meta-analysis with 2 within-subject variables
>
> Dear Tom,
>
> I don't have any worked examples for this. However, before rma.mv(), the first
> step is the calculation of the effect sizes, their sampling variances, and
> covariances if there are multiple effect sizes for a given group. I assume you
> want to compute the pre-post change for each condition, so that would be two
> effects for a group. Is the response variable dichotomous or continuous? And if
> it is continuous, is the scale the same across studies (so one can stick to mean
> differences) or does it differ across studies (so one has to consider effect
> size measures that are comparable across different scales)?
>
> Best,
> Wolfgang
>
> > -----Original Message-----
> > From: R-sig-meta-analysis <mailto:r-sig-meta-analysis-bounces using r-project.org>
> On Behalf
> > Of zeffiro neurometrika.org via R-sig-meta-analysis
> > Sent: Tuesday, December 3, 2024 17:27
> > To: mailto:r-sig-meta-analysis using r-project.org
> > Cc: zeffiro neurometrika.org <mailto:zeffiro using neurometrika.org>
> > Subject: [R-meta] meta-analysis with 2 within-subject variables
> >
> >  I have a question about how to set up the metafor code to perform a meta-
> > analysis using an experimental design that is fairly common in cross-over
> > treatment studies.
> >
> >  We have continuous outcome measures (mean and sd) from studies in which each
> > participant was measured 4 times: 1) in both drug and placebo conditions and
> 2)
> > both before and after exposure - in a cross-over design. So,
> > each study is a 2x2 factorial design with 2 repeated measures.
> >
> > Although it looks to me as if rma.mv is the appropriate program for this
> > analysis, I am having difficulty determining the syntax showing how to set
> > things up to properly handle the within subject correlation and was hoping
> that
> > someone could point me to a worked example to use as a guide. I have not found
> > anything addressing meta-analysis modeling of multiple repeated measures in a
> > single group.
> >
> > We are starting out with only 5 studies in the initial meta-analysis.
> >
> > Thanks in advance for any guidance you can provide.
> >
> > Regards,
> > Tom



More information about the R-sig-meta-analysis mailing list