Chi-square and proportions test
SCQUALITYGUILD.COM/TOOLS/CHI-SQUARE-PROPORTIONS-TEST.HTML
Enter counts in a contingency table to test whether the outcome is associated with the group, with expected counts, cell contributions, proportions with confidence intervals and the two-proportion z test for a 2×2 table.
ON THE EXAM · CSSGB IV.B.2 · FREE · NOTHING YOU TYPE LEAVES YOUR BROWSER
Q-BotClick for an explanation of this tool.For educational use. This page is a study aid. The method behind it has far more depth and detail than one page and one tool can cover, and what you see here is not everything the method offers or everything this site offers. For full understanding and application, use the governing standards and texts, and seek further education, training or qualified advice. Results depend on the data you enter, so check them before relying on them.
When to use a chi-square test of independence
Use it when both variables are categorical and you have counts: pass or fail by shift, defect type by supplier, readmitted or not by unit. The null hypothesis is that the two variables are independent, which means every row has the same mix of outcomes. The alternative is that the outcome mix differs between rows, that is, the two variables are associated.
How the statistic is built
- The expected count in each cell is (row total × column total) ÷ grand total. It is what the cell would hold if the outcome did not depend on the group.
- Each cell contributes (O − E)² ÷ E. The chi-square statistic is the sum of the contributions.
- Degrees of freedom = (rows − 1) × (columns − 1). Compare χ² with the critical value from the chi-square table, or the p value with α.
- The largest contributions show where the dependence lives. Compare observed with expected in those cells to describe it in plain words.
Proportions
When the outcome has two categories, the table is a comparison of proportions. The tool shows each row's proportion with a Wilson confidence interval, which behaves better than the simple normal (Wald) interval when the proportion is near 0 or 1 or the sample is small. For a 2×2 table it also runs the two-proportion z test with the pooled proportion. Its z² equals the chi-square statistic computed without a continuity correction, so the two tests give the same p value. Some texts and software apply Yates' continuity correction to 2×2 tables, which gives a slightly larger p value.
Conditions and traps
- Enter counts, never percentages. The test depends on the sample size.
- The chi-square approximation needs reasonable expected counts. A common rule is that no expected count is below 1 and no more than 20 percent are below 5. For a small 2×2 table use Fisher's exact test.
- Each unit must fall in exactly one cell, and the units must be independent.
- A significant result shows association, not cause. A large sample can make a small difference significant; Cramér's V gives a sense of strength.
On the Green Belt exam
Expect to compute an expected count, a cell contribution or the degrees of freedom for a contingency table, and to choose between a chi-square test and a test of means from a short scenario. The goodness-of-fit form of the chi-square test (observed counts against a claimed distribution) uses the same (O − E)² ÷ E arithmetic with k − 1 degrees of freedom.