Loading...
Loading...
Perform chi-square tests of independence and goodness of fit with step-by-step solutions, expected frequencies, and Python code.
Enter your data and click Calculate to see results.
Quick Reference:
Significance Levels:
The test requires: (1) observations are independent, (2) data are categorical (nominal or ordinal), (3) expected frequencies should be at least 5 in each cell (some texts allow 80% of cells with E >= 5). For small samples or when assumptions are violated, use Fisher's exact test.
Cramér's V is an effect size measure ranging from 0 (no association) to 1 (perfect association). For a 2x2 table, V equals the absolute value of the phi coefficient. Guidelines: V = 0.1 is small, V = 0.3 is medium, V = 0.5 is large. It helps assess practical significance beyond the p-value.
Mathematically, the calculations are identical. The difference is in study design: the test of independence uses one sample classified on two variables, while the test of homogeneity compares distributions across two or more populations. The interpretation differs even though the formula is the same.
When expected frequencies are below 5, the chi-square approximation may be poor. Options: (1) combine categories to increase expected counts, (2) use Fisher's exact test for 2x2 tables, (3) use a Monte Carlo simulation for larger tables, or (4) report results with a caveat about the approximation.