Chi-Square Independence
Calculate Chi-Square Independence instantly with the exact formula and a worked example.
Chi-Square Independence
The chi-square test of independence checks whether two categorical variables are associated — for example, customer segment and chosen plan. This calculator handles contingency tables with two rows and two or three columns.
How the calculation works
Enter observed counts (not percentages) in the cells: the two rows are your two groups and the columns are the outcome categories. For a 2×2 table leave both column-3 cells at zero; a column whose two cells are both 0 is dropped from the calculation.
For each cell the calculator computes the count expected under independence, E = row total × column total ÷ N, where N is the grand total. Pearson’s statistic is χ² = Σ (O − E)² ÷ E, with degrees of freedom df = (rows − 1) × (columns − 1): 1 for a 2×2 table, 2 for 2×3. The p-value comes from the chi-square distribution with df degrees of freedom, and the tool flags the result as significant or not at α = 0.05.
Effect size is reported as Cramér’s V = √(χ² ÷ (N × (min(r, c) − 1))), which for two rows reduces to √(χ² ÷ N). Zero means no association; values toward 1 mean a strong one. If any expected count is below 5 you get a warning, because the chi-square approximation becomes unreliable.
Worked example
Defaults: group 1 — 20, 30, 50; group 2 — 30, 30, 40 (100 people each, N = 200). Column totals are 50, 60, 90, so expected counts in each row are 25, 30, 45. χ² = 2 × [(20 − 25)²/25 + 0 + (50 − 45)²/45] = 2 × (1 + 0.556) ≈ 3.111. With df = 2, p ≈ 0.211, above 0.05, so the association is not significant. Cramér’s V = √(3.111 ÷ 200) ≈ 0.125.
Things to keep in mind
- Use raw counts. Percentages or averages produce a meaningless χ².
- Each subject must fall into exactly one cell. Paired or repeated measurements on the same people need a different test, such as McNemar’s.
- For 2×2 tables the calculator uses the uncorrected Pearson χ² (no Yates continuity correction). With small expected counts, Fisher’s exact test is the safer choice.
- Significance is not strength: with a large sample, even V ≈ 0.05 can be “significant” while being practically negligible.
- The test detects association, not causation.
More about: Chi-Square Independence
What it calculates
The “Chi-Square Independence” calculator computes χ² from 6 parameters: row 1, column 1, row 1, column 2, row 1, column 3 (0 = no column), row 2, column 1, row 2, column 2, row 2, column 3 (0 = no column).
A core calculation for studying, engineering tasks, and checking solutions.
Example calculation
With parameters Row 1, column 1 = 20, Row 1, column 2 = 30, Row 1, column 3 (0 = no column) = 50, Row 2, column 1 = 30, Row 2, column 2 = 30, Row 2, column 3 (0 = no column) = 40 the result is 3.11.
How to use
- Enter row 1, column 1, row 1, column 2, row 1, column 3 (0 = no column), row 2, column 1, row 2, column 2 and row 2, column 3 (0 = no column) — each field above is adjustable with a slider.
- χ² is calculated automatically as you type.
- Check the worked example below to see the formula applied to real numbers.
- Copy the result or bookmark this calculator.
Related calculators
FAQ
How do I read the p-value?
What if an expected count is below 5?
Can I analyze a 3×3 table?
How is this different from a chi-square goodness-of-fit test?
More calculators in this category
Explore related free tools