Tests whether observed counts follow the expected proportions. It calculates χ² = Σ(observed − expected)² ÷ expected and the upper-tail p-value from the chi-square distribution with k − 1 degrees of freedom. The expected values are read as proportions and rescaled to the total of the observed counts, so 10, 10, 10 and 1, 1, 1 give the same result.
A goodness-of-fit test asks whether observed counts follow the proportions you expected: whether a die is fair, whether the blood types in a sample match the national figures.
Each gap is squared and divided by the expected count, so the same gap of 4 counts for more where 10 were expected than where 100 were. The degrees of freedom are the number of categories − 1.
The defaults roll a die 60 times, with the faces coming up 8, 12, 9, 11, 14 and 6 times. A fair die would give 10 of each.
On degrees of freedom the upper-tail p-value is 0.5210. The critical value at 5% is 11.0705, far above 4.2, so the die cannot be called unfair.
The expected values are read as proportions and rescaled to the total of the observed counts. Entering 10, 10, 10, 10, 10, 10 and entering 1, 1, 1, 1, 1, 1 give the same answer, and a ratio such as 3 : 1 can go in directly as 3, 1.
The test is unreliable when the expected counts are small. As a rule of thumb, if any expected count falls below 5, merge categories or use another method.
The observed values are counts: whole numbers, zero or more. Enter the number of items, not a proportion such as 0.3.