Maths4U
Menu

Maths4U Original · Learn, check, explain

Forming hypotheses — 9231 FPS

Build expected frequencies, calculate the statistic and adjust degrees of freedom.

Notes and key methods

Under a goodness-of-fit null model, expected frequencies are \(E_i=np_i\). The statistic is \(\displaystyle \chi^{2}= \sum \frac{(O_{i}- E_{i})^{2}}{E_{i}}\).

After combining categories so every expected frequency is at least 5, use k−1−m degrees of freedom, where k is the number of retained categories and m is the number of parameters estimated from these same data. The p-value is an upper chi-squared tail.

Check the conditions

Three worked examples

Example 1 · Chi-squared goodness of fit

A null model assigns equal probabilities to four outcomes, with no fitted parameters. Observed counts are \(30,18,36,12\).

Use a 5% significance level for a written conclusion. A distribution calculator may be used for numerical p-values.

  1. Find the expected frequency in each category.
  2. Find the chi-squared statistic.
  3. Find the p-value.
  4. For a separate fit with \(\displaystyle k=5\) retained classes and one estimated parameter, find the degrees of freedom.
Show the reasoning

(a)

\(\displaystyle E= \frac{96}{4}= 24\)

Answer: \(24\).

(b)

\(\displaystyle \sum \frac{(O- E)^{2}}{E}= 15\)

Answer: \(15\).

(c)

\(P(\chi^2_3\ge 15)=0.00181664896657232\)

Answer: \(0.00181664896657232\).

(d)

\(k-1-1=3\)

Answer: \(3\).

The p-value is \(0.00181664896657232\). Since it is at most 0.05, reject \(\displaystyle H_{0}\): there is evidence that the specified categorical distribution does not fit. This does not give the probability that \(\displaystyle H_{0}\) is true.

Example 2 · Chi-squared goodness of fit

A null model assigns equal probabilities to four outcomes, with no fitted parameters. Observed counts are \(27,23,29,21\).

Use a 5% significance level for a written conclusion. A distribution calculator may be used for numerical p-values.

  1. Find the expected frequency in each category.
  2. Find the chi-squared statistic.
  3. Find the p-value.
  4. For a separate fit with \(\displaystyle k=6\) retained classes and one estimated parameter, find the degrees of freedom.
Show the reasoning

(a)

\(\displaystyle E= \frac{100}{4}= 25\)

Answer: \(25\).

(b)

\(\displaystyle \sum \frac{(O- E)^{2}}{E}= \frac{8}{5}\)

Answer: \(\displaystyle \frac{8}{5}\).

(c)

\(\displaystyle P(\chi^2_3\ge \frac{8}{5})=0.659389819711985\)

Answer: \(0.659389819711985\).

(d)

\(k-1-1=4\)

Answer: \(4\).

The p-value is \(0.659389819711985\). Since it exceeds 0.05, do not reject \(\displaystyle H_{0}\): the sample gives insufficient evidence that the specified categorical distribution does not fit. This does not give the probability that \(\displaystyle H_{0}\) is true.

Example 3 · Chi-squared goodness of fit

A null model assigns equal probabilities to four outcomes, with no fitted parameters. Observed counts are \(29,23,32,20\).

Use a 5% significance level for a written conclusion. A distribution calculator may be used for numerical p-values.

  1. Find the expected frequency in each category.
  2. Find the chi-squared statistic.
  3. Find the p-value.
  4. For a separate fit with \(\displaystyle k=7\) retained classes and one estimated parameter, find the degrees of freedom.
Show the reasoning

(a)

\(\displaystyle E= \frac{104}{4}= 26\)

Answer: \(26\).

(b)

\(\displaystyle \sum \frac{(O- E)^{2}}{E}= \frac{45}{13}\)

Answer: \(\displaystyle \frac{45}{13}\).

(c)

\(\displaystyle P(\chi^2_3\ge \frac{45}{13})=0.325784820275207\)

Answer: \(0.325784820275207\).

(d)

\(k-1-1=5\)

Answer: \(5\).

The p-value is \(0.325784820275207\). Since it exceeds 0.05, do not reject \(\displaystyle H_{0}\): the sample gives insufficient evidence that the specified categorical distribution does not fit. This does not give the probability that \(\displaystyle H_{0}\) is true.

Common mistakes

Practise with answer checking

Original exam-style problems

Write complete solutions before opening the worked solution. The marking guidance rewards reasoning as well as answers.

Examination practice · 2020–2026

Apply the method to recent source-labelled questions from this chapter.

Browse recent examination questions · All topic resources and the full bank

Next skill: Goodness of fit for discrete distributions →