Attribute Tests
Tests for proportions, rates and counts: 1 and 2 proportions, Fisher's exact, chi-square association, McNemar, equivalence (TOST), 1 and 2 Poisson rates
Overview
Attribute tests work on counts instead of measurements: scrap rates, defect rates, assignments to categories. The module runs seven tests – one proportion against a target, two proportions against each other, the chi-square test of association in a cross table, the McNemar test for paired proportions, the equivalence test for equivalence, and one and two Poisson rates (defects per unit).
Input: Summarized ("37 of 1200") or from worksheet columns. With columns the table is counted; the value that counts as event can be chosen (default: the alphabetically last). Empty cells are skipped and counted.
1 proportion
Tests whether the proportion x/n fits a target p₀. The decision uses the exact binomial test; the confidence interval is the exact Clopper-Pearson interval. The two-sided exact p-value doubles the smaller one-sided value (doubling rule, capped at 1). The normal approximation (z) is shown alongside and is reliable only when n·p₀ and n·(1 − p₀) are at least 5.
Difference to Minitab: For one proportion Minitab uses the adjusted Blaker method by default. This module uses Clopper-Pearson (Minitab's "Exact" option). Intervals are slightly wider and p-values can differ a little.
2 proportions
Compares two proportions, e.g. scrap before and after an improvement. The z-test estimates the proportions separately (as Minitab does); "pooled estimate" uses a common proportion, as many textbooks do. The CI for the difference is always unpooled. Fisher's exact test is shown as a second p-value – for small counts it is the more reliable one.
McNemar (paired proportions)
The McNemar test compares two proportions when the same units are judged twice. The textbook case (Melzer 2019, §3.5.1): the same 500 parts are inspected before and after a cleaning. A test for two independent proportions would be wrong because it pretends the two inspections come from different parts. The table counts the pairs: both good, both bad and the two kinds of change (event → no event and vice versa). Only the changes carry information; H₀: both directions are equally frequent.
Input: Summarized as a 2×2 table of pairs (the labels for "before" and "after" are free) or from two columns of equal length. Rows in which one of the two cells is empty are skipped and counted. Both columns together may contain exactly two distinct values.
Result: The exact test is decisive (binomial with p = 0.5; the two-sided value doubles the smaller one, capped at 1). Alongside are χ² with and without continuity correction and the confidence interval of the difference in proportions (after − before). The continuity-corrected χ² uses max(0, |b − c| − 1)², so for b = c it differs from R and statsmodels. Without any change nothing can be tested; with few changes (below 10) only the exact test is reliable.
Equivalence test
A non-significant comparison does not mean the proportions are equivalent – it only means no difference was shown. The equivalence test (TOST) turns the question around: it sets bounds and tests whether the difference lies safely inside. The result reads "equivalent" only if both one-sided tests pass.
Re-inspection example: Melzer 2019, §13.4: 184 of 3902 parts against 179 of 4023. The ordinary test finds no difference (p = 0.571). The 90 % interval of the difference is about (−0.51; +1.04) percentage points – it reaches beyond +1, so equivalence within ±1 percentage point is not shown. With a bound of ±1.5 it would be.
Bounds: The bounds are a practical, not a statistical decision: which difference in percentage points no longer matters? They are fixed before the analysis and not read off the result. Symmetric (± δ) by default; separate lower and upper bounds are possible. With 2 samples the bounds apply to the difference p₁ − p₂ and must enclose 0; with 1 sample they are relative to the target p₀ (bounds of ±2 at p₀ = 10 % test the range 8 % to 12 %), and the result is given in absolute percent.
Why 90 %?: TOST passes if both one-sided tests pass at level α. This corresponds exactly to the (1 − 2α) interval, i.e. the 90 % interval at α = 0.05. The usual 95 % interval would be too strict for this decision.
Method: Two samples: normal approximation (Wald) for both one-sided z-tests; the p-value is the larger of the two. One sample: exact procedure via the Clopper-Pearson (1 − 2α) interval, which stays usable at 0 events. If both proportions are 0 or both are 1 the approximation does not hold; the module then shows a notice instead of a result. Minitab offers equivalence tests only for means; there are no reference values for proportions.
1 and 2 Poisson rates
When you count defects instead of good and bad units – paint defects per area, breakdowns per operating hour – the result is a Poisson rate: x events in the exposure t. The exposure is the area, time or number of units in which the events were counted; it need not be an integer and may differ between two rates – x/t is compared. With columns, the count column gives the events per row; the exposure per row is entered separately.
1 rate: The exact test rests on the Poisson distribution with mean λ₀·t; the confidence interval is the exact (Garwood) interval. The two-sided p-value doubles the smaller one-sided value (doubling rule, capped at 1) and thus matches the interval. The normal approximation (z) is shown alongside and is reliable only when λ₀·t ≥ 5.
Difference to R: The function poisson.test in R forms the two-sided p-value by the "minlike" method (all outcomes at most as likely as the observed one). This module doubles the smaller one-sided value instead ("central"). The p-values can therefore differ; the interval is the same.
2 rates: Difference of the rates with a normal-approximation interval (unpooled standard error) and a z-test of the difference. By default the rates are estimated separately; "pooled estimate" uses a common rate and is possible only for the hypothesis "difference = 0". Alongside are the exact conditional test (binomial on x₁ out of x₁ + x₂, central as above) and the ratio of the rates with its interval.
Chi-square association
Tests whether two categorical variables are related (H₀: independent). Each cell shows observed and expected count and its contribution to χ² – large contributions show where the association sits. Pearson χ² is accompanied by the likelihood ratio G². For 2×2 tables Yates' correction and Fisher's exact test are added; only there the test direction can be chosen, and it applies to Fisher's exact test only – the decision always rests on the two-sided Pearson χ².
Warnings: If an expected count is below 1 or more than 20 % are below 5, the χ² test is unreliable – merge categories or, for 2×2, use Fisher's exact test. Rows and columns without observations are dropped.
The mosaic plot shows the same association visually.
References
- Melzer, Almut (2019)Six Sigma – kompakt und praxisnah: Prozessverbesserung effizient und erfolgreich implementieren2nd ed., Springer Gabler, Wiesbaden, ISBN 978-3-658-23754-7doi:10.1007/978-3-658-23755-4Reference values for validation: proportion tests (§3.5.1, §13.4), Fisher's exact test (§9.10), chi-square test of association (§9.11) and the Clopper-Pearson interval (§8.7). Used as scenarios in the help: the paired before/after inspection for McNemar (§3.5.1) and the re-inspection for the equivalence test (§13.4).
- Minitab Methods and Formulas: 1 Proportion, 2 Proportions, Chi-Square Test for Associationhttps://support.minitab.com/en-us/minitab/help-and-how-to/statistics/basic-statistics/how-to/1-proportion/methods-and-formulas/methods-and-formulas/Method cross-check. Deviation: for one proportion Minitab defaults to the adjusted Blaker interval; this module uses Clopper-Pearson (Minitab's "Exact" option).
- Minitab Methods and Formulas: 1-Sample Poisson Ratehttps://support.minitab.com/en-us/minitab/help-and-how-to/statistics/basic-statistics/how-to/1-sample-poisson-rate/methods-and-formulas/methods-and-formulas/Method cross-check for Poisson rates (exact interval, normal approximation, difference of two rates). Deviation: the two-sided exact p-value doubles the smaller one-sided value ("central"), not the "minlike" method of R.
Examples
This module ships with the following example datasets — load any of them in the app with a single click.
Available in the following cycles
- DMAIC: Analyze
- DMADV: Analyze
- 8D: D4 — Root Cause Analysis