Home / Lean Six Sigma / Statistical analysis

Chi-square: association, goodness of fit and cross tables

Find out whether the defect depends on the machine, the shift or the supplier, where the difference lies and whether it is large enough to matter, and test whether counts follow history or chance (Poisson).

Pre-sizing and estimating tool: results do not replace design, calculations or reports signed by a licensed professional, nor verification against the applicable codes and standards.

CheckRevised 11/03/2026
Test
See what was read

Association: first row = column names, first column = row names. Proportions: category · observed · proportion (or historical count). Poisson: count value · number of units, or one column with the count of each unit.

Options

Your inputs stay only on this browser and are not sent anywhere. Untick to delete them.

—Chi-square test
—

Count table

Chi-square test

Other measures

Observed × expected counts

Bars = observed; black dash = what would be expected with no association (or with the tested proportions).

Tap the chart to see the values.

Contribution to chi-square

Largest to smallest. Red = more occurrences than expected; blue = fewer.

Tap the chart to see the values.

Mosaic: make-up of each row

Width = row total; height = % of each column. Thick outline: adjusted residual beyond ±2 (▲ above, ▼ below expected).

Tap the chart to see the values.

Adjusted residual map

Each cell shows how many standard errors the count is above (red) or below (blue) expected; beyond ±2 is significant.

Tap the chart to see the values.

Observed proportion with 95% CI × test proportion

Dot and bar = observed proportion and its exact interval (Clopper-Pearson); dash = test proportion. A bar that misses the dash points to a category off expectation.

Tap the chart to see the values.

Reference distribution: where the chi-square fell

Chi-square curve with no association (H0). The shaded area right of the observed value is the P-value.

Tap the chart to see the values.

Next step

Take this page’s results to another calculator with the fields already filled in.

The calculation report gathers this page's inputs, results, equations, assumptions and references, with fields for project, engineer and revision. The full report also includes the charts and interpretations, in color. In the print dialog, choose Save as PDF.

Method, assumptions and references

Equations used

Expected: Eᵢⱼ = (row i total × column j total)/N; χ² = Σ(Oᵢⱼ − Eᵢⱼ)²/Eᵢⱼ; DF = (r − 1)(c − 1)
Likelihood ratio: G² = 2·ΣOᵢⱼ·ln(Oᵢⱼ/Eᵢⱼ); standardized residual (O − E)/√E; adjusted residual (O − E)/√[E(1 − Rᵢ/N)(1 − Cⱼ/N)]
Cramér’s V = √[χ²/(N·(min(r, c) − 1))]; Fisher 2×2: sum of hypergeometric probabilities P(a) ≤ P(observed), with fixed margins
Goodness of fit: Eᵢ = N·pᵢ, DF = k − 1; Poisson: λ = Σi·Oᵢ/N, pᵢ = e^−λ·λⁱ/i!, last category 1 − Σpᵢ, DF = k − 2 (k − 1 with known λ)

Assumptions and limits

  • Each item is counted once and items are independent (random sample or ungrouped production). P-value approximated by the chi-square distribution: reliable with expected counts ≥ 5; not computed with an expected count < 1.
  • Poisson: categories formed from the data, grouping those with expected count below 2 (the first accumulates the low values and the last all the high ones).
  • Odds ratio with Woolf CI (adding 0.5 to the cells when there is a zero) and power for w = 0.3 from the noncentral chi-square are interpretive extras.

Standards and technical documents

  • Agresti, A. Categorical Data Analysis, 3rd ed. Wiley, 2013
  • Montgomery, D. C.; Runger, G. C. Applied Statistics and Probability for Engineers, 7th ed. Wiley, 2018, cap. 9
  • Cohen, J. Statistical Power Analysis for the Behavioral Sciences, 2nd ed. Erlbaum, 1988, cap. 7
  • Fisher, R. A. The Design of Experiments. Oliver & Boyd, 1935
  • NIST/SEMATECH e-Handbook of Statistical Methods, seção 1.3.5.15 (Chi-Square Goodness-of-Fit Test)
  • ISO 3534-1:2006 Statistics — Vocabulary and symbols

U.S. regulations

  • ISO 9001:2015, 9.1.3: analysis and evaluation
  • ISO/TR 10017: guidance on statistical techniques

Frequently asked questions

When should I use the chi-square test for association?

When both variables are categories counted on the same parts: machine and defect type, shift and scrap, supplier and receiving acceptance. The test says whether the distribution of one changes with the other. In the press example, press 2 on the 1st shift had 76 rejected handles against 61 expected: p = 0.019, there is an association.

What do expected count and contribution mean?

The expected count is what the cell would hold with no association: row total × column total ÷ grand total. The contribution, (observed − expected)²/expected, shows how much each cell weighs in the chi-square; the largest tell you where to start investigating.

What are adjusted residuals for?

They show, in standard errors, how far each cell is above or below expectation. Above +2 or below −2 the difference in that cell is significant on its own. It is the most direct way to answer “which machine and which shift?”.

When should I use Fisher’s exact test?

In 2×2 tables with small counts (some expected count below 5), common in receiving inspection with few rejected lots. It computes the exact probability and does not rely on the chi-square approximation. The page shows the two-sided result and both one-sided ones.

What is Cramér’s V?

The size of the association, from 0 to 1, which does not grow with the amount of data. With thousands of parts nearly everything gives p < 0.05; V separates strong associations (above 0.5) from those that change no decision (below 0.1).

How do I test whether defects follow history?

Use “Goodness of fit to proportions”: paste the category, the number observed in the period and the historical proportion (or historical count). The test compares the two distributions and the contribution chart shows which defect type changed.

Why test whether defects follow the Poisson?

c and u charts assume defects occur at random (Poisson). If the variance is much larger than the mean, defects cluster in some parts and the chart raises too many alarms. In the panel example, 28 units with 3 defects against 5 expected reject the Poisson hypothesis (p < 0.001).