IB Maths Help logoIB Maths Help

Hypothesis testing

Chi-squared test (goodness of fit & independence)

The core AI hypothesis test: check whether data fit a distribution, or whether two variables are independent.

In short: The chi-squared test checks whether observed frequencies differ from expected frequencies by more than chance would explain. It is used for goodness of fit and for testing independence in a contingency table. The GDC returns the χ² value, the degrees of freedom and the p-value; compare the p-value with the significance level to decide.

When you'd use this

TI-84 Plus CECasio fx-CG50 and fx-CG100TI-Nspire CX

At a glance: TI-84 Plus CE, Casio fx-CG50 and TI-Nspire CX compared

 TI-84 Plus CECasio fx-CG50 and fx-CG100TI-Nspire CX
Key sequenceGoodness of fit: STAT → TESTS → χ²GOF-Test. Independence: put the data in a matrix (2nd → x⁻¹ → EDIT), then STAT → TESTS → χ²-Test.Main menu → Statistics → TEST → CHI → GOF, or 2WAY for a contingency table.menu → Statistics → Stat Tests → χ² GOF, or χ² 2-way Test (enter the observed matrix).

On a TI-84 Plus CE

  1. State H₀ and H₁ and the significance level first.
  2. Goodness of fit: STAT → TESTS → χ²GOF-Test. Independence: put the data in a matrix (2nd → x⁻¹ → EDIT), then STAT → TESTS → χ²-Test.

Tip: Compare the p-value to the significance level: p < level ⇒ reject H₀. Check every expected frequency is ≥ 5; the degrees of freedom are (rows−1)(cols−1) for independence.

On a Casio fx-CG50 and fx-CG100

  1. State H₀ and H₁ and the significance level first.
  2. Main menu → Statistics → TEST → CHI → GOF, or 2WAY for a contingency table.

Tip: Compare the p-value to the significance level: p < level ⇒ reject H₀. Check every expected frequency is ≥ 5; the degrees of freedom are (rows−1)(cols−1) for independence.

On a TI-Nspire CX

  1. State H₀ and H₁ and the significance level first.
  2. menu → Statistics → Stat Tests → χ² GOF, or χ² 2-way Test (enter the observed matrix).

Tip: Compare the p-value to the significance level: p < level ⇒ reject H₀. Check every expected frequency is ≥ 5; the degrees of freedom are (rows−1)(cols−1) for independence.

Related guides

Try it yourself

Here's a real IB-style question that uses exactly this technique.

Hard Calculator Paper 2 [4 marks]

A 2×2 contingency table has observed values 20, 30 (row 1) and 25, 25 (row 2). Test for independence at the 5% significance level.

χ² = 1.01, p = 0.315 > 0.05, so fail to reject independence
Mark it
Correct 4 / 4 marks
Worked solution & mark scheme:
M1 Find the expected frequencies from the row/column totals
M1 χ² = Σ(O − E)²/E
A1 χ² = 1.01, p = 0.315
R1 p > 0.05, so fail to reject H₀ (independent)

Common questions

When would I need to do a chi-squared test (goodness of fit or independence) in IB Maths?

The core AI hypothesis test: check whether data fit a distribution, or whether two variables are independent. Testing whether observed data fits a claimed distribution (goodness of fit). Testing whether two categorical variables are independent, from a contingency table.

How do I do a chi-squared test (goodness of fit or independence) on a TI-84 Plus CE?

1. State H₀ and H₁ and the significance level first. 2. Goodness of fit: STAT → TESTS → χ²GOF-Test. Independence: put the data in a matrix (2nd → x⁻¹ → EDIT), then STAT → TESTS → χ²-Test.

How do I do a chi-squared test (goodness of fit or independence) on a Casio fx-CG50 and fx-CG100?

1. State H₀ and H₁ and the significance level first. 2. Main menu → Statistics → TEST → CHI → GOF, or 2WAY for a contingency table.

How do I do a chi-squared test (goodness of fit or independence) on a TI-Nspire CX?

1. State H₀ and H₁ and the significance level first. 2. menu → Statistics → Stat Tests → χ² GOF, or χ² 2-way Test (enter the observed matrix).

What should I watch out for when I do a chi-squared test (goodness of fit or independence)?

Compare the p-value to the significance level: p < level ⇒ reject H₀. Check every expected frequency is ≥ 5; the degrees of freedom are (rows−1)(cols−1) for independence.

How are marks awarded when I do a chi-squared test (goodness of fit or independence) in an IB exam?

In the worked example on this page (4 marks, Paper 2), the marks are: M1: Find the expected frequencies from the row/column totals; M1: χ² = Σ(O − E)²/E; A1: χ² = 1.01, p = 0.315; R1: p > 0.05, so fail to reject H₀ (independent).

Practise with your calculator

Questions that need this technique link back to this guide. Try one in practice mode, or see every GDC guide.