4.3 Chi-squared tests
- Syllabus
- 9231–2028–2029
- Topic
- 4.3
- Level
- AS
Under the stated hypothesis, identify the theoretical distribution and estimate only the parameters the question leaves unknown. Calculate each class probability from that fitted model, then multiply by the total frequency N: expected count E=Np. Preserve exhaustive classes, including a final tail such as X at least 4.
ForafittedPoissonmodel,estimate\hat\lambda=\bar x=\frac{\sum xf}{N},thenP(X=r)=e^{-\hat\lambda}\frac{\hat\lambda^r}{r!},\qquad E_r=N P(X=r).AtailclasshasE_{\ge k}=N\left(1-\sum_{r=0}^{k-1}P(X=r)\right).
If $N=100$ and the fitted value is $\hat\lambda=1.2$, then the expected frequency for $X=0$ is100e^{-1.2}=30.12,and for $X=1$ it is100e^{-1.2}(1.2)=36.14.Continuewithunroundedprobabilitiesbeforecombininganysmalltailclasses.
Fitting does not mean copying observed proportions into expected counts. Matching an estimated mean does not establish good fit; it only supplies the model probabilities that the chi-squared analysis will assess.
Set H0 to the prescribed distribution and H1 to not that distribution. Before calculating the statistic, combine adjacent classes so every final expected frequency is at least 5; combine their observed and expected counts together.
For the final $k$ classes,X^2=\sum\frac{(O-E)^2}{E}.If $p$ distribution parameters were estimated from these data,\text{df}=k-1-p.Compareintheuppertail:alargestatisticisevidenceagainstthefittedmodel.
With final observed counts $(20,30,50)$ and expected counts $(25,25,50)$,X^2=\frac{25}{25}+\frac{25}{25}+0=2.00.If no parameter was estimated, df $=3-1=2$; since $2.00<5.991$ at 5%, do not reject H0.
Count classes after combining and subtract every parameter estimated from the same data. A non-significant result means the data are compatible with the model at that level; it does not prove the model true.
For an $r\times c$ contingency table, $H_0$ states that the two categorical variables are independent. The expected count in cell $(i,j)$ isE_{ij}=\frac{(\text{row }i\text{ total})(\text{column }j\text{ total})}{\text{grand total}},and df $=(r-1)(c-1)$.
Forobservedcounts\begin{pmatrix}30&20\10&40\end{pmatrix},rowtotalsare50,50andcolumntotals40,60,soexpectedcountsare\begin{pmatrix}20&30\20&30\end{pmatrix}.ThusX^2=\frac{100}{20}+\frac{100}{30}+\frac{100}{20}+\frac{100}{30}=16.67.
Here df=1 and 16.67 exceeds the 5% critical value 3.841, so reject independence and conclude that there is evidence of an association. Every final expected cell must be at least 5; where needed, combine meaningful rows or columns before recalculating margins and df.
Use counts, not percentages, and do not apply Yates' correction in this syllabus. Association is not causation, and independence is not the same as mutually exclusive categories.