Unit 1 used χ2 to ask whether two variables in a table are independent. Here the question is different: does a single set of frequencies fit a proposed distribution? The arithmetic is identical; what changes is how the expected frequencies are produced and how the degrees of freedom are counted.
The goodness-of-fit idea
χ2=∑E(O−E)2
H0: the data follow the stated distribution
H1: the data do not follow it
A large χ2 means observed and expected are far apart, so the model is rejected. The test is always one-tailed on the right — only large values count as evidence against the fit.
Equal proportions
The simplest model: every category equally likely.
A die is rolled 120 times.
Face
1
2
3
4
5
6
Total
O
15
23
18
22
17
25
120
E
20
20
20
20
20
20
120
χ2=2025+9+4+4+9+25=2076=3.80
Degrees of freedom: ν=6−1=5, since the six expected frequencies are free apart from having to total 120. The 5% critical value is χ0.05,52=11.070.
As 3.80<11.070, do not reject H0: there is no evidence at the 5% level that the die is biased.
A stated ratio
A genetic theory predicts four phenotypes in the ratio 9:3:3:1. Of 320 plants:
Phenotype
A
B
C
D
Total
O
168
64
68
20
320
E
180
60
60
20
320
The expected values come from splitting 320 in the ratio: 169(320)=180, 163(320)=60, and so on.
χ2=180144+6016+6064+0=0.800+0.267+1.067=2.13
With ν=4−1=3 and χ0.05,32=7.815, the theory is not rejected.
Fitting a Poisson distribution
Now the model has a parameter, and the parameter is estimated from the data.
Accidents per week at a factory, over 100 weeks:
Accidents
0
1
2
3
≥4
Total
Weeks
26
28
24
14
8
100
The total number of accidents is 0(26)+1(28)+2(24)+3(14)+4(8)=150, so
λ^=100150=1.5
Expected frequencies are 100×P(X=x) for Po(1.5), with the last class taking whatever is left:
ν=(number of classes)−1−(parameters estimated from the data)
Equal proportions or a stated ratio: nothing is estimated, so ν=k−1.
Poisson with λ estimated: ν=k−2.
Binomial with p estimated: ν=k−2. If p is stated in the question, nothing is estimated and ν=k−1.
Normal with both μ and σ estimated: ν=k−3.
For the accident data, ν=5−1−1=3 and χ0.05,32=7.815. Since 2.03<7.815, the Poisson model is not rejected — accidents are consistent with occurring at random at a constant rate.
Pooling small classes
The test requires every expected frequency to be at least 5. Where one is smaller, combine adjacent classes until it is not.
Suppose the tail gave E=3.1 and 1.2. Merging them into a single class with E=4.3 is still below 5, so merge one class further in. Then recount:
ν=(classes AFTER pooling)−1−(parameters estimated)
Writing the conclusion
A complete answer has five parts:
H0 and H1 stated in context
E computed, with ∑E=∑O checked
χ2=∑E(O−E)2
ν, with the parameter count justified, and the critical value quoted
A comparison and a sentence in the language of the question