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.
Use the Chi-Square Independence Test
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
The chi-square test of independence determines whether two categorical variables are related or independent. You enter observed counts into a contingency table, and the tool computes expected counts under the null hypothesis of independence, then calculates the chi-square statistic and the corresponding p-value. A small p-value (typically below 0.05) suggests the variables are not independent.
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-13 · Reviewed by Nham Vu