Scribe logoScribeNotes & practice
Sign inStart free
  1. Notes
  2. ›AP Statistics
  3. ›4 Inference for Quantitative Data: Means
  4. ›4.4 Setting up a test for a mean or mean difference

AP Statistics · Unit 4 · Inference for Quantitative Data: Means

4.4 Setting up a test for a mean or mean difference

State null and alternative hypotheses for a mean, check the conditions for a t test, and choose and calculate the correct test statistic.

  • 5 min read
  • 5 parts
  • 10 questions
  • Draft
Start a Quick 5 on this topic→Jump to the 10 questions
1/5A hypothesis test starts with two competing claims about the mean
  1. 1A hypothesis test starts with two competing claims about the mean
  2. 2The wording of the question sets the direction of the alternative
  3. 3A test for a mean uses the same three conditions as an interval
  4. 4The t statistic counts standard errors from the claimed mean
  5. 5A complete setup names the parameter, hypotheses, conditions, and statistic
  6. Check your recall
  7. Practice: 10 questions
1

Part 1 of 5: A hypothesis test starts with two competing claims about the mean

A café says customers wait 5 minutes on average. You suspect the wait is longer. A hypothesis test uses sample data to judge a claim like this.

The null hypothesis, H0H_0H0​, is the claim assumed true at the start. For one mean it says μ=μ0\mu=\mu_0μ=μ0​, where μ0\mu_0μ0​ is the claimed value.

The alternative hypothesis, HaH_aHa​, is what the data might support instead. It says the mean is greater than, less than, or different from μ0\mu_0μ0​.

Common mistake

Hypotheses describe the population mean μ\muμ. Never write xˉ\bar{x}xˉ in them, because a sample mean is known, not claimed.

Key terms · tap one for its definition

null hypothesis

The null hypothesis is the claim about a parameter, written H0H_0H0​, that is assumed true when a test begins.

alternative hypothesis

The alternative hypothesis is the competing claim about a parameter, written HaH_aHa​, that the sample data may support.

Part 1 done

2

Part 2 of 5: The wording of the question sets the direction of the alternative

Next, decide which form of HaH_aHa​ fits the situation. Read the research question, not the data.

Question wording and the matching alternative hypothesis

Question wordingAlternativeName
Is the mean greater than the claim?Ha:μ>μ0H_a:\mu>\mu_0Ha​:μ>μ0​one-sided
Is the mean less than the claim?Ha:μ<μ0H_a:\mu<\mu_0Ha​:μ<μ0​one-sided
Is the mean different from the claim?Ha:μ≠μ0H_a:\mu\ne\mu_0Ha​:μ=μ0​two-sided
Question wording
Is the mean greater than the claim?
Alternative
Ha:μ>μ0H_a:\mu>\mu_0Ha​:μ>μ0​
Name
one-sided
Question wording
Is the mean less than the claim?
Alternative
Ha:μ<μ0H_a:\mu<\mu_0Ha​:μ<μ0​
Name
one-sided
Question wording
Is the mean different from the claim?
Alternative
Ha:μ≠μ0H_a:\mu\ne\mu_0Ha​:μ=μ0​
Name
two-sided

A one-sided alternative looks for a change in one direction only. A two-sided alternative allows a change in either direction.

Choose the form before looking at the data, because the data should not decide the question. Define μ\muμ in words, such as the true mean wait time of all customers. A two-sided alternative is the safe choice when the question names no direction.

Exam tip

For the café, write H0:μ=5H_0:\mu=5H0​:μ=5 and Ha:μ>5H_a:\mu>5Ha​:μ>5, with μ\muμ the true mean wait time in minutes for all customers.

Key terms · tap one for its definition

one-sided alternative

A one-sided alternative is a hypothesis stating that the mean is only greater than, or only less than, the null value.

two-sided alternative

A two-sided alternative is a hypothesis stating that the mean differs from the null value, in either direction.

Part 2 done

Quick check

One question on the part you just read

Easy

Identify the form of a null hypothesis for a population mean, where μ0\mu_0μ0​ is the claimed value.
Show answer and explanation

Answer: C · Worked explanation

The null hypothesis states that the population mean equals the claimed value, μ=μ0\mu=\mu_0μ=μ0​. Writing xˉ\bar{x}xˉ is wrong because hypotheses describe parameters, not statistics. The forms μ>μ0\mu>\mu_0μ>μ0​ and μ≠μ0\mu\ne\mu_0μ=μ0​ are alternatives, not null hypotheses, because the null always uses equality, never a direction.
3

Part 3 of 5: A test for a mean uses the same three conditions as an interval

Before computing anything, check that the model fits. The conditions match those used for an interval.

  • Random: the data come from a random sample or a randomized experiment.
  • Independent: sampling without replacement uses at most 10% of the population, so n≤0.10Nn\le0.10Nn≤0.10N, where NNN is the population size.
  • Normal: the population is Normal, n≥30n\ge30n≥30, or the sample data show no strong skew or outliers.

For paired data, find one difference per pair, then test the mean of the differences. The null hypothesis is usually μdiff=0\mu_{\mathrm{diff}}=0μdiff​=0, where μdiff\mu_{\mathrm{diff}}μdiff​ is the population mean difference.

Exam tip

Check conditions with the actual numbers. For n<30n<30n<30, describe the sample graph and name any skew or outliers.

Part 3 done

4

Part 4 of 5: The t statistic counts standard errors from the claimed mean

With the conditions checked, measure how far the sample result sits from the claim. A raw difference such as 1.8 hours is hard to judge by itself. A test statistic converts that distance into standard errors.

When σ\sigmaσ is unknown, which is almost always, use t=xˉ−μ0s/nt=\frac{\bar{x}-\mu_0}{s/\sqrt{n}}t=s/n​xˉ−μ0​​. The denominator is the standard error, the estimated standard deviation of xˉ\bar{x}xˉ.

The statistic follows a t-distribution, a bell-shaped model with heavier tails than the Normal model. Its degrees of freedom are df=n−1df=n-1df=n−1. A z statistic is only for the rare case where σ\sigmaσ is known. The sign of ttt shows the direction: it is negative when xˉ\bar{x}xˉ falls below μ0\mu_0μ0​.

Key terms · tap one for its definition

test statistic

A test statistic is a value calculated from sample data that measures how far the data fall from the null hypothesis, in standard errors.

t-distribution

A t-distribution is a symmetric, bell-shaped distribution with heavier tails than the Normal model, determined by its degrees of freedom.

degrees of freedom

The degrees of freedom for a one-sample t procedure are df=n−1df=n-1df=n−1, which set the shape of the t-distribution.

Part 4 done

Quick check

One question on the part you just read

Easy

A manager wants to test whether the mean time to resolve a support ticket is less than 12 minutes. Identify the alternative hypothesis, where μ\muμ is the true mean resolution time.
Show answer and explanation

Answer: C · Worked explanation

The question asks whether the mean is less than 12, so the alternative is one-sided: μ<12\mu<12μ<12. The direction μ>12\mu>12μ>12 reverses the question. The form μ≠12\mu\ne12μ=12 is two-sided and ignores the stated direction. Using xˉ\bar{x}xˉ is wrong because the hypothesis concerns the population mean.
5

Part 5 of 5: A complete setup names the parameter, hypotheses, conditions, and statistic

Now combine the pieces into one setup. Also choose a significance level, α\alphaα, before seeing any data, so the result cannot influence your standard. A common choice is α=0.05\alpha=0.05α=0.05. A complete setup has four parts.

  • Parameter: define μ\muμ in words and context.
  • Hypotheses: write H0H_0H0​ and HaH_aHa​ in symbols.
  • Conditions: verify each one with numbers from the problem.
  • Statistic: state ttt and its degrees of freedom.

Worked example

Set up a test for a mean

A company claims its batteries last 40 hours on average. A random sample of 25 batteries from a very large production run has xˉ=38.2\bar{x}=38.2xˉ=38.2 hours and s=3.4s=3.4s=3.4 hours. The sample dotplot shows no strong skew or outliers. Set up a test of the claim.
  1. 1
    Parameter: let μ\muμ be the true mean battery life, in hours, of all the company’s batteries.
  2. 2
    Hypotheses: H0:μ=40H_0:\mu=40H0​:μ=40 and Ha:μ≠40H_a:\mu\ne40Ha​:μ=40.
  3. 3
    Conditions: the sample is random, 25 is under 10% of a very large run, and the data show no strong skew or outliers.
  4. 4
    Statistic: t=xˉ−μ0s/n=38.2−403.4/25t=\frac{\bar{x}-\mu_0}{s/\sqrt{n}}=\frac{38.2-40}{3.4/\sqrt{25}}t=s/n​xˉ−μ0​​=3.4/25​38.2−40​.
  5. 5
    Calculate: −1.80.68≈−2.65\frac{-1.8}{0.68}\approx-2.650.68−1.8​≈−2.65, with df=25−1=24df=25-1=24df=25−1=24.

Answer: H0:μ=40H_0:\mu=40H0​:μ=40, Ha:μ≠40H_a:\mu\ne40Ha​:μ=40, and t≈−2.65t\approx-2.65t≈−2.65 with 24 degrees of freedom.

This statistic is the starting point for judging how unusual the sample is. A value far from 0 suggests the sample mean is far from the claim, measured in standard errors.

Key term

significance level

The significance level α\alphaα is the cutoff, chosen before seeing the data, for how unlikely results must be under H0H_0H0​ to reject it.

Note read

Check your recall[13 marks]

5 written questions. Answer each one in your head or on paper, then open the mark scheme.

  1. 1.Identify[3 marks]

    A café claims its mean wait time is 5 minutes. A customer believes it is longer. Identify appropriate hypotheses, defining the parameter.

    Show mark schemeHide mark scheme

    Model answer

    Let μ\muμ be the true mean wait time, in minutes, for all customers. H0:μ=5H_0:\mu=5H0​:μ=5 and Ha:μ>5H_a:\mu>5Ha​:μ>5.

    • 1 mark for defining μ\muμ as the true mean wait time of all customers
    • 1 mark for writing H0:μ=5H_0:\mu=5H0​:μ=5
    • 1 mark for writing Ha:μ>5H_a:\mu>5Ha​:μ>5
  2. 2.Identify[3 marks]

    Identify the three conditions to check before a one-sample t test for a mean.

    Show mark schemeHide mark scheme

    Model answer

    The data must come from a random sample or randomized experiment. The sample must be at most 10% of the population when sampling without replacement. The population must be Normal, n≥30n\ge30n≥30, or the sample data must show no strong skew or outliers.

    • 1 mark for identifying the random condition
    • 1 mark for identifying the 10% condition
    • 1 mark for identifying the Normal condition
  3. 3.Calculate[3 marks]

    Calculate the test statistic for H0:μ=40H_0:\mu=40H0​:μ=40 when xˉ=38.2\bar{x}=38.2xˉ=38.2, s=3.4s=3.4s=3.4, and n=25n=25n=25.

    Show mark schemeHide mark scheme

    Model answer

    t=xˉ−μ0s/n=38.2−403.4/25=−1.80.68≈−2.65t=\frac{\bar{x}-\mu_0}{s/\sqrt{n}}=\frac{38.2-40}{3.4/\sqrt{25}}=\frac{-1.8}{0.68}\approx-2.65t=s/n​xˉ−μ0​​=3.4/25​38.2−40​=0.68−1.8​≈−2.65.

    • 1 mark for using t=xˉ−μ0s/nt=\frac{\bar{x}-\mu_0}{s/\sqrt{n}}t=s/n​xˉ−μ0​​
    • 1 mark for finding a standard error of 0.68
    • 1 mark for obtaining t≈−2.65t\approx-2.65t≈−2.65
  4. 4.Determine[2 marks]

    Determine the degrees of freedom for a test with n=25n=25n=25, and give one reason a t-distribution is used rather than the Normal model.

    Show mark schemeHide mark scheme

    Model answer

    df=25−1=24df=25-1=24df=25−1=24. A t-distribution is used because σ\sigmaσ is unknown and is estimated by sss.

    • 1 mark for giving df=24df=24df=24
    • 1 mark for stating that σ\sigmaσ is unknown and estimated by sss
  5. 5.Explain[2 marks]

    Explain why hypotheses are written about μ\muμ rather than xˉ\bar{x}xˉ.

    Show mark schemeHide mark scheme

    Model answer

    Hypotheses are claims about a population parameter. The sample mean xˉ\bar{x}xˉ is already known from the data, so there is nothing to claim or test about it.

    • 1 mark for stating that hypotheses are about a population parameter
    • 1 mark for explaining that xˉ\bar{x}xˉ is known from the sample

Practice this topic

10 quick-fire multiple-choice questions, easy to hard. Tap an answer to see if you're right and the worked explanation. (The written questions with mark schemes are under “Check your recall” above.)

0 right0 of 10 answered

Includes the 2 quick checks in the note above.

3.

Easy·Identify[1 mark]

Identify the test statistic for a mean when σ\sigmaσ is unknown.
Show answer and explanation

Answer: A · Worked explanation

The statistic divides the gap between xˉ\bar{x}xˉ and μ0\mu_0μ0​ by the standard error, sn\frac{s}{\sqrt{n}}n​s​. Dividing by sss alone treats one observation’s spread as the spread of xˉ\bar{x}xˉ. That ignores the averaging effect of the sample size, and dividing by sns\sqrt{n}sn​ over-corrects for it.
4.

Medium·Calculate[1 mark]

A bottler claims mean fill is 500 mL. A random sample of 16 bottles has xˉ=496\bar{x}=496xˉ=496 mL and s=8s=8s=8 mL. Calculate the test statistic for H0:μ=500H_0:\mu=500H0​:μ=500.
Show answer and explanation

Answer: C · Worked explanation

The standard error is 816=2\frac{8}{\sqrt{16}}=216​8​=2, so t=496−5002=−2.0t=\frac{496-500}{2}=-2.0t=2496−500​=−2.0. A positive value ignores that xˉ\bar{x}xˉ is below the claim. The value -0.50 divides by sss instead of the standard error. The value -8.0 divides by sn\frac{s}{n}ns​, which makes the denominator far too small.
5.

Medium·Determine[1 mark]

Twelve randomly chosen students each take a test before and after a workshop, and the 12 differences are analyzed. Determine the degrees of freedom.
Show answer and explanation

Answer: A · Worked explanation

Paired data reduce to one sample of 12 differences, so df=n−1=12−1=11df=n-1=12-1=11df=n−1=12−1=11. The values 22 and 23 treat the scores as two separate samples of 12, which ignores the pairing entirely. The value 12 forgets to subtract one.
6.

Medium·Identify[1 mark]

Fifteen students take a test before and after a tutoring program. Researchers test whether scores improved, using differences (after minus before). Identify the appropriate null hypothesis.
Show answer and explanation

Answer: D · Worked explanation

The null states no change on average, with the parameter μdiff\mu_{\mathrm{diff}}μdiff​ equal to 0. The sample mean difference is observed, so it cannot be hypothesized. The form μdiff>0\mu_{\mathrm{diff}}>0μdiff​>0 is the alternative for this research question. The number of students is a sample size, not a claimed mean.
7.

Medium·Identify[1 mark]

Identify the situation in which the Normal condition is met for a one-sample t test.
Show answer and explanation

Answer: D · Worked explanation

With n=45n=45n=45, which is at least 30, the Normal condition is met even when the sample is somewhat skewed. The other situations have small samples that show strong skew or outliers, so the Normal condition fails. Mild skew alone does not break the condition when nnn is large.
8.

Hard·Identify[2 marks]

A principal randomly selects 30 of the 250 students in a school, without replacement, and plans a t test for the mean. Identify the condition that is not met.
Show answer and explanation

Answer: B · Worked explanation

Ten percent of 250 is 25, and 30 exceeds it, so the 10% condition fails. Random selection can be done without replacement. With n=30n=30n=30 the Normal condition is met by the sample size, even for an unknown shape, and it does not replace the 10% condition.
9.

Hard·Identify[2 marks]

A student writes H0:xˉ=40H_0:\bar{x}=40H0​:xˉ=40 for a claim about mean battery life. Identify the error.
Show answer and explanation

Answer: D · Worked explanation

A hypothesis is a claim about a population parameter, so the correct null is μ=40\mu=40μ=40. The sample mean is known from the data, so it cannot be claimed. The null hypothesis states equality, not inequality. Replacing 40 with sss would change the claim itself.
10.

Hard·Calculate[2 marks]

A random sample of n=36n=36n=36 has xˉ=12.6\bar{x}=12.6xˉ=12.6 and s2=2.25s^2=2.25s2=2.25, where sss is the sample standard deviation. Calculate the test statistic for H0:μ=12.0H_0:\mu=12.0H0​:μ=12.0.
Show answer and explanation

Answer: D · Worked explanation

First, s=2.25=1.5s=\sqrt{2.25}=1.5s=2.25​=1.5. The standard error is 1.536=0.25\frac{1.5}{\sqrt{36}}=0.2536​1.5​=0.25, so t=12.6−12.00.25=+2.4t=\frac{12.6-12.0}{0.25}=+2.4t=0.2512.6−12.0​=+2.4. The value +1.6+1.6+1.6 uses s2s^2s2 in place of sss in the standard error, which shrinks the statistic. The value +0.4+0.4+0.4 divides by sss alone, and +14.4+14.4+14.4 divides by sn\frac{s}{n}ns​.

Keep going

Next topic4.5 Carrying out a test for a mean or mean differencePrevious topic4.3 Claims from a mean interval

More in Unit 4 · Inference for Quantitative Data: Means

  1. 4.1Sample meansNotes · 10 questions
  2. 4.2Interval for a mean or mean differenceNotes · 10 questions
  3. 4.3Claims from a mean intervalNotes · 10 questions
  4. 4.4Setting up a test for a mean or mean differenceNotes · 10 questions
  5. 4.5Carrying out a test for a mean or mean differenceNotes · 10 questions
  6. 4.6Differences in sample meansNotes · 10 questions
  7. 4.7Interval for a difference of two meansNotes · 10 questions
  8. 4.8Claims about a difference of meansNotes · 10 questions
  9. 4.9Setting up a two-mean testNotes · 10 questions

All AP Statistics topics →

Draft: written by Scribe and checked automatically, not yet by a subject reviewer.

Practice questions are original, written by Scribe and checked automatically for correctness.

Topic codes follow the official numbering. Not endorsed by College Board or any exam board.

On this page

0/5 read

  1. 1A hypothesis test starts with two competing claims about the mean
  2. 2The wording of the question sets the direction of the alternative
  3. 3A test for a mean uses the same three conditions as an interval
  4. 4The t statistic counts standard errors from the claimed mean
  5. 5A complete setup names the parameter, hypotheses, conditions, and statistic
  6. Check your recall
  7. Practice: 10 questions
All coursesScribeHow it worksPricingPrivacyTerms

Notes and questions are written by Scribe in our own words. Topic codes follow the official course numbering so you can find your place. Not produced or endorsed by the IB, College Board, AQA, OCR, Pearson Edexcel or any exam board.

© 2026 Scribe