Test of independence
Asks whether two categorical variables are related, for example study habit (rows) and pass/fail (columns). If they were independent, each cell’s expected count would be row total × column total ÷ grand total. Large gaps between observed and expected counts give a large χ² and a small p-value. Degrees of freedom = (rows − 1)(columns − 1).
Goodness of fit
Asks whether one set of counts matches expected proportions: is a die fair (all six faces equal)? Do M&M colours match the company’s stated mix? Enter the observed counts and, optionally, the expected counts or proportions. Degrees of freedom = categories − 1.
The test needs counts (not percentages or means), independent observations, and expected counts of at least 5 in each cell.
Frequently asked questions
Can I enter percentages?
Not as observed values: chi-square needs actual counts. You can give expected values as proportions or percentages in the goodness-of-fit test; they are scaled to your total.
Is the chi-square test one-tailed?
Yes, it is right-tailed: only large values of χ² count as evidence against the null hypothesis.