02 / 06 · Paired t-test
Teaching example. Synthetic data.
How did scores change after training?
Eight participants completed a task before and after a training session. Estimate the mean within-person change.
8 participants · 8 matched pairs
- Mean change: after minus before
- 2.625
- 95% confidence interval
- 1.738 … 3.512
- Two-sided p
- 0.0002116
Inspect the original observations
| Observation | Before training | After training |
|---|---|---|
| 1 | 8 | 10 |
| 2 | 11 | 14 |
| 3 | 9 | 10 |
| 4 | 13 | 17 |
| 5 | 10 | 12 |
| 6 | 12 | 15 |
| 7 | 7 | 9 |
| 8 | 14 | 18 |
Calculated by the Linza engine from this example’s data. Opening it in the editor runs a fresh calculation.
Why this method
The paired t-test analyses change within each participant. Each row links two measurements of one person. An independent test would lose this matching. For t-based inference, assess the distribution of differences rather than equality of the two column variances.
Explore the theory: Comparing two groups →Work through it in Linza
In Data, compare the values within each row. Subtract before from after for every participant. In Analyses, compare the mean of these eight differences with the reported change. Separate intervals for the before and after means do not replace the interval for paired change.
Open a copy and recalculateTry changing one condition
Reorder only the After values, keeping all numbers. Will the mean change stay the same? What about its confidence interval?
Show the explanation
The mean change stays the same because the column means have not changed. The spread of individual differences and its interval may change. Reordering breaks the real pairs and is inappropriate for research data.
Data and reproducibility
Teaching studies with synthetic data. The scenarios reflect practical questions, but do not report real experimental findings.