About this example
R’s datasets::sleep reproduces the data Student used in 1908 from Cushny and Peebles: the extra hours of sleep 10 patients gained with two soporific drugs. Every patient took both, so the two columns are not independent groups. Drawing them as two separate clouds, or as two bars, would hide that pairing.
With Pairing set to “Each row is one subject”, the Patient column identifies each person and a line joins their two values. Nine patients slept longer on Drug 2 and one (patient 5) gained the same under both. The difference table reports Drug 2 − Drug 1 over the 10 complete pairs: mean 1.58 h, SD 1.23 h, median 1.3 h.
These are the same numbers R’s paired t.test example works with; CleanFigure reports the differences but computes no test or p-value. The R code reproduces them by merging the two conditions by patient.
Sources: R datasets::sleep — Cushny & Peebles (1905), Student (1908)
The data
| Patient | Drug 1 | Drug 2 |
|---|---|---|
| 1 | 0.7 | 1.9 |
| 2 | -1.6 | 0.8 |
| 3 | -0.2 | 1.1 |
| 4 | -1.2 | 0.1 |
| 5 | -0.1 | -0.1 |
| 6 | 3.4 | 4.4 |
| 7 | 3.7 | 5.5 |
| 8 | 0.8 | 1.6 |
| 9 | 0 | 4.6 |
| 10 | 2 | 3.4 |
These are individual observations, not supplied group summaries. The editor reports its interpretation and preserves your selected presentation when loading an example. Open the example, replace the data with your own, and export the figure as SVG, PDF, PNG or TIFF.