Calculator Inputs
Set dimensions, labels, counts, and decision settings.
Example Data Table
This sample shows beverage preference by age group.
| Age Group | Tea | Coffee | Juice |
|---|---|---|---|
| Teens | 20 | 12 | 18 |
| Adults | 14 | 24 | 12 |
| Seniors | 8 | 18 | 14 |
Formula Used
The chi square test for independence checks whether two categorical variables are associated.
Expected frequency: Eij = (Row Total × Column Total) / Grand Total
Chi square statistic: χ² = Σ ((Oij - Eij)² / Eij)
Degrees of freedom: (r - 1) × (c - 1)
P value: The calculator uses the chi square distribution upper tail.
Cramér's V: V = √(χ² / (N × min(r-1, c-1)))
Large residuals highlight cells contributing most to dependence.
How to Use This Calculator
- Choose the number of rows and columns.
- Enter row labels and column labels, separated by commas.
- Fill every observed frequency input with a count.
- Set alpha and decimals for your preferred output style.
- Press Calculate Chi Square Test.
- Review the statistic, p value, effect size, and assumptions.
- Inspect expected counts and residuals for detailed insight.
- Download CSV or PDF for reporting or documentation.
Frequently Asked Questions
1. What does this calculator test?
It tests whether two categorical variables are independent. A small p value suggests the variables are associated within the sampled data.
2. What are observed counts?
Observed counts are the real frequencies entered for each cell in the contingency table. They come directly from your data collection.
3. What are expected counts?
Expected counts represent values predicted under independence. They are calculated from row totals, column totals, and the grand total.
4. Why do residuals matter?
Residuals show which cells differ most from independence. Large positive or negative values highlight stronger contributions to the chi square statistic.
5. What does Cramér's V show?
Cramér's V estimates association strength. It complements the p value by showing whether the relationship is weak, moderate, or strong.
6. What sample rule should I check?
Expected counts should usually be at least 5 in most cells. Very small expected values can weaken the reliability of the test.
7. Can I use percentages instead of counts?
No. The test requires raw frequencies. Percentages can distort totals and expected values, leading to incorrect results.
8. What does a large p value mean?
A large p value means the data does not provide strong evidence against independence. It does not prove independence with certainty.