← All examples

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.

Open a copy and recalculate A separate copy of the example opens in a new tab. Changes there won’t affect your current project.

Theory: Comparing two groups →

8 participants · 8 matched pairs

Points show observations. Mean intervals: 95%.
Mean change: after minus before
2.625
95% confidence interval
1.738 … 3.512
Two-sided p
0.0002116
Inspect the original observations
ObservationBefore trainingAfter training
1810
21114
3910
41317
51012
61215
779
81418

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 recalculate

Try 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.

Next exampleHow are sensor readings related to a reference input? →