t-test (AI HL)

A t-test decides whether a sample gives enough evidence that a population mean differs from a claimed value, when the standard deviation is not known. You state H0H_0 and H1H_1, find the p-value, and compare it with the significance level to reach a conclusion in context. It covers one-sample and paired tests. It's part of the broader Hypothesis Testing topic.

18 questions on this sub-topic.

Syllabus

CodeSyllabus content
SL4.11Formulation of null and alternative hypotheses (H0H_0 and H1H_1), significance levels and p-values. The χ2\chi^2 test for independence (contingency tables, degrees of freedom, critical value) and the χ2\chi^2 goodness-of-fit test - only upper-tail tests at common significance levels (1%, 5%, 10%) are set, and expected frequencies must be greater than 5.

Official IB source: Mathematics: applications and interpretation subject brief (PDF, ibo.org).

Skills practised on this page:

The decision rule

Your GDC runs the t-test itself; you supply the hypotheses and the conclusion.

Decision rule

Reject H0H_0 if p<p < significance level

Not in the formula booklet - this is the rule that applies to every hypothesis test on the course, not just the t-test.

Degrees of freedom (one-sample)

ν=n−1\nu = n-1

Not in the formula booklet. The GDC works this out for you when you enter the sample size, but you should be able to state it.

Need the full syllabus wording and formula-booklet reference table? See Hypothesis Testing.

Key terms

What are the null and alternative hypotheses?

The null hypothesis H0H_0 is the claim assumed true, such as a stated mean. The alternative hypothesis H1H_1 is what the evidence is tested for, and it decides whether the test is one-tailed or two-tailed.

e.g. To test whether a mean exceeds 5050, write H0:μ=50H_0:\mu=50 and H1:μ>50H_1:\mu>50.

What is a p-value?

A p-value is the probability of obtaining a result at least as extreme as the sample, assuming H0H_0 is true. A small p-value is evidence against H0H_0.

e.g. A p-value of 0.030.03 is less than 0.050.05, so H0H_0 is rejected at the 5% level.

What is a paired t-test?

A paired test is used when each observation has a matching partner, such as before and after measurements on the same people. Find the difference for each pair, then carry out a one-sample test on those differences.

e.g. Scores 1212 and 1515 before, and 1414 and 1818 after, give differences 22 and 33, and the test is carried out on these differences.

What is a significance level?

The significance level is the probability, chosen before the test, of rejecting H0H_0 when it is actually true. Common choices are 1%, 5% and 10%.

e.g. At the 5% significance level, the cut-off for the p-value is 0.050.05.

Worked examples

1
Medium
GDC
[4 marks]

A two-tailed test gives a p-value of 0.08.

(a) State whether H0H_0 is rejected at the 5% level.

(b)(i)  If the equivalent one-tailed test were appropriate and the sample is in the predicted direction, find the one-tailed p-value.

(b)(ii)  State the conclusion at the 5% level.

Worked solution

(a) 0.08>0.050.08 > 0.05, so do not reject H0H_0. M1 A1

(b)(i) One-tailed p=0.082p = \dfrac{0.08}{2} A1

(b)(ii) Result: 0.04<0.050.04 < 0.05, so reject H0H_0. A1On the GDC. Halve the two-tailed p-value to get the one-tailed p-value The calculator shows about 0.04. The calculator steps below are for (b)(i).

TI-84 Plus CE: 2nd mode then type 0.08/2 enterCasio fx-CG50: MENU Run-Matrix then type 0.08/2 EXECasio fx-CG100: HOME Calculate then type 0.08/2 EXETI-Nspire CX: home Calculator then type 0.08/2 enterFull GDC guide: Enter a calculation on the home screen Topic page

M1 Compare A1 Do not reject A1 Halve p A1 Reject
2
Hard
GDC
[6 marks]

A sample of n=20n=20 has mean x¯=52\bar x=52 and s=6.s=6. Test, at the 5% level, whether the population mean exceeds 50.

(a)(i) State H0.H_0.

(a)(ii) State H1.H_1.

(a)(iii) Find the p-value.

(a)(iv) State the conclusion, in context.

Worked solution

(a)(i) H0:μ=50.H_0:\mu=50. A1

(a)(ii) H1:μ>50.H_1:\mu>50. A1

(a)(iii) One-sample tt-test on the graphic display calculator with x¯=52, s=6, n=20\bar x=52,\ s=6,\ n=20 against μ=50\mu=50: M1
p≈0.0762.p\approx0.0762. A1

(a)(iv) Since p=0.0762>0.05p=0.0762>0.05, R1 do not reject H0H_0: insufficient evidence the mean exceeds 50. A1On the GDC. Test H0:μ=50H_0: \mu=50 against H1:μ>50H_1: \mu \gt 50 given x¯=52\bar x=52, s=6s=6, n=20n=20, and find the p-value. The calculator shows about 0.0762. The calculator steps below are for (a)(iii).

TI-84 Plus CE: stat ▶ ▶ 2:T-Test Inpt Stats enter μ0 50 enter x̄ 52 enter Sx 6 enter n 20 enter alternative > enter Calculate enter read pCasio fx-CG50: MENU Statistics F3 F2 F1 Data Variable alternative > μ0 50 EXE x̄ 52 EXE sx 6 EXE n 20 EXE Execute F1 read pCasio fx-CG100: HOME Statistics Setup tab Hypothesis Test OK t Test 1-Sample t Test Data Variable alternative > μ0 50 OK x̄ 52 OK sx 6 OK n 20 OK Execute OK read pTI-Nspire CX: on a Calculator page menu Statistics Stat Tests t Test Data Input Method Stats OK, then μ0 50 tab x̄ 52 tab sx 6 tab n 20 tab alternative > enter read pFull GDC guide: t-test for a mean Topic page

A1 H0H_0 stated A1 H1:μ>50H_1:\mu>50 M1 T-test setup A1 P-value R1 Compare to 5% significance level A1 Conclusion in context
3
Easy
GDC
[3 marks]

A researcher tests whether favourite music genre is associated with age group.

(a) State H0.H_0.

(b) State H1.H_1.

Worked solution

(a) Standard independence hypotheses: R1
H0H_0: music genre and age group are independent. R1

(b) H1H_1: music genre and age group are not independent (associated). A1
Note. Hypotheses describe the populations, not the sample data.On the GDC. Enter the observed/contingency table and run the χ2^{2} test for the statistic, p-value and df (expected frequencies are produced too).

TI-84 Plus CE: STAT → TESTS → χ2^{2}-Test / χ2^{2}GOF-Test.
Casio fx-CG50: Statistics → TEST → CHI → 2WAY / GOF.
Casio fx-CG100: HOME → Statistics → Setup tab → Hypothesis Test → chi-squared Test.
TI-Nspire CX: menu → Statistics → Stat Tests → χ2^{2} 2-way / GOF.

R1 Recognise the independence test structure R1 H0_{0} independent A1 H1_{1} not independent

Common mistakes

  • Forgetting to state the conclusion in context. "Reject H0H_0" alone rarely earns full marks - the final answer needs to say what that means for the actual situation, e.g. "there is evidence the mean exceeds 50."
  • Using the wrong t-test for paired data. If the same individuals are measured twice (before/after), it's a paired t-test on the differences, not a two-sample test on two independent groups.
  • Mixing up one-tailed and two-tailed p-values. A two-tailed p-value must be halved before comparing it to a one-tailed significance level, and only when the sample result is in the predicted direction.

Using your GDC

Every step below is a real button sequence, not a vague "use your calculator" hint - covering the TI-84 Plus, TI-Nspire, and Casio fx-9860/fx-CG50. Pick your model to filter down to just the steps that apply to you.

Show steps for:
One-variable statistics (mean, median, standard deviation)

Needed before most t-tests - to find or confirm the sample mean and standard deviation you'll feed into the test.

  1. Enter the data into a list.
  2. STAT → Edit → type values into L1. Then STAT → CALC → 1:1-Var Stats, choose L1, Calculate.TI-84
  3. Add a Lists & Spreadsheet page, name a column and enter data; then a Calculator page → menu → Statistics → Stat Calculations → One-Variable Statistics.Nspire
  4. Statistics menu → enter data in List 1 → CALC (F2) → 1-VAR.Casio
  5. Read x¯\bar x (mean), SxS_x (sample sd) or σx\sigma_x (population sd), and the five-number summary.
  6. For frequency data, put values in one list and frequencies in another and set the frequency list.

Tip: SxS_x vs σx\sigma_x: use σx\sigma_x (population) for a complete data set, SxS_x (sample) for a sample. A t-test always uses the sample standard deviation.

Inverse normal (find the value for a given probability)

Underpins normal-based hypothesis tests and critical-value questions - converts a significance level into a critical z-value.

  1. Work out the area to the LEFT of the value you want.
  2. 2nd → VARS (DISTR) → invNorm(area, μ, σ). Newer OS lets you pick the tail.TI-84
  3. menu → Probability → Distributions → Inverse Normal; enter the area, μ and σ.Nspire
  4. Main menu → Statistics → DIST → NORM → InvN; set the tail and enter area, σ, μ.Casio

Tip: invNorm needs the area to the LEFT. For a 5% upper-tail critical value, use area = 0.95.

See the full GDC guide for more calculator models and topics.

Quick questions

When do I use a t-test instead of a z-test?

Use a t-test whenever the population standard deviation is unknown and is estimated from the sample - this is almost every t-test question you'll see on the GDC paper.

What is the decision rule for a hypothesis test?

Reject H0H_0 if the p-value is less than the stated significance level; otherwise do not reject H0H_0. See the parent topic's GDC guidance for how to run the test itself.

How do I turn a two-tailed p-value into a one-tailed p-value?

If the sample result lies in the direction given by H1H_1, halve the two-tailed p-value. A two-tailed p-value of 0.080.08 gives a one-tailed p-value of 0.040.04.

What does 'do not reject the null hypothesis' mean?

It means the sample does not give enough evidence against H0H_0, not that H0H_0 has been proved true. State it in context, such as that there is insufficient evidence that the mean has changed.

Does the population need to be normal for a t-test?

The test assumes the population is normally distributed, and IB questions state or assume this. The t-distribution is used for any sample size when the standard deviation is not known.

Ready to practise properly?

18 t-test questions, marked instantly like the real exam.