All examples · Example 9 of 34
Q–Q Plot: Model Residuals
Normal Q–Q plot of 200 model residuals; points departing from the reference line at both ends indicate heavier tails than a normal distribution.

Key findings
- Excess kurtosis = 2.79: the residuals have heavy tails, even though skewness is only 0.0876.
- Shapiro–Wilk p = 2.3 × 10⁻⁵, Anderson–Darling p = 0.001, Lilliefors-corrected K–S p = 0.017: all three reject normality.
- The residuals are unbiased (mean -0.04087, one-sample t p = 0.69) — the problem is their shape, not their centre.
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 |
|---|---|---|---|---|---|---|---|---|---|
| Residuals | 200 | -0.04087 | 1.471 | 0.104 | 0.0275 | -0.8548 – 0.7615 | -5.627 – 5.465 | 0.0876 | 2.79 |
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
The whole point of a Q–Q plot, made numeric. The residuals look almost normal by eye; the tests disagree with the eye because the tails are heavy (excess kurtosis well above 0).
| Group | n | Shapiro–Wilk W | p | Anderson–Darling A² | p | K–S D | p | Verdict |
|---|---|---|---|---|---|---|---|---|
| Residuals | 200 | 0.9607 | 2.3 × 10⁻⁵ | 1.378 | 0.001 | 0.07064 | 0.017 | Normality rejected |
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.
LabTools notes
- Group 'Residuals' rejects normality (p = 0.0000); prefer a rank-based test.
- Group 'Residuals' rejects normality (p = 0.0014); prefer a rank-based test.
- Group 'Residuals' rejects normality (p = 0.0167); prefer a rank-based test.
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 | Residuals |
|---|---|
| Grubbs | 1 (-5.627) |
| Generalised ESD | 4 (-5.627, 5.465, -5.328, 5.24) |
| Modified z (MAD) | 4 (-5.328, 5.465, -5.627, 5.24) |
| IQR fences (1.5×) | 7 (-5.328, -3.673, 5.465, 4.136 …) |
LabTools calls (4)
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 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
- Flagged points are candidates, not verdicts, and nothing has been removed. Look for a physical cause before excluding anything; if there is none, keep the point and use a robust test instead. Any exclusion must be reported.
- Grubbs tests only the single most extreme point, so a second outlier can mask the first. On larger samples use method='generalized_esd'.
- The IQR rule is descriptive — it has no p-value and flags roughly 0.7% of a perfectly normal sample by construction.
Are the residuals centred on zero?
A one-sample t-test against μ = 0 and a 95% interval for the mean residual. A model with no systematic bias should pass.
| Test | Statistic | df | p | Mean residual | 95% CI |
|---|---|---|---|---|---|
| One-sample t (μ = 0) | t = -0.3929 | 199 | 0.69 | -0.04087 | [-0.2459, 0.1642] |
LabTools calls (2)
stats.ttestlabtools stats ttest --data @residuals.json --test one-sample --mu 0
stats.cilabtools stats ci --data @residuals.json
The same method is available as an MCP tool (stats_ttest) and from the desktop app's statistics panel.
Methods paragraph
Written to go straight into a manuscript.
Residual normality was assessed with a Q–Q plot and Shapiro–Wilk (W = 0.961, p < 0.0001), Anderson–Darling (A² = 1.38, p = 0.0014) and Lilliefors KS (D = 0.071, p = 0.017) tests; excess kurtosis 2.79 indicates heavy tails.
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.