Concept Architecture
Goodness of Fit Test: Concept Architecture
Orientation and learning roadmap
The page begins with a statistical model and the feature of observed data it is expected to reproduce. It then builds a count-based test, works through its statistic and probability, and compares it with distributional and predictive checks. The final sections explain why passing a test cannot by itself validate a health-economic decision model.
State what is being tested
A goodness of fit test compares observed data with a stated probability model under a null hypothesis. The test statistic measures a particular kind of discrepancy, and its reference distribution describes how surprising a discrepancy at least that large would be if the null model and testing assumptions held. The question must specify the observations, model, fitted parameters if any, and chosen discrepancy before a value has a useful interpretation.
| Design question | Example |
|---|---|
| What data are compared? | Numbers of patients in four mutually exclusive outcome categories. |
| What is the null model? | Four prespecified probabilities of 0.25 each. |
| Which discrepancy matters? | Squared differences between observed and expected counts, scaled by expected counts. |
| How is the reference distribution obtained? | An approximate chi-square distribution under relevant sampling assumptions. |
Other tests emphasise different discrepancies, such as the maximum gap between an empirical and a specified continuous cumulative distribution. A goodness of fit result is always relative to its chosen test and its power to detect departures. It is not a universal certificate that the model is true.
Calculate a Pearson chi-square test
For mutually exclusive categories, let be an observed count and the count expected from the null category probability . The Pearson statistic adds each squared count discrepancy divided by its positive expected count. Under a fully prespecified multinomial null with suitable sample size and non-sparse expected categories, the usual approximate reference has degrees of freedom.
Independence of the sampled units and a correct category definition are material assumptions. When model parameters are estimated from the same counts, the reference degrees of freedom may be reduced and the exact adjustment depends on the fitting and test construction. Sparse expected counts can make the chi-square approximation unreliable, prompting a defensible regrouping or an appropriate simulation or exact approach.
Check a four-category health example
Suppose 100 independent patients are classified into four exhaustive categories, and the prespecified null model assigns probability 0.25 to each. The observed counts below are illustrative rather than results from a study. Each expected count is 25, comfortably above the sparse-cell concern in this example.
| Category | Observed | Expected | Contribution |
|---|---|---|---|
| A | 30 | 25 | 1 |
| B | 20 | 25 | 1 |
| C | 25 | 25 | 0 |
| D | 25 | 25 | 0 |
The statistic is , with degrees of freedom because no probabilities were estimated from these counts. The upper-tail probability is approximately 0.57; at a conventional 0.05 level, this sample does not reject the specified distribution. It does not show that every category probability truly equals 0.25, nor that a difference of practical importance has been excluded.
Choose the test for the data and model
A chi-square goodness of fit test uses binned counts and is different from a chi-square test of independence across two categorical variables. For a fully specified continuous distribution, a Kolmogorov–Smirnov statistic compares empirical and proposed cumulative distributions; its standard one-sample critical values do not remain valid unchanged when distribution parameters are estimated from the same data. The null distribution and any parameter-fitting correction must match the actual procedure.
| Setting | Example test or check | Important qualification |
|---|---|---|
| Prespecified categorical probabilities | Pearson chi-square goodness of fit. | Expected counts and sampling assumptions govern the approximation. |
| Fully specified continuous distribution | One-sample Kolmogorov–Smirnov test. | Standard critical values assume distribution parameters are specified in advance. |
| Fitted survival distribution | Residual and graphical checks, with a justified formal test if needed. | Fit during observed follow-up does not establish credible long-term extrapolation. |
| Clinical prediction model | Calibration plots and independent validation alongside any test. | A single overall test can miss clinically important miscalibration. |
The statistical test must be selected before using its output to defend an economic model. Comparing in-sample fit statistics among candidate models, assessing calibration of predicted risks, and checking external validity answer related but distinct questions. Clinical plausibility and the decision's time horizon can matter even when several models fit the observed data similarly.
Interpret rejection and non-rejection carefully
A small value signals data less compatible with the specified null model in the direction the statistic detects, subject to sampling and test assumptions. A large value may arise because the model is reasonably compatible with the data, the sample is too small, or the chosen statistic is insensitive to the departure that matters. The value is neither the probability that the model is true nor a measure of economic or clinical importance.
In a health-economic evaluation, an incorrect survival tail, baseline event risk, or subgroup pattern can change expected QALYs and costs despite acceptable fit to observed aggregates. Examine effect sizes, residual patterns, predicted versus observed quantities, competing specifications, and sensitivity of decisions to plausible alternatives. The decision model itself also requires structural, internal, external, and predictive validation where applicable.
Report enough to reproduce the check
Readers need to see the null distribution, data source, category boundaries or continuous statistic, parameter-estimation procedure, sample size, reference distribution, and calculated result. Report prespecified and exploratory checks separately, especially when several models or binning choices were tried. If a formal test is inappropriate for sparse or dependent data, explain the alternative rather than forcing a familiar value.
- Verify that categories are mutually exclusive and exhaustive and that observed and expected totals match.
- Inspect every expected count and document any justified pooling of categories.
- State whether parameters were prespecified or estimated from the tested sample.
- Provide the statistic, degrees of freedom or resampling design, and upper-tail probability where relevant.
- Examine clinically and economically consequential deviations beyond the single summary test.
Sources and technical basis
NIST documents the Pearson count-based statistic and the limitations of the standard Kolmogorov–Smirnov reference when parameters are estimated. ISPOR-SMDM good research practices distinguish broader decision-model transparency and validation from a single statistical fit check. The four-category numbers and calculation are original teaching values.
Related Concepts (3)
Library
Publications
1
Model Transparency and Validation: A Report of the ISPOR-SMDM Modeling Good Research Practices Task Force-7 — Eddy, Hollingworth, Caro, Tsevat, McDonald & Wong, Task Force Report 7 ed., 2012 (Value in Health / Medical Decision Making)
Best-practice guidance on model transparency and validation, defining face, internal, external and predictive validation and setting out how models should be documented for scrutiny.
Journal ArticleView source →
Frequently Asked Questions (6)
What is a goodness-of-fit test?
A formal statistical test determining whether observed data are consistent with a specified distribution or model, providing a basis for accepting or rejecting it.
Source: Pearson 1900
What does a goodness-of-fit test compare?
A goodness-of-fit test compares the pattern actually observed in data against the pattern a specified distribution or model would predict, and judges whether the difference is larger than chance would explain. If the observed and expected patterns are close, the data are consistent with the model, but if they diverge markedly, the model is rejected as an inadequate description. The test turns a visual impression of fit into a formal probability. It provides a basis for accepting or rejecting a proposed distribution. Cox and Hinkley (1974) set out such tests.
Source: Cox & Hinkley 1974
How does a goodness-of-fit test work?
A goodness-of-fit test works by computing a statistic that measures the discrepancy between the observed data and the values expected under the specified distribution or model, such as the chi-squared statistic, and comparing it with the distribution expected if the model were correct. If the discrepancy is large enough to be unlikely by chance, the model or distribution is rejected as inconsistent with the data. The test thus turns the comparison of observed and expected values into a formal decision about fit.
Source: Pearson 1900
What is the chi-squared goodness-of-fit test?
The chi-squared goodness-of-fit test, introduced by Pearson, assesses whether observed frequencies in categories match those expected under a specified distribution. It computes a statistic summing the squared differences between observed and expected counts, each divided by the expected count, and compares it with the chi-squared distribution. A large value indicates the observed data depart from the expected pattern more than chance would allow, leading to rejection of the specified distribution. It is a standard test for categorical data and distributional fit.
Source: Pearson 1900
How is a goodness-of-fit test interpreted?
A goodness-of-fit test is interpreted through its result, typically a p-value indicating how likely the observed discrepancy would be if the model were correct. A small p-value suggests the data are inconsistent with the model, leading to its rejection, while a large one indicates no evidence against the model. Failing to reject does not prove the model correct, only that the data do not contradict it. As with hypothesis tests generally, the interpretation depends on the significance level and the test's assumptions.
Source: Neyman & Pearson 1933
What are the limitations of goodness-of-fit tests?
Goodness-of-fit tests have limitations: with large samples they may reject a model for trivial, unimportant discrepancies, while with small samples they may lack power to detect real misfit, so statistical significance does not equate to practical adequacy. Failing to reject a model does not confirm it, and tests rest on assumptions that may not hold. They assess consistency with the data used, not generalisation. These limitations mean goodness-of-fit tests are interpreted with judgement, alongside other measures of fit and the model's purpose.
Source: Pearson 1900
Trust Record
Verified by Dr Darrin Baines
British health economist
Professional identity: darrinbaines.org
Verification date: 25 Sep 2026
Content version: 1.0.0
Canonical Identity
- Term code
- HE-EM-MV-031
Stable URI · Machine-readable · Resolvable · CC BY 4.0
