# Define standard deviations
<- 9
S_pre <- 11
S_post <- 8 S_change
Calculating Pre/Post Correlation from the Standard Deviation of Change Scores
Step 1: Obtain Pre-test, Post-test, and Change score standard deviations
In order to calculate the pre/post correlation (
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 (
# 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"