AP STATISTICS • INFERENCE FOR QUANTITATIVE DATA: MEANS

Carrying Out a Test for a Population Mean

Learn how to compute a test statistic and obtain a p-value to make evidence-based decisions about a population mean.

Historical Context & Motivation

Long before modern statistical software could spit out p-values in milliseconds, researchers grappled with a fundamental question: how can we use a small sample to make a reliable claim about an entire population? The story of hypothesis testing for a population mean is rooted in the practical challenges of early 20th-century science and industry. When William Sealy Gosset, a chemist at the Guinness brewery in Dublin, needed to draw conclusions from very small batches of barley, he realized that the standard normal distribution was inadequate for small samples. His pioneering work, published under the pseudonym "Student" in 1908, introduced the t-distribution, which accounts for the extra variability introduced when the population standard deviation is estimated from the sample. This insight became one of the cornerstones of modern inferential statistics.

1908
Student's t-Distribution
William Sealy Gosset publishes "The Probable Error of a Mean" under the pseudonym "Student," introducing the t-distribution for small-sample inference.
1925
Fisher's Framework
Ronald Fisher formalizes the concepts of null hypotheses, significance levels, and p-values in Statistical Methods for Research Workers, establishing the intellectual backbone of hypothesis testing.
1933
Neyman–Pearson Theory
Jerzy Neyman and Egon Pearson introduce the concepts of Type I error, Type II error, and statistical power, giving hypothesis testing a rigorous decision-theoretic framework.
1970s–present
Computational Revolution
The advent of statistical software and graphing calculators makes it possible for students and researchers to compute exact p-values from the t-distribution, replacing cumbersome table lookups.

Today, the one-sample t-test is the workhorse procedure for testing a claim about a single population mean when the population standard deviation σ is unknown—which is nearly always the case in practice. In the AP Statistics curriculum, this topic sits at the intersection of sampling distributions, probability, and formal inference, requiring you to synthesize everything you have learned about the Central Limit Theorem, standard error, and the logic of significance testing. The central question this lesson addresses is: once you have stated hypotheses and checked conditions, how do you actually calculate the test statistic, find the p-value, and reach a conclusion?

Core Principles & Definitions

Before diving into calculations, it is essential to anchor ourselves in the foundational ideas that make the one-sample t-test logically coherent. Every step in the testing procedure flows from a small set of core principles: the structure of the hypotheses, the role of the test statistic, the meaning of the p-value, and the decision rule that ties everything together. These ideas are not merely procedural—they reflect a deep philosophical commitment to letting data, rather than intuition, drive conclusions.

1

Null & Alternative Hypotheses

The null hypothesis (H₀) states that the population mean μ equals a claimed value μ₀. The alternative hypothesis (Hₐ) asserts μ differs from μ₀ in a specified direction (or in either direction for a two-sided test).
2

Test Statistic (t)

The test statistic standardizes the distance between the sample mean x̄ and the hypothesized value μ₀, measured in units of the estimated standard error. It follows a t-distribution with n − 1 degrees of freedom.
3

P-Value

The p-value is the probability of obtaining a test statistic at least as extreme as the observed value, assuming H₀ is true. It quantifies the strength of evidence against H₀.
4

Significance Level (α)

The significance level α (commonly 0.05) is the threshold below which the p-value leads us to reject H₀. It represents the maximum tolerable probability of a Type I error.
5

Conclusion in Context

A proper conclusion states whether there is or is not convincing evidence for Hₐ, always phrased in the real-world context of the problem. We never "accept" H₀; we only fail to reject it.
KEY TAKEAWAY
Think of the t-test like a courtroom trial. The null hypothesis is the presumption of innocence—the status quo stands unless the evidence is compelling enough to overturn it. The test statistic measures how "surprising" your sample is under that presumption, and the p-value translates that surprise into a probability. Just as a jury needs proof beyond a reasonable doubt (the significance level α) to convict, you need a sufficiently small p-value to reject H₀. And just as an acquittal does not prove innocence, failing to reject H₀ does not prove it true.

Visual Explanation: Anatomy of a One-Sample t-Test

The diagram below illustrates the complete flow of carrying out a one-sample t-test. It traces the journey from raw data to a final conclusion, emphasizing the role of each computed quantity at every stage. Study the arrows carefully: the test statistic bridges the gap between the data and the t-distribution, while the p-value bridges the gap between the t-distribution and your decision.

The flowchart (top) shows the four-stage pipeline: compute the test statistic from your sample data, locate it on the t-distribution, find the p-value as the shaded tail area, and compare to the significance level α. The t-distribution curve (center) illustrates a right-tailed test where the observed t-statistic falls in the upper tail, with the p-value shown as the shaded region to the right of t-obs.

Notice that the t-distribution curve is symmetric about zero and resembles a standard normal curve but has heavier tails. The heavier tails reflect the additional uncertainty from estimating σ with the sample standard deviation s. As the sample size n increases and the degrees of freedom grow, the t-distribution approaches the standard normal distribution. For a right-tailed test (Hₐ: μ > μ₀), the p-value is the area to the right of the observed t; for a left-tailed test (Hₐ: μ < μ₀), it is the area to the left; and for a two-tailed test (Hₐ: μ ≠ μ₀), it is the combined area in both tails beyond ±|t|.

Mathematical Framework

The mathematical machinery behind the one-sample t-test is elegant in its simplicity. The test statistic measures how many estimated standard errors the sample mean falls from the hypothesized value, and the t-distribution with n − 1 degrees of freedom provides the reference distribution under the null hypothesis. Below are the key formulas you need to internalize.

ONE-SAMPLE t-TEST STATISTIC
t = (x̄ − μ₀) / (s / √n)
where = sample mean, μ₀ = hypothesized population mean (from H₀), s = sample standard deviation, and n = sample size. The quantity s / √n is the standard error of x̄.
DEGREES OF FREEDOM
df = n − 1
The degrees of freedom determine the exact shape of the t-distribution. Fewer degrees of freedom produce heavier tails (more spread), reflecting greater uncertainty in the estimate of σ.
P-VALUE COMPUTATION
p-value = P(T ≥ |t|) or P(T ≤ t) or 2 × P(T ≥ |t|)
The form depends on the direction of Hₐ. For a right-tailed test: P(T ≥ t). For a left-tailed test: P(T ≤ t). For a two-tailed test: 2 × P(T ≥ |t|). Here T follows a t-distribution with df = n − 1.
🧮 Calculator Tip
On the TI-83/84, use T-Test under STAT → TESTS. Enter μ₀, x̄, s, n, and the direction of Hₐ. The calculator will output both the t-statistic and the p-value directly. Alternatively, after computing t by hand, use tcdf(lower, upper, df) to find tail areas. For a right-tailed test, the command is tcdf(t, 1E99, df).

The decision rule is straightforward: if the p-value is less than or equal to the chosen significance level α, you reject H₀ and conclude that there is convincing statistical evidence in favor of Hₐ at the α level. If the p-value exceeds α, you fail to reject H₀ and conclude that the sample does not provide convincing evidence against the null hypothesis. It is critically important that your conclusion is stated in the context of the problem—AP readers will deduct points for generic statistical conclusions that do not reference the specific variable and population under study.

One-Tailed vs. Two-Tailed Tests: A Detailed Breakdown

A frequent source of confusion is the distinction between one-tailed and two-tailed tests, which affects both the form of the alternative hypothesis and how the p-value is calculated. The choice of directionality must be determined before looking at the data and should be driven by the research question, not by what would produce a more significant result. The visual below compares all three scenarios side by side.

Three t-distribution curves illustrate the shaded region corresponding to the p-value in each scenario. In the left-tailed case, the p-value is the left tail area; in the right-tailed case, the right tail area; and in the two-tailed case, both tails combined. The reference table below the curves summarizes the hypothesis structure, p-value formula, and rejection condition for each type.

A subtle but important point: for a two-tailed test, the p-value is exactly double the one-tail area beyond |t|. This is because the two-tailed alternative considers departures in either direction to be evidence against H₀. Consequently, a two-tailed test is always less powerful than a one-tailed test (for the same α and effect size), because the rejection region is split across both tails. When you are unsure about the direction of the effect or when the research question genuinely asks whether the mean differs from μ₀ without specifying a direction, a two-tailed test is appropriate.

Worked Example

A nutritionist claims that the mean daily sodium intake for adults in a particular city is more than 2300 mg. A random sample of 36 adults yields a sample mean of x̄ = 2450 mg with a sample standard deviation of s = 420 mg. Carry out a significance test at the α = 0.05 level.

One-Sample t-Test: Sodium Intake
1
Step 1 — State HypothesesWe are testing whether the mean sodium intake μ exceeds 2300 mg. The null and alternative hypotheses are: H₀: μ = 2300 mg and Hₐ: μ > 2300 mg. This is a right-tailed test.
2
Step 2 — Check Conditions (briefly)Random: the problem states a random sample. Independence: n = 36 is likely less than 10% of all adults in the city. Normal/Large Sample: n = 36 ≥ 30, so by the Central Limit Theorem, the sampling distribution of x̄ is approximately normal. All conditions are satisfied.
3
Step 3 — Compute the Test StatisticThe standard error is SE = s / √n = 420 / √36 = 420 / 6 = 70. The t-statistic is t = (x̄ − μ₀) / SE = (2450 − 2300) / 70 = 150 / 70 ≈ 2.143. The degrees of freedom are df = n − 1 = 35.
t = 2.143 with df = 35
4
Step 4 — Find the P-ValueBecause this is a right-tailed test, the p-value = P(T ≥ 2.143) where T follows a t-distribution with 35 degrees of freedom. Using a calculator: tcdf(2.143, 1E99, 35) ≈ 0.0196.
p-value ≈ 0.0196
5
Step 5 — Make a Decision and State Conclusion in ContextSince the p-value (≈ 0.0196) is less than α = 0.05, we reject H₀. There is convincing statistical evidence at the α = 0.05 significance level that the mean daily sodium intake for adults in this city is greater than 2300 mg.
Reject H₀. Convincing evidence that μ > 2300 mg.
📝 AP Exam Scoring Note
On the AP exam, the free-response rubric typically awards separate points for: (1) stating hypotheses with correct notation, (2) naming the correct test procedure and checking conditions, (3) computing the test statistic, (4) reporting the p-value, and (5) making a conclusion in context with a linkage to the p-value and α. Never skip the context—a bare "reject H₀" without referencing sodium intake and adults in the city will not earn full credit.

Common Pitfalls & Best Practices

Even students who understand the mechanics of the t-test can lose points on the AP exam through avoidable errors. The table below contrasts common mistakes with the correct approach. Reviewing these pitfalls will sharpen both your conceptual understanding and your exam performance.

Common pitfalls when carrying out a t-test and how to avoid them
Common PitfallWhy It's WrongBest Practice
Writing "Accept H₀"We never "accept" the null hypothesis; the test can only fail to find evidence against it. Absence of evidence is not evidence of absence.Write "We fail to reject H₀" or "We do not have convincing evidence that…"
Omitting context in the conclusionA conclusion must reference the specific parameter, variable, and population. Generic statements lose credit on AP rubrics."There is convincing evidence that the mean [variable] of [population] is [direction] [value]."
Using z instead of t when σ is unknownWhen the population standard deviation σ is unknown (almost always), the z-test is inappropriate. Using s as a plug-in for σ requires the t-distribution.Default to the t-test. Only use z when σ is explicitly given, which is extremely rare in practice.
Choosing the tail direction after seeing the dataSelecting a one-tailed test based on observed data inflates the Type I error rate. The alternative hypothesis must be specified before data collection.Base the direction of Hₐ on the research question or claim being investigated, not on the sample results.
Confusing statistical and practical significanceA small p-value indicates the effect is unlikely due to chance, but it does not mean the effect is large or meaningful in a real-world sense.After rejecting H₀, consider the effect size (how far x̄ is from μ₀) to assess practical importance.
KEY TAKEAWAY
Think of the p-value as a measure of surprise, not a measure of truth. A p-value of 0.02 tells you that if the null hypothesis were true, there is only about a 2% chance of seeing data this extreme or more so. It does not tell you the probability that H₀ is true, nor does it tell you how large the real effect is. A statistically significant result with a trivially small effect size may be scientifically meaningless, while a non-significant result from an underpowered study may miss a genuinely important effect. Always pair your p-value with contextual reasoning.

Connection to Advanced Theory

The one-sample t-test for a population mean is a gateway to a family of more sophisticated inference procedures. Understanding how it relates to its extensions will deepen your appreciation for the underlying logic and prepare you for more advanced coursework in statistics.

How the one-sample t-test connects to more advanced procedures
FeatureOne-Sample t-Test (This Lesson)Advanced Extensions
Number of groupsOne sample compared to a hypothesized value μ₀Two-sample t-test compares means of two groups; ANOVA compares three or more
Paired dataCan be applied to differences in paired data (treated as a single sample of differences)Matched pairs t-test is structurally identical; uses d̄ and s_d instead of x̄ and s
Normality assumptionRequires approximately normal population or n ≥ 30 (CLT)Nonparametric alternatives (Wilcoxon signed-rank) relax normality; bootstrap methods provide distribution-free inference
Effect size reportingNot formally part of the AP curriculum but valuable for interpretationCohen's d = (x̄ − μ₀)/s is commonly reported alongside p-values in research publications
Confidence interval dualityRejecting H₀ at level α is equivalent to μ₀ not falling in the (1 − α) confidence intervalThis duality extends to all parametric tests and is the basis for inverting test statistics to create CIs

One particularly elegant connection worth noting is the duality between hypothesis tests and confidence intervals. If you construct a (1 − α) × 100% confidence interval for μ and the hypothesized value μ₀ falls outside that interval, you would reject H₀ at the α significance level in a two-tailed test—and vice versa. This means that every confidence interval implicitly encodes the results of infinitely many hypothesis tests (one for each possible value of μ₀), which is why many statisticians advocate reporting confidence intervals alongside p-values for richer inference.

Practice Problems

1
A researcher performs a one-sample t-test and obtains a p-value of 0.03. Which of the following is the correct interpretation of this p-value?
2
A random sample of 25 light bulbs has a mean lifetime of x̄ = 1040 hours with s = 120 hours. A manufacturer claims the mean lifetime is 1000 hours. What is the value of the t-test statistic for testing H₀: μ = 1000 vs. Hₐ: μ ≠ 1000?
3
A school administrator claims that the mean commute time for students is less than 30 minutes. A random sample of 20 students has x̄ = 27.5 minutes and s = 6.2 minutes. The test statistic is t = −1.804 with df = 19. Using α = 0.05, which conclusion is most appropriate?
PROBLEM 4APPLIED
An environmental scientist measures the dissolved oxygen (DO) concentration in a lake. Healthy lakes have a mean DO of at least 6.0 mg/L. She collects a random sample of 15 water specimens and obtains x̄ = 5.6 mg/L and s = 0.9 mg/L. She wants to test whether the lake's mean DO is less than 6.0 mg/L at the α = 0.05 significance level. (a) State the appropriate null and alternative hypotheses. (b) Calculate the test statistic. Show your work. (c) Find the p-value (use a calculator or t-table) and explain what it means in context. (d) Make a conclusion in the context of the problem. (e) Suppose the scientist later learns that the true mean DO is 5.4 mg/L. What type of error, if any, did she make?
PROBLEM 5CRITICAL THINKING
Two students carry out a t-test on the same data set. Student A uses a two-tailed test (Hₐ: μ ≠ 50) and obtains a p-value of 0.07. Student B uses a one-tailed test (Hₐ: μ > 50) and obtains a p-value of 0.035. (a) Explain the mathematical relationship between these two p-values. (b) At α = 0.05, Student A fails to reject H₀ while Student B rejects H₀. Is this a contradiction? Explain. (c) Under what circumstances would it be appropriate for a researcher to use Student B's one-tailed test rather than Student A's two-tailed test? (d) A classmate suggests that a researcher could always get a smaller p-value by choosing a one-tailed test after looking at the data. Explain why this practice is problematic.

Summary

Carrying out a test for a population mean involves computing a t-test statistic using the formula t = (x̄ − μ₀) / (s / √n), where the denominator is the standard error of the sample mean. This statistic follows a t-distribution with df = n − 1 under the null hypothesis. The p-value is the tail area (or areas, for a two-tailed test) beyond the observed t, representing the probability of seeing results at least as extreme as yours if H₀ is true.

Compare the p-value to the pre-set significance level α: if p ≤ α, reject H₀ and conclude there is convincing evidence for Hₐ; if p > α, fail to reject H₀. Always state your conclusion in the context of the problem, referencing the specific parameter, variable, and population. Remember: never say "accept H₀," never choose the tail direction after seeing data, and always distinguish statistical significance from practical significance.

Varsity Tutors • AP Statistics • Carrying Out a Test for a Population Mean