All examples · Example 13 of 34
Paired Dot Plot: Pre/Post Treatment
Systolic blood pressure for each of 20 patients before and after treatment; lines join measurements from the same patient.

Key findings
- Blood pressure fell by 9.17 mmHg on average (95% CI [4.924, 13.42]), paired t p = 0.0002, Cohen's dz = 1.01.
- The Wilcoxon signed-rank test agrees (p = 0.0008).
- Ignoring the pairing would have given p = 0.059 — because before and after are correlated (r = 0.814), the paired design is far more powerful.
Descriptive statistics
Location, spread and shape for every group — the first thing to read before choosing a test. Skewness near 0 and excess kurtosis near 0 are what a normal distribution looks like.
| Group | n | Mean | SD | SEM | Median | Q1 – Q3 | Min – Max | Skewness | Excess kurtosis |
|---|---|---|---|---|---|---|---|---|---|
| Before treatment | 20 | 149.7 | 14.73 | 3.295 | 152.8 | 142.3 – 158.3 | 123.4 – 175.3 | -0.205 | -0.303 |
| After treatment | 20 | 140.5 | 15 | 3.354 | 143.3 | 131.7 – 152.6 | 106.6 – 164.6 | -0.568 | 0.0466 |
LabTools call
stats.describelabtools stats describe --groups @groups.json
The same method is available as an MCP tool (stats_describe) and from the desktop app's statistics panel.
Normality of the paired differences
The paired t-test assumes the DIFFERENCES are normal, not the raw measurements — so that is what is tested (differences computed as before − after).
| Group | n | Shapiro–Wilk W | p | Anderson–Darling A² | p | K–S D | p | Verdict |
|---|---|---|---|---|---|---|---|---|
| Before − after difference | 20 | 0.9704 | 0.76 | 0.2115 | 0.83 | 0.09829 | 0.88 | Consistent with normal |
LabTools calls (3)
stats.normalitylabtools stats normality --groups @groups.json --method shapiro-wilk
stats.normalitylabtools stats normality --groups @groups.json --method anderson-darling
stats.normalitylabtools stats normality --groups @groups.json --method kolmogorov-smirnov
The same method is available as an MCP tool (stats_normality) and from the desktop app's statistics panel.
Outlier screen
Five detectors with different assumptions. Grubbs tests the single most extreme point, generalised ESD looks for up to several (immune to masking), Dixon's Q is the small-sample chemistry test, modified-z uses the median and MAD so needs no normality, and the IQR rule is Tukey's boxplot fence. LabTools flags points; it never deletes them.
| Method | Before − after difference |
|---|---|
| Grubbs | none |
| Generalised ESD | none |
| Dixon's Q | none |
| Modified z (MAD) | none |
| IQR fences (1.5×) | none |
LabTools calls (5)
stats.outlierslabtools stats outliers --groups @groups.json --method grubbs
stats.outlierslabtools stats outliers --groups @groups.json --method generalized-esd --max-outliers 5
stats.outlierslabtools stats outliers --groups @groups.json --method dixon-q
stats.outlierslabtools stats outliers --groups @groups.json --method modified-z
stats.outlierslabtools stats outliers --groups @groups.json --method iqr
The same method is available as an MCP tool (stats_outliers) and from the desktop app's statistics panel.
LabTools notes
- The IQR rule is descriptive — it has no p-value and flags roughly 0.7% of a perfectly normal sample by construction.
Paired comparison: Before vs After
Each unit is measured twice, so the analysis is on the within-unit differences. The paired t-test and the Wilcoxon signed-rank test answer the same question with and without a normality assumption; the unpaired Welch test is shown only to illustrate how much power ignoring the pairing throws away.
| Test | Statistic | df | p | Difference (Before − After) | 95% CI | Effect size |
|---|---|---|---|---|---|---|
| Paired t-test | t = 4.52 | 19 | 0.0002 | 9.17 | [4.924, 13.42] | dz = 1.01 (large) |
| Wilcoxon signed-rank | W = 15 | — | 0.0008 | median 9.1 | — | r = 0.857 (rank-biserial) |
| Welch t-test (ignores pairing) | t = 1.95 | 37.99 | 0.059 | 9.17 | [-0.3485, 18.69] | g = 0.604 |
LabTools calls (3)
stats.ttestlabtools stats ttest --a @Before.json --b @After.json --test paired
stats.wilcoxonlabtools stats wilcoxon --a @Before.json --b @After.json
stats.ttestlabtools stats ttest --a @Before.json --b @After.json --test welch
The same method is available as an MCP tool (stats_ttest) and from the desktop app's statistics panel.
Correlation between the two measurements
Why pairing helps: patients who start high tend to stay high. The stronger this correlation, the more a paired test gains over an unpaired one.
| Coefficient | Estimate | r² | n | p |
|---|---|---|---|---|
| Pearson r (linear) | 0.814 | 0.6625 | 20 | 1.3 × 10⁻⁵ |
| Spearman ρ (monotonic, rank) | 0.8752 | — | 20 | 4.4 × 10⁻⁷ |
| Kendall τ (rank, tie-robust; normal-approximation p) | 0.7053 | — | 20 | 1.4 × 10⁻⁵ |
LabTools calls (3)
stats.correlationlabtools stats correlation --a @Before.json --b @After.json --method pearson
stats.correlationlabtools stats correlation --a @Before.json --b @After.json --method spearman
stats.correlationlabtools stats correlation --a @Before.json --b @After.json --method kendall
The same method is available as an MCP tool (stats_correlation) and from the desktop app's statistics panel.
LabTools notes
- Pearson's r measures LINEAR association only, and is sensitive to outliers. A scatter plot (plot.create kind='scatter') is worth a look before reporting it; use method='spearman' if the relationship is monotonic but curved.
Methods paragraph
Written to go straight into a manuscript.
Blood pressure fell by a mean of 9.2 mmHg (95% CI 4.9–13.4; paired t(19) = 4.52, p = 0.0002, Cohen’s dz = 1.01). A Wilcoxon signed-rank test agreed (W = 15, p = 0.0008).
Every number on this page was computed by the LabTools statistics engine (version 0.14.3) from the example's CSV on 2026-09-23. Where a value was derived before the data reached LabTools (replicate means, paired differences, log odds ratios), the text says so. The data are simulated from a fixed random seed.
Get started
Run the same analysis on your data
Every test on this page is built into LabTools — from the statistics panel, the command line, or an AI assistant through MCP.