# Incorporate correlation between pre-post measurement into calculating SMD in R?

I have tried looking for this answer on every website, unfortunately without any luck. I hope you can help me out.

I have calculated SMD in R(metafor package, escalc function) for a number of pre-post studies. But I have not yet incorporated a correlation coefficient, which is advised for pre-post effect sizes. How do I do this in R?

Example data:

mydata <- cbind(m1, m2, sd1, sd2, n1, n2, r)
m1= c(6.0, 18.0, 8.0, 5.6)
m2= c(6.4, 3.5, 4.0, 3.6)
sd1= c(5.92, 13.50, 10.80, 10.60)
sd2= c(6.24, 6.90, 8.10, 10.76)
n1= c(34, 38, 54, 200)
n2= c(33, 38, 54, 160)
r= rep(0.70, times=4)


Calculating SMD without incorporating a correlation coefficient:

library("metafor")
mydata <- escalc(measure="SMD", data= mydata,
m1i = m1,
m2i = m2,
sd1i = sd1,
sd2i = sd2,
n1i = n1,
n2i = n2)


My unsuccesful attempt at incorporating a correlation coefficient:

mydata <- escalc(measure="SMD", data= mydata,
m1i = m1,
m2i = m2,
sd1i = sd1,
sd2i = sd2,
n1i = n1,
n2i = n2,
ri = r)


I have taken a look at this previous question, but do not see how I can adapt this in escalc. This question did not provide an answer either.

Second question: is incorporating correlations possible in caluating OR's as well?

• Are the data in each row supposed to be from a single group that is measured twice, for example once before and once after a treatment? – Wolfgang Aug 6 '18 at 14:38
• Yes that is correct. To clarify further: each row is a separate study with m1=pre-treatment mean, m2=post-treatment mean, sd1=pre-treatment sd, sd2=post-treatment sd etc. r=correlation between pre- and post-measurement in that study. – RRRRred Aug 6 '18 at 15:46

For single-group pre-test post-test data, you should be using the standardized mean change, either using change score standardization or raw score standardization (the latter is conceptually more similar to the standardized mean difference for two independent groups). See help(escalc) and then serach for for "standardized mean change". You might also want to read:
As for your second question: Yes, there are also measured for single-group pre-test post-test data with a dichotomous dependent variable. For example, there is the "conditional log odds ratio" and the "marginal log odds ratio" (the latter is conceptually more similar to the log odds ratio of two independent groups). See again help(escalc) and search for these two terms. Useful references here are: