Distribution diagnostics · sample size

Shapiro–Wilk P > 0.05 is not proof of normality.

A normality test measures evidence against an exact distributional null. A Q–Q plot shows the direction and size of departures. Use both on the model quantity that actually carries the assumption—not as an automatic test-selection switch.

48 visible values2 sample sizesExact engine results7-minute read

The short answer

Ask whether the model is useful, not whether a test “passes.”

Shapiro–Wilk

Is there evidence against an exact Gaussian model?

W summarizes how closely ordered observations follow expected Gaussian order statistics. Its P value depends on both departure and sample size.

Normal Q–Q plot

Where and how does the distribution depart?

Curvature, tail separation and isolated points reveal features that one thresholded P value cannot describe.

Not a valid workflow: test raw columns, call P > 0.05 “normal,” and let that label choose a t test. Depending on the analysis, the assumption concerns paired differences, model residuals or sampling behavior—not each raw group separately.

One fixed skewed sequence, viewed twice

These values are a transparent simulation, generated once from a lognormal distribution with NumPy default_rng(9), mean=0 and sigma=0.25, then rounded to three decimals. The n = 12 sample is exactly the first 12 values of the n = 48 sequence; the columns are not independent experiments.

Index 1–12 13–24 25–36 37–48
1 0.818 0.988 0.977 1.005
2 1.063 1.879 0.908 1.136
3 0.661 1.229 1.225 1.023
4 1.178 1.072 0.800 0.915
5 1.331 0.848 1.212 1.007
6 0.893 1.416 0.746 1.301
7 1.114 0.881 1.146 0.955
8 1.065 1.481 0.770 0.827
9 0.906 0.905 0.632 0.785
10 0.806 1.048 0.862 0.946
11 0.602 0.683 0.694 0.829
12 1.423 1.796 1.148 1.600
First 12 values All 48 values Expected Gaussian quantile Expected Gaussian quantile
The red lines use each sample's mean and SD. With 48 observations, the high-end curvature is easier to see and the test has more power to detect it.

The same process, two Shapiro–Wilk decisions

First 12 valuesW = 0.9718 · P = 0.9290

Fail to reject the exact Gaussian null. This does not establish that the generating process is Gaussian.

All 48 valuesW = 0.9301 · P = 0.006901

Evidence against the exact Gaussian null. The right-tail departure is visible and now detectable.

The D'Agostino–Pearson omnibus results move in the same direction: P = 0.8539 at n = 12 and P = 0.004633 at n = 48. Agreement between tests here does not make either one a distribution label.

What to do with the result

  1. Name the quantity. For a paired t test, inspect paired differences. For regression or ANOVA, inspect model residuals. Raw outcomes may be irrelevant to the assumption.
  2. Inspect the Q–Q plot. Look for systematic curvature, tail separation and individual influential points.
  3. Judge consequence, not perfection. Consider sample size, balance, estimand, robustness and whether a transformation or different model is scientifically meaningful.
  4. Report rather than certify. A non-significant result means insufficient evidence against the tested null at the chosen threshold; it does not prove normality.

Assumptions and limits

  • This is a fixed simulation chosen to illustrate power, not an estimate of any biological population.
  • The n = 12 column is a subset of the n = 48 column. Do not compare them as independent groups.
  • Formal tests assume independent observations from a stable process; neither a P value nor a Q–Q plot diagnoses dependence, drift or pseudoreplication.
  • Large samples can detect scientifically negligible deviations, while small samples can miss important ones.
  • Switching from a mean-based test to a rank method can change the estimand. A preliminary normality P value should not silently make that decision.

What the executable checks establish

The editable project contains the exact 12-value prefix and full 48-value sequence shown here. Engine regression tests compare both W statistics and P values directly with SciPy's Shapiro–Wilk implementation and verify every Q–Q sample coordinate against the sorted inputs.

These checks establish numerical and data-route consistency. They do not establish that a Gaussian model is appropriate for a new study or that one downstream test is robust enough for its design.

Sources and further reading

  1. NIST/SEMATECH. Normal probability plot—construction, interpretation and residual use.
  2. NIST Dataplot. Wilks–Shapiro normality test—definition of W and its Q–Q interpretation.
  3. SciPy. scipy.stats.shapiro—the reference implementation used for the executable comparison.
  4. Ghasemi A, Zahediasl S. Normality tests for statistical analysis. Int J Endocrinol Metab. 2012;10:486–489.

Keep the values visible beside the diagnostics.

Open both sample sizes, the raw-value graph and the preselected normality analysis without creating an account.