Home / Shared Math Details / Shared Estimators and Tests / Goodness of Fit
Goodness of Fit¶
This page describes how the Goodness of Fit option behaves: which analyses can reach it, what data the test is given, how the three tests differ in the sample sizes they accept and the p-values they can report, and what the result does and does not affect. The math for each test is on its own page, linked below.
Notation¶
| Term | Description |
|---|---|
| \(n\) | number of values in the sample being tested |
| \(p\) | the p-value of the selected test |
| \(A^2\) | Anderson-Darling statistic |
| \(W\) | Shapiro-Wilk statistic |
| \(D\) | Kolmogorov-Smirnov statistic |
One option, three tests¶
One Goodness of Fit setting selects among three tests, and all three test the data against a Normal distribution:
| Choice | What runs |
|---|---|
| Anderson-Darling | the \(A^2\) statistic and its p-value. This is the default. |
| Shapiro-Wilk | the \(W\) statistic and its p-value. |
| Kolmogorov-Smirnov | the \(D\) statistic and its p-value. |
| None | no test runs and the Goodness of Fit section is omitted. |
The setting belongs to the capability options, so it is available wherever a capability analysis is produced, and it can be stored with the saved default settings. There is no separate on and off switch and no significance-level box: None is how the test is turned off, and the test is run once with whichever method is selected.
The math is on the individual pages: Anderson-Darling Test, Shapiro-Wilk Test, and Kolmogorov-Smirnov Test.
Where the option is available¶
The Goodness of Fit setting sits on the Capability tab, and the test only runs when a capability analysis is computed. On a control chart that means a specification limit or a target must be entered: with no LSL, USL or Target the option can still be selected but no capability block is built and no test runs.
| Analysis | Goodness of Fit available? |
|---|---|
| Xbar-R, Xbar-S, I-MR, I-MR-R/S | Yes, when a specification limit or target is entered |
| Levey-Jennings, EWMA, CUSUM | No. These charts never attach a capability block, so the test never runs |
| Attribute and rare-event charts, Z-MR | No |
| Cpk/Histogram | Yes |
The result is advisory¶
The result is advisory. Nothing in Quantum XL reads the p-value and changes a decision: it does not move the control limits, change the capability indices or the out-of-specification estimates, choose a fitted distribution, or decide whether a transformation is applied. A p-value below \(0.05\) is highlighted in the report, which is a display cue and nothing more. Interpreting the result and deciding what to do about it is left to the user.
What data the test sees¶
What the test is given:
- Individual observations, with every measurement column pooled into one sample. On a subgrouped chart the test uses the individual values, not the subgroup means.
- The last split only. When the data are divided into splits or phases, one goodness-of-fit result is produced, for the final split, not one result per split.
- Rows excluded as outliers are still in the sample. The number of values behind the goodness-of-fit test can therefore be larger than the number of values behind the capability indices.
- Blank and non-numeric cells are dropped before the test runs, so gaps in a column are harmless.
- When a transformation is active the test runs twice, once on the original values and once on the transformed values, producing two independent results from the same selected test.
Sample-size limits and reportable p-values¶
| Test | Minimum values | Maximum values | Reported p-value range |
|---|---|---|---|
| Anderson-Darling | 2 | none | floored at \(0.005\), capped at \(1\) |
| Shapiro-Wilk | 3 | 2000 | exact, never floored or capped |
| Kolmogorov-Smirnov | 2 | none | pinned to \(0.01\) through \(0.15\) |
Shapiro-Wilk is the only one of the three with an upper limit, and because the sample is every individual observation with all measurement columns pooled, that limit is easy to pass: 400 subgroups of 5 already exceed 2000 values. Kolmogorov-Smirnov is the only one that requires variation in the data; a sample whose standard deviation is zero returns no result.
How the p-value prints¶
Every reported p-value carries a state that decides how it prints:
- Exact: the value prints as computed, with no prefix.
- At the floor: the value prints with a less-than prefix, for example
< 0.005for Anderson-Darling or< 0.01for Kolmogorov-Smirnov. - At the cap: the value prints with a greater-than prefix, for example
> 0.15for Kolmogorov-Smirnov, or> 1for Anderson-Darling if the computed value exceeds one.
Shapiro-Wilk always reports an exact value, so it never shows a prefix.
When no result appears¶
When the selected test cannot run, the Goodness of Fit section still names the method, and the statistic and p-value rows are simply absent. No message explains why. The reasons a test produces no result are the gates above: too few values, more than 2000 values with Shapiro-Wilk selected, or a sample with no variation. Nothing else in the analysis is affected: the control limits, the capability indices, the out-of-specification estimates and the chart are all produced normally.
Control charts do not fit distributions¶
A control chart models the process as Normal. Distribution fitting is switched off on every control-chart path, and the engine rejects a request that pairs a chart with a non-Normal distribution, or with a fit table containing anything other than Normal, rather than silently overriding the choice. Two consequences follow: on a chart the goodness-of-fit test is always a normality check, and the only remedy Quantum XL offers for non-normal data on a chart is a transformation (Box-Cox or Johnson), never a different fitted distribution. Fitting and comparing distributions is work for the capability tool.
The selected test versus the fit table¶
Two different numbers are called goodness of fit, and they answer different questions:
- The selected test. One result for the analysis, always measured against a Normal distribution, controlled by the Goodness of Fit setting, and reported in the Goodness of Fit section.
- The distribution-fit comparison table, which only the capability tool produces. Every candidate distribution gets its own Anderson-Darling statistic and p-value measured against that distribution. This column is always Anderson-Darling and does not change when Shapiro-Wilk or Kolmogorov-Smirnov is selected. Gamma and 3-Parameter Gamma report a statistic with no p-value.
Used by¶
- Variable control charts with capability attached: Xbar-R, Xbar-S, I-MR, and I-MR-R/S.
- Cpk/Histogram: the same option, plus the distribution-fit comparison table.
See Also¶
- Anderson-Darling Test
- Shapiro-Wilk Test
- Kolmogorov-Smirnov Test
- Box-Cox Transformation
- Shared Math Details
References¶
- D'Agostino, R. B., and Stephens, M. A. (1986). Goodness-of-Fit Techniques. Marcel Dekker.
- Montgomery, D. C. (2013). Introduction to Statistical Quality Control, 7th ed. Wiley.