Contingency Table Test Inputs
Use whole counts or weighted frequencies. Enter counts, not percentages.
Example Data Table
This sample 3×3 table is preloaded by the example button and can help you test the calculator quickly.
| Category | Col 1 | Col 2 | Col 3 |
|---|---|---|---|
| Row 1 | 40 | 25 | 35 |
| Row 2 | 30 | 45 | 25 |
| Row 3 | 20 | 30 | 50 |
Formula Used
Expected Frequency
Eij = (Row Totali × Column Totalj) / N
Chi-Square Statistic
χ² = Σ [(Oij - Eij)² / Eij]
Yates Correction for 2×2 Tables
χ² = Σ [(|Oij - Eij| - 0.5)² / Eij]
Degrees of Freedom
df = (r - 1)(c - 1)
Effect Size
Cramér's V = √[χ² / (N × min(r - 1, c - 1))]
The calculator also estimates the p-value from the upper-tail chi-square distribution, which determines whether the observed pattern is statistically significant at your chosen alpha level.
How to Use This Calculator
- Select the number of rows and columns in your contingency table.
- Enter the observed frequencies for every visible cell.
- Set your significance level, such as 0.05 or 0.01.
- Enable Yates correction only for a 2×2 table if desired.
- Click the calculation button to generate the results.
- Review the chi-square statistic, p-value, residuals, and effect size.
- Inspect the chart to compare observed and expected cell patterns.
- Download a CSV or PDF report when you need documentation.
Frequently Asked Questions
1. What does a contingency table test measure?
It tests whether two categorical variables appear independent or associated. The chi-square statistic compares observed counts with expected counts under the assumption of independence.
2. When should I use this calculator?
Use it when your data are categorical and arranged as counts across rows and columns. Common cases include survey responses, treatment outcomes, and demographic comparisons.
3. Can I enter percentages instead of counts?
No. This test requires frequencies or weighted frequencies. Percentages alone do not preserve the sample size needed for expected counts, chi-square values, and p-value estimation.
4. What does a small p-value mean?
A small p-value suggests the observed table differs more than expected under independence. When p is below alpha, you reject the null hypothesis of independence.
5. What is Cramér's V used for?
Cramér's V summarizes the strength of association after the test. It helps you judge practical importance, not just statistical significance.
6. When should I use Yates correction?
Use it only for 2×2 contingency tables when you want a more conservative chi-square approximation. It reduces the statistic slightly, especially with small counts.
7. What if several expected counts are below 5?
The chi-square approximation may become less reliable. In that case, consider combining sparse categories or using an exact method if your statistical workflow allows it.
8. Does statistical significance prove causation?
No. A significant association shows a relationship in the table, but it does not prove one variable causes the other. Study design still matters.