Answer
How to analyze pre-post data: change scores, paired t test or ANCOVA?
The short answer
If groups were randomized, the usual best choice is ANCOVA: regress the post score on group and the baseline score. It is unbiased, and more precise than comparing change scores or post scores alone. A paired t test on one group's pre-post difference cannot separate the treatment from time trends and regression to the mean, so it needs a control group to mean much.
Four ways to analyze a baseline and a follow-up
Pre-post data have the same people measured before and after something happens. The options differ in which question they answer and how precisely they answer it.
- Paired t test on the pre-post difference in one group. Tests whether scores changed on average. Without a control group, any change mixes the treatment with practice effects, seasonal trends and regression to the mean.
- Comparing change scores between groups. Compute post minus pre for everyone and compare the groups with a two-sample t test. This answers the right question in a trial and is unbiased under randomization, but it subtracts the whole baseline even though post scores only partly track it.
- ANCOVA. Regress the post score on group and the baseline score:
lm(post ~ group + pre). The group coefficient is the difference between groups among people with the same baseline. It uses the baseline exactly as much as the data say it predicts the outcome. - A linear mixed model with both time points as outcomes, a group × time interaction and a random intercept per person. With no missing data, its interaction estimate equals the change-score comparison; a version that constrains the two arms to share one baseline mean behaves like ANCOVA. Its real advantage is with missing follow-ups or several follow-up visits.
Why ANCOVA is preferred in randomized trials
Call the correlation between baseline and follow-up ρ, and assume the two have the same spread. Relative to comparing post scores alone, the variance of the treatment estimate is about 2(1 − ρ) for change scores and 1 − ρ² for ANCOVA. Change scores only beat a post-only comparison when ρ is above 0.5, while ANCOVA is never worse than either, apart from the one degree of freedom it spends estimating the slope. With ρ = 0.6, the three relative variances are 1, 0.8 and 0.64.
ANCOVA also corrects for chance baseline imbalance in the right amount. If the treated group happens to start low, a post-only comparison is biased against it in that particular trial and a change-score comparison overcorrects when ρ is below 1. ANCOVA subtracts the imbalance multiplied by the estimated slope of post on pre. That is why the baseline should go into the model as planned, whether or not a test of baseline differences is significant; such tests are pointless after randomization anyway.
See it in R and Python
The code simulates a trial with 100 people per arm, a baseline-to-follow-up correlation of 0.6, a general improvement of 3 points over time, and a true treatment effect of 5 points. It runs a paired t test in the treated arm, then the three between-group analyses, then repeats the trial 2,000 times. Finally it takes 5,000 untreated people, picks those with the top 20% of baseline scores, and looks at their change.
R
set.seed(1205)
# One randomized trial: baseline-post correlation 0.6, everyone improves by 3
# over time, and the treatment adds 5 points on top of that
sim_trial <- function(n = 100) {
group <- rep(0:1, each = n)
pre <- rnorm(2 * n, 50, 10)
post <- 53 + 0.6 * (pre - 50) + 5 * group + rnorm(2 * n, 0, 8)
data.frame(group, pre, post, change = post - pre)
}
d <- sim_trial()
round(tapply(d$pre, d$group, mean), 2) # baseline means, control vs treated
# Paired t test inside the treated group: mixes the treatment with the time trend
tt <- t.test(d$post[d$group == 1], d$pre[d$group == 1], paired = TRUE)
round(c(mean_change = unname(tt$estimate), t = unname(tt$statistic)), 2)
# Three estimates of the treatment effect (true value 5)
est <- function(f, data) coef(summary(lm(f, data)))["group", 1:2]
round(rbind(post_only = est(post ~ group, d),
change = est(change ~ group, d),
ancova = est(post ~ group + pre, d)), 2)
anc <- lm(post ~ group + pre, d) # ANCOVA, df = 197
round(c(confint(anc)["group", ], t = coef(summary(anc))["group", "t value"]), 2)
signif(coef(summary(anc))["group", "Pr(>|t|)"], 2) # p value
# Over 2,000 trials: all three are unbiased, ANCOVA is the most precise
sims <- replicate(2000, {
s <- sim_trial()
c(post_only = coef(lm(post ~ group, s))[2], change = coef(lm(change ~ group, s))[2],
ancova = coef(lm(post ~ group + pre, s))[2])
})
rownames(sims) <- c("post_only", "change", "ancova")
round(rbind(mean = rowMeans(sims), sd = apply(sims, 1, sd)), 2)
# Regression to the mean: untreated people picked for high baseline scores
ctrl <- sim_trial(5000)
ctrl <- ctrl[ctrl$group == 0, ]
high <- ctrl$pre > quantile(ctrl$pre, 0.8)
round(c(all = mean(ctrl$change), top_20_percent = mean(ctrl$change[high])), 2)
Python
import numpy as np
import pandas as pd
from scipy import stats
rng = np.random.default_rng(1205)
# One randomized trial: baseline-post correlation 0.6, everyone improves by 3
# over time, and the treatment adds 5 points on top of that
def sim_trial(n=100):
group = np.repeat([0, 1], n)
pre = rng.normal(50, 10, 2 * n)
post = 53 + 0.6 * (pre - 50) + 5 * group + rng.normal(0, 8, 2 * n)
return pd.DataFrame({"group": group, "pre": pre, "post": post, "change": post - pre})
def est(y, *cols):
# OLS coefficient and standard error of the first predictor (group)
X = np.column_stack([np.ones(len(y)), *cols])
beta, *_ = np.linalg.lstsq(X, y, rcond=None)
resid = y - X @ beta
V = resid @ resid / (len(y) - X.shape[1]) * np.linalg.inv(X.T @ X)
return beta[1], np.sqrt(V[1, 1])
d = sim_trial()
print(d.groupby("group")["pre"].mean().round(2)) # baseline means, control vs treated
# Paired t test inside the treated group: mixes the treatment with the time trend
t1 = d[d.group == 1]
tt = stats.ttest_rel(t1.post, t1.pre)
print("mean change", round((t1.post - t1.pre).mean(), 2), "t", round(tt.statistic, 2))
# Three estimates of the treatment effect (true value 5)
g, pre = d.group.to_numpy(), d.pre.to_numpy()
print(pd.DataFrame([est(d.post.to_numpy(), g), est(d.change.to_numpy(), g),
est(d.post.to_numpy(), g, pre)],
index=["post_only", "change", "ancova"], columns=["Estimate", "SE"]).round(2))
b, se = est(d.post.to_numpy(), g, pre) # ANCOVA test, df = 197
t = b / se
print("CI", np.round(b + np.array([-1, 1]) * stats.t.ppf(0.975, 197) * se, 2),
"t", round(t, 2), "p", float(f"{2 * stats.t.sf(abs(t), 197):.2g}"))
# Over 2,000 trials: all three are unbiased, ANCOVA is the most precise
sims = []
for _ in range(2000):
s = sim_trial()
g, pre, post = s.group.to_numpy(), s.pre.to_numpy(), s.post.to_numpy()
sims.append([est(post, g)[0], est(post - pre, g)[0], est(post, g, pre)[0]])
sims = pd.DataFrame(sims, columns=["post_only", "change", "ancova"])
print(pd.DataFrame({"mean": sims.mean(), "sd": sims.std(ddof=1)}).T.round(2))
# Regression to the mean: untreated people picked for high baseline scores
ctrl = sim_trial(5000)
ctrl = ctrl[ctrl.group == 0]
high = ctrl.pre > ctrl.pre.quantile(0.8)
print("all", round(ctrl.change.mean(), 2), "top 20 percent", round(ctrl.change[high].mean(), 2))
All figures below come from one seeded run of the R code. Python's random numbers differ from R's, so its figures differ slightly (for example, an ANCOVA estimate of 4.20 and a change of −2.89 in the high-baseline group), but they show the same pattern.
What the simulation shows
- The paired t test answers a different question. The treated arm improved by 8.46 points, t(99) = 9.10. That is the 5-point treatment effect plus the 3-point time trend, and the test alone cannot tell them apart.
- One trial, three answers. By chance the treated arm started lower (baseline means 46.54 vs 48.65). The post-only comparison gave 4.09 (SE 1.40), the change-score comparison 6.20 (SE 1.33), and ANCOVA 5.24 (SE 1.15), between the other two and with the smallest standard error.
- All three are unbiased; ANCOVA is the most precise. Across 2,000 trials the average estimates were 5.04, 5.05 and 5.05. Their standard deviations were 1.42 for post-only, 1.25 for change scores and 1.13 for ANCOVA, in line with the 1 : 0.8 : 0.64 variance ratios above.
- Regression to the mean. Untreated people improved by 2.95 points on average, but those selected for the highest 20% of baseline scores got 3.05 points worse. Nothing happened to them; part of their high first score was luck that did not repeat.
- Why that matters. Recruiting people because they score high (or low) at baseline guarantees some movement back toward the average, so a control group recruited the same way is essential. See regression to the mean vs the gambler's fallacy for more on the idea.
When the answer is less clear-cut
- Groups that were not randomized. If groups differ systematically at baseline, change scores and ANCOVA can disagree, sometimes in sign (Lord's paradox). They rest on different assumptions about what would have happened without treatment, so the choice is a causal judgment, not a statistical one.
- Missing follow-ups or several time points. A mixed model uses everyone's available data, under the assumption that missingness depends only on observed values, and handles repeated follow-ups naturally.
- Percentage change. Dividing the change by the baseline creates a ratio with awkward statistical properties and makes results depend on baseline levels. ANCOVA on the raw post score (or on a log scale, if effects are proportional) is usually better.
- Interest in change itself. If the change in each person is the outcome you want to describe, report mean change with a confidence interval, but still compare groups with ANCOVA.
Our page on what controlling for a variable means explains why adjusting for baseline is not automatically correct outside randomized designs.
Unsure which design-based test applies? Our test chooser walks through the options.
How to report an ANCOVA on pre-post data in APA style (7th edition)
Give the adjusted group difference with its confidence interval and test, and say that baseline was the covariate. Using the single trial above (200 people, so 197 residual degrees of freedom):
"Adjusting for baseline scores, the treatment group scored 5.24 points higher at follow-up than the control group, 95% CI [2.97, 7.51], t(197) = 4.55, p < .001." If you present it as an ANCOVA F test, F(1, 197) equals the square of that t.
In the method section, state that the baseline score was prespecified as a covariate, and report unadjusted means and SDs at both time points in a table. For a single-group design, describe the change honestly: "Scores increased from baseline to follow-up, M = x.xx, 95% CI [LL, UL], t(df) = x.xx, p = .xxx; without a control group, this change cannot be attributed to the intervention."
Related tools and guides
- APA 7 formatter for regression
- t-test power and sample size calculator
- APA 7 formatter for t tests
- Which statistical test should I use?
- What does it mean to control for a variable?
- Regression to the mean vs the gambler's fallacy
- Paired vs independent t test
- Regression toward the mean (Wikipedia)
More answered questions
- t tests vs the F test in regression: what is the difference?
- What are the assumptions of a t test, and which ones actually matter?
- Do robust standard errors fix floor and ceiling effects?
Working with your own data?
General answers only go so far. Send us your situation and we'll reply by email within two business days.
Ask your questionWritten by AskStats with AI assistance. This is general information, not advice for your specific data or study. When the results matter, check your approach with a qualified statistician.