Chi-Square Test of Independence
=
Tap a term to see what it means, or .
Calculate
Example: 50 patients got treatment A and 50 got B. With A, 30 improved and 20 didn't; with B, 18 improved and 32 didn't. Does improvement depend on the treatment? Change the values to work out your own case.
Step by step
What each term means
- Chi-Square Statistic (χ²)
- Measures how far the observed table is from the one expected if the two variables were independent. The larger it is, the stronger the evidence of an association.
- Double Sum (Σᵢ,ⱼ)
- Adds over every cell of the table: each row i and each column j. With r rows and c columns, the test has (r − 1)(c − 1) degrees of freedom.
- Squared Difference ((Oᵢⱼ − Eᵢⱼ)²)
- The gap between the observed count in the cell and the expected one, squared so that deviations up and down don't cancel out.
- Expected Frequency (Eᵢⱼ)
- The count the cell would have if the variables were independent: row total × column total ÷ grand total. Dividing by it puts each difference in proportion to the size of the cell.
When to use it, assumptions and alternatives: the chi-square test of independence in the statistical tests catalog.