deMoivreРусскийFrançais
Open data · reproducible example

Why paired measurements matter

Ten participants were measured under two conditions. We compare the results with and without accounting for the pairing of measurements from the same person.

Each line joins the two observations for one participant

Each line connects measurements for one participant. Values represent extra sleep in hours relative to baseline.

Start with the observations

The dataset contains two observations per participant. A paired analysis uses the within-person differences to assess the difference between conditions.

This is a statistical demonstration using R's teaching dataset. It is not a clinical assessment of treatment effectiveness.

All ten pairs

ParticipantCondition 1, hCondition 2, hDifference, h
10.71.91.2
2−1.60.82.4
3−0.21.11.3
4−1.20.11.3
5−0.1−0.10.0
63.44.41.0
73.75.51.8
80.81.60.8
90.04.64.6
102.03.41.4

Estimates and uncertainty

Both analyses give a mean difference of 1.58 hours. Their confidence intervals differ because they account for variability differently.

Paired and unpaired 95 percent confidence intervals for the same estimated difference
−0.21 to 3.37 hIgnoring pairs · p = 0.0794
0.70 to 2.46 hPaired analysis · p = 0.0028

The paired calculation reflects the study design. Interpretations also depend on the data and the assumptions of the chosen test.

Reproduce the calculation

Download the data and R script into the same directory and run Rscript check.R. The script checks the data against R's built-in dataset and prints both estimates and intervals.

Discuss your data

Tell us about your research question and the materials you have.

lab@demoivre.ru · Telegram