- Introduced by
- Cressie & Read (power divergence framework); Pearson chi-square extended by multiple authors
- Year
- 1984 (power divergence); 1900 (Pearson baseline)
- Type
- Robust categorical association / goodness-of-fit test
- Family
- Classical statistics
What does it do?
The robust chi-square test is a chi-square-type test for categorical frequency counts.
It uses the power divergence family of statistics (Cressie & Read, 1984) and, where the asymptotic chi-square reference distribution is doubtful, a simulation-based p-value. It is intended for sparse contingency tables and small samples in which the usual chi-square approximation may not hold. The name "robust" describes a practical combination of these methods rather than a single standardised test.
The intuition behind the method
The ordinary chi-square test refers its statistic to a chi-square distribution, which is an approximation. That approximation is usually judged adequate when expected cell counts are large, and a common rule of thumb asks for expected counts of at least 5 per cell. Sparse tables and small studies often fail this rule. The robust approach changes two things: the statistic, chosen from the power divergence family, and, when the approximation is in doubt, the way the p-value is obtained. The tuning parameter lambda indexes the family. Lambda = 1 gives Pearson's statistic, lambda = 0 gives the log-likelihood ratio, and lambda = 2/3 gives the Cressie-Read statistic, which Cressie and Read (1984) describe as an excellent compromising alternative to the other two in their asymptotic comparison. That comparison does not establish that lambda = 2/3 handles sparse counts better than Pearson's statistic or the log-likelihood ratio; the finite-sample checks in the source are a supplement to the asymptotic results. Whether a simulated p-value keeps the error rate close to its nominal level depends on the table, so it should be checked rather than assumed.
History
Pearson introduced the chi-square goodness-of-fit test in 1900, which provided the standard large-sample approximation. Fisher's exact test gave an analytic solution for the 2x2 case. Cressie and Read (1984) placed Pearson's statistic, the log-likelihood ratio G-squared and several others within the power divergence family, which is the basis of the tunable statistic described here.
When to use it
Use the robust chi-square test for categorical frequency counts in a contingency table, either to test a specified distribution (goodness-of-fit) or to test independence between two nominal or ordinal variables. It is often considered when many expected cell counts are small. A practical working convention is that the asymptotic p-value is questioned when more than 20% of cells have expected counts below 5, or any expected count is below 1; in that case a simulation-based p-value is preferred. This convention is a rule of thumb and not a cut-off derived from the sources on this page. For 2x2 tables with small N, Fisher's exact test is usually the more direct choice. Do not use it for continuous outcomes (use t-tests or ANOVA), for paired or repeated categorical observations (use McNemar's test or Cochran's Q), or when observations are not independent.
Limitations and considerations
- Theory does not settle the choice of lambda for every table. Cressie and Read favour lambda = 2/3 as a compromise, but conclusions for borderline tables can differ across lambda values.
- A simulated p-value is an approximation whose precision depends on the number of simulated tables. This method does not give a sourced minimum, so the number of simulations should be reported and the p-value checked for stability across repeated runs.
- Expected counts are built from the margins and N. When observations are not independent, no choice of statistic or p-value corrects the test.
- For a 2x2 table with small N, Fisher's exact test computes the p-value directly and avoids the approximation altogether.
- Cramer's V depends on table dimensions through min(r-1, c-1), so values from tables of different sizes are not directly comparable.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Defined for both goodness-of-fit and independence testing, since expected counts come from a specified distribution in the first case and from the observed margins in the second.
- The lambda parameter moves the statistic through the power divergence family, so the choice of statistic can be set explicitly and stated in the report.
- Lambda = 1 reproduces Pearson's chi-square, so results can be compared directly with the standard test.
- A simulation-based p-value avoids the chi-square reference distribution when expected counts are small, which is the situation in which the asymptotic approximation is least reliable.
- Cramer's V, or phi for 2x2 tables, is computed directly from the statistic and N, so an effect size can be reported next to the p-value.
Applications
- Epidemiology: testing association between a risk factor and disease status when cell counts are low in rare-disease studies.
- Survey research: assessing whether response distributions across demographic subgroups match a theoretical distribution with small subgroup sizes.
- Educational assessment: comparing pass/fail rates across multiple curriculum groups when some groups are small.
- Marketing analytics: independence testing between product preference categories and customer segments with unequal group sizes.
- Genetics: goodness-of-fit to Hardy-Weinberg proportions in small population samples.
- Quality control: checking whether defect categories follow a specified distribution on production lines with infrequent defect types.
How it works
How it works
State the null hypothesis: either that the categorical variable follows a specified distribution (goodness-of-fit), or that two categorical variables are independent (test of independence). Define the alternative as any departure from this structure.
Formula
H_0: \text{observed frequencies fit expected (independence / specified distribution)}For an independence test in an r-by-c contingency table, compute each expected count as the row total times the column total, divided by the overall sample size N. For a goodness-of-fit test, the expected counts come from the specified distribution applied to N. Flag cells with expected counts below 5, because these cells determine whether the robustness check below is needed.
Formula
E_{ij} = \dfrac{R_i \cdot C_j}{N}Compute the power divergence statistic T(lambda) with the chosen lambda, using the formula above. Lambda = 1 gives Pearson's chi-square and lambda = 0 gives the log-likelihood ratio G-squared. Lambda = 2/3 gives the Cressie-Read statistic, which is a common starting choice here because Cressie and Read (1984) present it as an excellent compromising alternative to the other two in their analytic comparison. That comparison concerns asymptotic behaviour and does not guarantee the best choice for every table.
Formula
T_\lambda = \dfrac{2}{\lambda(\lambda+1)} \sum_{i} O_i \left[\left(\dfrac{O_i}{E_i}\right)^\lambda - 1\right]Decide whether the asymptotic chi-square reference distribution can be trusted. As a working convention in this method, if more than 20% of cells have expected counts below 5, or any cell has an expected count below 1, replace the chi-square p-value with a simulation-based (Monte Carlo) p-value. This convention is a practical rule of thumb and is not a cut-off derived from the sources on this page. For the simulation, generate B tables under the null model: for independence, tables with the observed row and column totals fixed; for goodness-of-fit, tables drawn from the specified distribution with total N. Compute T(lambda) for each simulated table and take p = (number of simulated statistics at least as large as the observed statistic + 1) / (B + 1). Report the null model and B. This page gives no sourced minimum for B, so check that the p-value is stable across repeated runs.
Reject the null hypothesis if the p-value is below the chosen alpha (0.05 is the usual convention). Report the test statistic and the lambda used, the degrees of freedom, and the p-value, stating whether it is asymptotic or simulation-based. Degrees of freedom are (r-1)(c-1) for an r-by-c test of independence and k-1 for a goodness-of-fit test with k categories and no parameters estimated from the data. Also report an effect size such as Cramer's V, or phi for 2x2 tables, to convey magnitude alongside significance.
Formula
\text{reject } H_0 \text{ if } p < 0.05; \quad V = \sqrt{\chi^2 / (N \cdot \min(r-1, c-1))}Common pitfalls
- Using the default Pearson statistic without first inspecting the expected cell counts. Always check the contingency table before choosing the form of the test.
- Reading a significant result from a large-N table as practically important without looking at Cramer's V or phi, since a small effect can reach significance with a large sample.
- Treating ordered categories as nominal. If both variables are ordered, consider a test for trend across ordered categories or an ordinal regression model instead.
- Applying the test to matched or repeated-measures categorical data. Use McNemar's test or Cochran's Q instead.
Frequently asked questions
How do I choose the lambda parameter?
Lambda = 2/3 (the Cressie-Read statistic) is a common starting point, because Cressie and Read (1984) single it out as an excellent compromise between Pearson's statistic (lambda = 1) and the log-likelihood ratio (lambda = 0). It is not a universally optimal setting, and the source does not show that it performs better than the alternatives on sparse tables. If conclusions are borderline, report Pearson alongside Cressie-Read and state whether they agree.
When should I use Monte Carlo p-values instead of the asymptotic chi-square?
Use a simulation-based p-value when the cell-count criteria above are not met, that is, when more than 20% of expected counts fall below 5 or any expected count is below 1. These criteria are a working convention. For 2x2 tables with small N, Fisher's exact test is the cleaner choice. Report the number of simulated tables and check that the p-value is stable when the simulation is repeated.
Is the robust chi-square test the same as the Yates-corrected chi-square?
No. Yates' continuity correction is an adjustment to the Pearson statistic for 2x2 tables. The approach described here changes the statistic within the power divergence family and, where needed, the way the p-value is obtained.
What effect size should I report?
For 2x2 tables, report phi (phi = sqrt(chi^2 / N)). For larger tables, report Cramer's V (V = sqrt(chi^2 / (N * min(r-1, c-1)))). Benchmarks for small, medium and large effects vary by field, so interpret the value against conventions in your own discipline rather than a single fixed scale.
Can I use this test with ordinal categorical variables?
You can, but it ignores the ordering information. When both variables are ordered, a test for trend across ordered categories or an ordinal logistic model can use the order to gain power. Use the chi-square test (robust or otherwise) for nominal categories or when you do not want to assume a linear trend.
Related methods
Sources
Cressie, N., & Read, T. R. C. (1984). Multinomial goodness-of-fit tests. Journal of the Royal Statistical Society: Series B, 46(3), 440–464.
Open DOI referenceAgresti, A. (2002). Categorical Data Analysis (2nd ed.). Wiley-Interscience.
ISBN: 978-0471360933