# [R] using metafor for meta-analysis of before-after studies

Viechtbauer Wolfgang (STAT) wolfgang.viechtbauer at maastrichtuniversity.nl
Thu Apr 5 13:44:54 CEST 2012

```To add to Michael's response:

There are several things you can do:

1) If the dependent variable is the same in each study, then you could conduct the meta-analysis with the (raw) mean changes, i.e., yi = m1i - m2i, where m1i and m2i are the means at time 1 and 2, respectively. The sampling variance of yi is vi = sdi^2 / ni, where sdi = sqrt(sd1i^2 + sd2i^2 - 2*ri*sd1i*sd2i), sd1i and sd2i are the standard deviations of the outcomes at time 1 and 2, respectively, ri is the correlation between the outcomes at time 1 and time 2, and ni is the sample size. So, sdi is the standard deviation of the change scores.

When sdi is not reported, you will have to back-calculate sdi based on what you have. You say that the p-value for the paired samples t-test is reported. Typically, this will be a two-sided p-value, so ti = qt(pval/2, df=ni-1, lower.tail=FALSE) will give you the value of the test statistic.

And since ti = (m1i - m2i) * sqrt(ni) / sdi, you can back-calculate what sdi is with sdi = (m1i - m2i) * sqrt(ni) / ti (you just have to make sure that the sign of m1i - m2i and the sign of ti are matched up). And now, you can even back-calculate what ri was by rearranging the equation for sdi.

2) Often, the dependent variable is not the same in each study. Then you will have to resort to a standardized outcome measure. There are two options:

a) standardization based on the change score standard deviation

Then yi = (m1i - m2i) / sdi with sampling variance vi = 1/ni + yi^2 / (2*ni).

b) standardization based on the raw score standard deviation

Then yi = (m1i - m2i) / sd1i with sampling variance vi = 2*(1-ri)/ni + yi^2 / (2*ni).

Note that we standardize based on sd1i (i.e., the SD at time 1). So, we do not pool sd1i and sd2i. Also, since ri is typically not reported, you will have to use the method described above to back-calculate what ri was.

Regardless of which approach you use, you can then proceed with the meta-analysis using the yi and vi values. For example, with the metafor package, if those values are in a data frame called dat,

rma(yi, vi, data=dat)

will fit a random-effects model.

Those three outcome measures described above will actually be implemented in an upcoming version of the metafor package. For now, you will have to do the computations of yi and vi yourself.

Best,

Wolfgang

--
Wolfgang Viechtbauer, Ph.D., Statistician
Department of Psychiatry and Psychology
School for Mental Health and Neuroscience
Faculty of Health, Medicine, and Life Sciences
Maastricht University, P.O. Box 616 (VIJV1)
6200 MD Maastricht, The Netherlands
+31 (43) 388-4170 | http://www.wvbauer.com

> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org]
> On Behalf Of Michael Dewey
> Sent: Thursday, April 05, 2012 13:04
> To: MP.Sylvestre at gmail.com; r-help at r-project.org
> Subject: Re: [R] using metafor for meta-analysis of before-after studies
>
> At 18:39 04/04/2012, MP.Sylvestre at gmail.com wrote:
> >Greetings,
> >I wish to conduct a meta-analysis for which the outcome is a continuous
> >variable measured on the same individuals before and after an
> intervention.
> >Hence, the comparison is not made between two groups, but within
> >groups, at diffrent times.
> >
> >Each study reports the mean outcome and SD before the intervention and
> >the mean outcome and SD after the intervention. While p-values for
> >paired t-test (or similar methods for paired data) are reported in the
> >studies, no estimate of the variability of the individual differences are
> available.
>
> If you know the p-value you can generate the t-value If you know the t-
> value and the mean difference you can back calculate the standard errors
> of the differences.
>
> Having said that I am not absolutely sure what the design of the primary
> studies you are analysing is so my answer may not apply directly to your
> problem.
>
>
> >Can metafor deal with this sort of meta-analysis? I know that I can
> >technically run metafor on these data, assuming that the groups are
> >independent but my inference is likely to be wrong. On the other hand,
> >I have no idea of the correlation within individuals.
> >
> >MP
> >
> >         [[alternative HTML version deleted]]
>
> Michael Dewey
> info at aghmed.fsnet.co.uk
> http://www.aghmed.fsnet.co.uk/home.html
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help