The mean change can stay fixed while the precision changes dramatically.
Twenty people take the same test before and after training. The average post score is always exactly 3 points higher than the average pre score.
1a. If people who score high at pre-test also tend to score high at post-test, what do you predict will happen to the variability of the difference scores?
1b. If we incorrectly analyze the same two columns as though they came from different people, will that analysis benefit from the pre/post correlation? Why or why not?
Q1. Both views contain a “pre” column and a “post” column. What determines whether the paired test is legitimate?
The marginal distributions are held fixed: pre M = 50, post M = 53, and both SDs = 10 at every setting. Only the correlation between each person's pre and post scores changes.
SE of mean difference: 3.162
t(19): 0.949
p: .355
Cohen's dz: 0.212
SE of mean difference: 3.162
t(38): 0.949
p: .349
This calculation ignores which post score belongs to which person.
| Pre/post r | SD(diff) | Paired SE | Paired p | Independent SE |
|---|---|---|---|---|
| 0.00 | ||||
| 0.50 | ||||
| 0.75 | ||||
| 0.90 |
Q2. The pre mean, post mean, pre SD, and post SD never changed. Why did the paired p-value change so much?
Q3. Why did the independent-test standard error stay at 3.162 at every slider setting?
Q4. At r = .90, the paired test is significant while the independent calculation is not. Explain this without saying the paired test “creates” a larger mean effect.
Set the slider to r = .75. Now compare the correct row matching with a deliberately scrambled post column. Every pre value and every post value remains exactly the same; only the person-to-person matching changes.
Correlation: .750
SE: 1.581
p: .073
SE: 3.162
p: .349
Unchanged, because the two marginal columns are unchanged.
Q5. Scrambling rows changed the paired result but not the independent result. Why is that exactly what should happen?
Q6. Suppose the columns actually came from two unrelated groups. Why would running a paired test make the answer depend on an arbitrary spreadsheet row order?
This code reconstructs the fixed simulator. Run it before opening the output reveal.
n <- 20
u <- as.numeric(scale(1:n))
z_raw <- c(1, -2, 3, -4, 5, -1, 2, -3, 4, -5,
1, -2, 3, -4, 5, -1, 2, -3, 4, -5)
z <- resid(lm(z_raw ~ u))
z <- z / sd(z)
make_data <- function(rho) {
pre <- 50 + 10 * u
post <- 53 + 10 * (rho * u + sqrt(1 - rho^2) * z)
data.frame(pre, post)
}
summarize_pairing <- function(rho) {
d <- make_data(rho)
diffs <- d$post - d$pre
paired <- t.test(d$post, d$pre, paired = TRUE)
independent <- t.test(d$post, d$pre)
c(
r = cor(d$pre, d$post),
mean_diff = mean(diffs),
sd_diff = sd(diffs),
paired_se = sd(diffs) / sqrt(n),
paired_t = unname(paired$statistic),
paired_p = paired$p.value,
dz = mean(diffs) / sd(diffs),
independent_se = sqrt(var(d$pre)/n + var(d$post)/n),
independent_t = unname(independent$statistic),
independent_p = independent$p.value
)
}
round(sapply(c(0, .5, .75, .9), summarize_pairing), 3)
# Now break the row matching at rho = .75
d <- make_data(.75)
scrambled_post <- c(tail(d$post, 7), head(d$post, 13))
round(c(
correct_r = cor(d$pre, d$post),
scrambled_r = cor(d$pre, scrambled_post),
correct_p = t.test(d$post, d$pre, paired = TRUE)$p.value,
scrambled_p = t.test(scrambled_post, d$pre, paired = TRUE)$p.value,
independent_p = t.test(d$post, d$pre)$p.value
), 3)
Selected slider settings: r 0.000 0.500 0.750 0.900 mean_diff 3.000 3.000 3.000 3.000 sd_diff 14.142 10.000 7.071 4.472 paired_se 3.162 2.236 1.581 1.000 paired_t 0.949 1.342 1.897 3.000 paired_p 0.355 0.196 0.073 0.007 dz 0.212 0.300 0.424 0.671 independent_se 3.162 3.162 3.162 3.162 independent_t 0.949 0.949 0.949 0.949 independent_p 0.349 0.349 0.349 0.349 Row matching at r = .75: correct_r 0.750 scrambled_r -0.278 correct_p 0.073 scrambled_p 0.412 independent_p 0.349
Q7. In one sentence, what is the paired test actually testing?
Q8. Where should you check the normality assumption for this analysis: pre scores, post scores, or difference scores? Explain.
Q9. Re-read Step 1. What did the simulator add to your understanding of why pairing can increase power?
Q10. Complete this sentence: “I should use a paired t-test when ___, because ___.”
Filename: pairing-buys_lastname1_lastname2.pdf