4.3 χ²-tests

2026 Syllabus Objectives

  1. Fit a theoretical distribution, as prescribed by a given hypothesis, to given data
  2. Use a χ²-test, with the appropriate number of degrees of freedom, to carry out the corresponding goodness of fit analysis (classes should be combined so that each expected frequency is at least 5)
  3. Use a χ²-test, with the appropriate number of degrees of freedom, for independence in a contingency table (Yates' correction is not required; where appropriate, either rows or columns should be combined so that the expected frequency in each cell is at least 5)

10.1 Forming Hypotheses

Understanding Goodness of Fit Tests

We test how well observed data from an experiment fits the expected values from a theoretical distribution. This is crucial for determining whether our data follows a particular probability model.

🔑 Key Concept: A discrete uniform distribution occurs when each outcome is equally likely and has the same probability.

Setting Up Hypotheses

For a hypothesis test, we define:

  • Null Hypothesis (H0H_0): The theoretical distribution is a good-fit model for the observed data
  • Alternative Hypothesis (H1H_1): The theoretical distribution is not a good-fit model for the observed data

Critical: Always refer to the specific distribution you are testing in your hypotheses, and ensure your conclusions address the initial problem.

Key Terms 📌

  • Constraint: A condition that reduces the number of free variables in a system by one
  • Free variables: Independent variables in a system
  • Degrees of freedom (ν\nu): The number of independent values in the system after constraints and estimated parameters are accounted for
  • Chi-squared (χ2\chi^2): A test statistic used to measure the difference between observed and expected frequencies

Calculating Expected Frequencies

Expected frequency for outcome ii:

Ei=N×P(X=xi)E_i = N \times P(X = x_i)

where NN is the total number of trials and P(X=xi)P(X = x_i) is the probability of outcome xix_i.

Degrees of Freedom Formula

ν=number of expected values1number of parameters estimated\nu = \text{number of expected values} - 1 - \text{number of parameters estimated}

The 1-1 accounts for the constraint that the total observed frequency equals the total expected frequency.

The Chi-Squared Test Statistic ⚡

χ2=(OiEi)2Ei\chi^2 = \sum \frac{(O_i - E_i)^2}{E_i}

where:

  • OiO_i = observed frequency for category ii
  • EiE_i = expected frequency for category ii

Alternative computational formula:

χ2=(Oi2Ei)N\chi^2 = \sum \left( \frac{O_i^2}{E_i} \right) - N

This form is often more convenient for calculations.

Worked Example: Testing a Fair Die

Problem: An experiment is carried out to test whether a die is biased. A die is rolled 180 times with the following observations:

Number (nn)123456
Observed frequency293134392324

Test, at the 5% significance level, whether the die is biased.

Solution:

Step 1: Set up hypotheses

  • H0H_0: A discrete uniform distribution is a good fit
  • H1H_1: A discrete uniform distribution is not a good fit

Step 2: Calculate expected frequencies

For a fair die, each outcome has probability 16\frac{1}{6}.

Ei=180×16=30 for each outcomeE_i = 180 \times \frac{1}{6} = 30 \text{ for each outcome}

Step 3: Calculate the test statistic

NumberObserved (OiO_i)Expected (EiE_i)(OiEi)2Ei\frac{(O_i - E_i)^2}{E_i}
129300.0333
231300.0333
334300.5333
439302.7
523301.6333
624301.2

χ2=(OiEi)2Ei=6.1333\chi^2 = \sum \frac{(O_i - E_i)^2}{E_i} = 6.1333

Step 4: Determine degrees of freedom

ν=610=5\nu = 6 - 1 - 0 = 5

(6 categories, no parameters estimated)

Step 5: Find critical value

From tables: χ52(0.95)=11.07\chi^2_5(0.95) = 11.07

Step 6: Make decision

Since 6.1333<11.076.1333 < 11.07, there is insufficient evidence to reject H0H_0.

Conclusion: There is insufficient evidence to suggest that the die is biased. A discrete uniform distribution is a good fit for the data.

Sign in to view full notes