Chi-Square Independence Test
Enter observed counts in a contingency table to compute the chi-square statistic, degrees of freedom, and p-value for testing independence.
Contingency Table
Fill in the table and click Run Test to see results.
Chi-Square (χ²)
—
Degrees of Freedom
—
P-Value
—
Expected Counts
Cell Contributions to χ²
Summary
Enter observed counts in a contingency table to compute the chi-square statistic, degrees of freedom, and p-value for testing independence.
How it works
- Choose the number of rows and columns for your contingency table (default 2x2).
- Enter the observed frequency counts in each cell.
- Click "Run Test" to compute row and column totals.
- The tool calculates expected counts using the formula: (row total × column total) / grand total.
- The chi-square statistic is the sum of (observed - expected)^2 / expected across all cells.
- Degrees of freedom = (rows - 1) × (columns - 1). The p-value is derived from the chi-square distribution.
Use cases
- Test whether a marketing campaign response rate differs across age groups.
- Determine if product preference is independent of gender.
- Analyze whether disease occurrence is associated with a risk factor.
- Evaluate whether survey responses differ between regions.
- Check independence of two classification variables in a research dataset.
- Validate assumptions before applying further statistical models.
Frequently Asked Questions
Last updated: 2026-06-10 ·
Reviewed by Nham Vu