```
# Define standard deviations
<- 9
S_pre <- 11
S_post <- 8 S_change
```

# Calculating Pre/Post Correlation from the Standard Deviation of Change Scores

*Meta-Analysis Magic*! In this post we will go over a couple of ways to directly calculate pre/post correlations from alternative statistics such as standard deviations of change scores. Pre/post correlations are necessary to obtain various types of effect sizes and standard errors such as the repeated measures variant of Cohen’s \(d\), also referred to as Cohen’s \(d_{rm}\).

## Step 1: Obtain Pre-test, Post-test, and Change score standard deviations

In order to calculate the pre/post correlation (\(r\)), we need an estimate of the standard deviation (SD) of pre-test scores (\(S_{pre}\)), the SD of post-test scores (\(S_{post}\)), and the SD of change scores (\(S_{change}\), where \(x_{change}=x_{post}-x_{pre}\)). If the post-test SD is unavailable, but the pre-test SD is available, you can approximate the post-test SD by, first, taking average ratio of the pre-test SD and post-test SD from \(k\) studies in the current meta-analysis,

\[ \bar{S}_{ratio}=\frac{1}{k}\sum_{i=1}^k \frac{S_{post,i}}{S_{pre,i}} \] Then we can make an approximation of the post-test SD by multiplying the pre-test SD by the average SD ratio,

\[ S_{post}\approx \bar{S}_{ratio}\times S_{pre} \]

A rougher approximation would be to simply set the pre-test SD and post-test SD to be equal.

## Step 2: Calculate the Pre/Post Correlation

The correlation between pre-test and post-test scores (\(r\)) can be calculated by re-arranging the equation for change score SD:

\[ S_{change} = \sqrt{S^2_{pre} + S^2_{post} - 2rS_{pre}S_{post}} \] Then we can solve for \(r\),

\[ r = \frac{S^2_{pre} + S^2_{post} - S^2_{change}}{2S_{pre}S_{post}} \] Note that this is a direct conversion and not merely an approximation.

```
# Calculate pre/post correlation
<- (S_pre^2 + S_post^2 - S_change^2) / (2*S_pre*S_post)
r
# Print results
print(paste0('r = ',round(r,3)))
```

`[1] "r = 0.697"`

## Applying it to a simulated dataset

We can simulate correlated pre/post scores from a bivariate Gaussian with known parameters. It can be seen that the correlation calculated from the formulas above is perfectly precise.

```
# install.packages('MASS')
library(MASS)
# Define parameters
<- 9
S_pre <- 11
S_post <- .70
r_true
# Simulate correlated pre/post scores from bivariate gaussian
<- mvrnorm(n=200,
data mu=c(0,0),
Sigma = data.frame(x=c(S_pre^2,r_true*S_pre*S_post),
y=c(r_true*S_pre*S_post,S_post^2)),
empirical = TRUE)
# Obtain simulated scores
<- data[,1] # Pre-test scores
x_pre <- data[,2] # Post-test scores
x_post <- x_post - x_pre # Calculate change scores
x_change
# Calculate standard deviations
<- sd(x_pre)
S_pre <- sd(x_post)
S_post <- sd(x_change)
S_change
# Calculate pre/post correlation
<- (S_pre^2 + S_post^2 - S_change^2) / (2*S_pre*S_post)
r
print(paste0('r = ',r))
```

`[1] "r = 0.7"`