One-sample t-test, step by step
By Jude Wallis · Updated
A one-sample t-test has four steps. State hypotheses about the population mean $\mu$, check the random, 10%, and sample data conditions, compute $t = (\bar{x} - \mu_0)/(s/\sqrt{n})$ with $df = n - 1$, then turn $t$ into a p-value and write a conclusion in context.
AP Statistics: Unit 4 (topics 4.4 Setting Up a Test for a Population Mean or Population Mean Difference, 4.5 Carrying Out a Test for a Population Mean or Population Mean Difference). The one-sample t-test sits in Unit 4 of the Fall 2026 AP Statistics course, where topic 4.4 covers the hypotheses and the three conditions and topic 4.5 gives the statistic with degrees of freedom n - 1.
The four steps, in order
A one-sample t-test asks one question: is the population mean different from some claimed value? Four steps answer it, and every graded response follows the same order.
- State the parameter and the hypotheses about (mu, the population mean).
- Check three conditions: random, 10%, and sample data.
- Compute the test statistic with .
- Conclude by comparing the p-value to (alpha, the significance level) and answering in the context of the problem.
One example runs through all four steps. A seed supplier states that each packet holds a mean of 50 seeds. A gardener opens a random sample of packets from a shipment of several thousand and counts seeds (x-bar, the sample mean) with sample standard deviation seeds. A dotplot of the 25 counts shows no strong skewness and no outliers. Does the true mean differ from 50 seeds?
By the end you will have , , , and , and you will fail to reject the supplier's claim at .
Step 1: state the parameter and the hypotheses about mu
Define the parameter in words before you write symbols: let be the true mean number of seeds per packet in the shipment. Naming the population out loud stops you from writing hypotheses about the sample, the most common way this step goes wrong.
The null hypothesis always sets equal to the claimed value, written (mu-nought, the hypothesized mean). The alternative says what you suspect instead:
This alternative is two-sided because the question asks whether the mean differs from 50, with no direction named in advance. Had the gardener suspected short-filled packets beforehand, the alternative would be and the p-value would use one tail.
Hypotheses are statements about parameters, never about statistics. Writing is wrong, because is a number you already measured and there is nothing left to test about it.
Step 2: check the three conditions
The t procedure needs three conditions, and you get credit only when you tie each one to the numbers in the problem rather than reciting the list.
Random. The data must come from a random sample or a randomized experiment. Here the 25 packets were randomly selected from the shipment, so this is met. Without randomness the sampling distribution of is not centered where the theory assumes, and no later arithmetic repairs that.
10%. When you sample without replacement, the population must be at least 10 times the sample size, so removing one packet barely changes the chances for the next. The shipment holds several thousand packets and , so this is met.
Sample data. Either the population is stated to be approximately normal, or , or, for , the sample data show no strong skewness and no outliers. Here is below 30, so you lean on the third route: the dotplot of the 25 counts shows no strong skewness and no outliers, so the t procedure is reasonable.
That third condition is where the reasoning lives. The t procedure assumes the sampling distribution of is close to normal. A large sample delivers that through the central limit theorem whatever the population looks like; a small sample does not, so you inspect the data instead.
Step 3: compute the t statistic and the degrees of freedom
The test statistic measures how many standard errors the sample mean sits from the hypothesized mean:
Build the standard error first, since that denominator is where most slips happen:
Then the numerator is the plain distance between the two means, seeds, and the statistic is that distance measured in standard errors:
The degrees of freedom are . You subtract 1 because was computed using , which pins down one of the 25 deviations once you know the other 24. That is the same from the formula for , explained in why you divide by n - 1 and what degrees of freedom are.
Read the statistic in words before moving on. A value of says the sample mean of 52.3 seeds sits about 1.9 standard errors above the claimed 50: noticeably high, but not startling.
Why the statistic uses t and not z
The parallel z statistic would be , using (sigma, the population standard deviation). You cannot compute it, because is unknown. If you knew the spread of every packet in the shipment, you would have far less reason to be sampling packets in the first place.
So you estimate with seeds, computed from the same 25 packets that gave you . That puts an estimate in the denominator, and an estimated denominator wobbles from sample to sample the way a fixed never would, so the statistic lands in the far tails more often than a z-score does.
The t distribution is the exact correction when the population is normal, and a good one otherwise. It is symmetric and centered at 0 like the standard normal curve, but with heavier tails, and how heavy they are depends on . At the two-sided 0.05 critical value is (t-star) rather than the normal curve's (z-star). Using z here would shrink your p-value below its true value and overstate your evidence.
As grows the tails thin and t closes in on z, but never quite arrives, so t stays correct for a mean at any sample size. See t-test vs z-test.
Step 4: find the p-value
The p-value is the probability of getting a test statistic at least as extreme as yours, in the direction of , assuming is true. The alternative here is two-sided, so both tails count:
Technology gives this directly. On a TI-84, `T-Test` with , , , , and the alternative returns and , and the one-sample t-test calculator returns the same pair.
A t-table gives bounds instead, which is enough to decide. In row the upper-tail 0.05 entry is 1.711 and the 0.025 entry is 2.064. Your falls between them, so the one-tail area is between 0.025 and 0.05, and doubling gives . That bracket contains 0.0716.
Doubling works only because the t distribution is symmetric and the alternative is two-sided. For a one-sided alternative you report a single tail.
Step 4 continued: write the conclusion in context
Compare the p-value to , then say what that means about seeds, not about symbols. Every conclusion needs three pieces: the comparison, the decision, and the context.
Since , you fail to reject . You do not have convincing evidence that the true mean number of seeds per packet differs from 50.
Three phrases matter there. Fail to reject, not accept: the test never confirms , it only reports that the data are consistent with it. Convincing evidence, not proof. And true mean number of seeds per packet, the context the question asked about.
Notice how close this call is. At the same data would lead you to reject. A p-value of 0.0716 is not a verdict of no effect; it says a sample mean this far from 50 would happen about 7 times in 100 by chance alone if the claim were true. See what a p-value means.
A confidence interval tells the same story from the other side. The 95% interval is , or seeds. It contains 50, matching the decision to fail to reject at .
What loses points on this question
- Writing hypotheses about instead of . The sample mean is already known, so there is nothing to hypothesize about it.
- Listing the three conditions without linking them to the problem. Say which sample was random, do the comparison, and name what the plot of the data shows.
- Dividing by instead of in the standard error. Here that would give and a badly inflated of 9.43.
- Using . With the degrees of freedom are 24, and would shrink the p-value below the truth.
- Reporting a one-tail area for a two-sided alternative. That gives 0.0358 here, which sits below 0.05 and flips the decision.
- Saying you accept , or that the mean equals 50. Failing to reject means the data do not rule out 50.
- Skipping the context. A conclusion that stops at "fail to reject" without mentioning seeds per packet is incomplete.
Work the same four steps on fresh numbers in t-test practice.
The seed packet test, all four steps
A seed supplier states that each packet holds a mean of 50 seeds. A gardener opens a random sample of packets from a shipment of several thousand and finds seeds and seeds. A dotplot of the 25 counts shows no strong skewness and no outliers. Test at whether the true mean differs from 50 seeds.
State: let be the true mean number of seeds per packet in the shipment. against , tested at .
Check random: the 25 packets were randomly selected from the shipment.
Check 10%: the shipment holds several thousand packets, which is more than .
Check sample data: , and the dotplot of the 25 counts shows no strong skewness and no outliers, so a one-sample t procedure applies.
Standard error: seeds.
Numerator: seeds.
Test statistic: .
Degrees of freedom: .
One-tail area from technology: .
Two-sided p-value: .
Table check: in row 24, falls between the 0.05 entry 1.711 and the 0.025 entry 2.064, so the one-tail area is between 0.025 and 0.05 and , which contains 0.0716.
Decide: , so fail to reject .
, , , and . Since , fail to reject . There is not convincing evidence that the true mean number of seeds per packet differs from 50. The matching 95% interval, seeds, contains 50 and agrees with that decision.
A one-sided version, where the p-value is not doubled
A cafe's automatic dispenser is set to pour a mean of 355 mL per cup. A manager suspects it is under-pouring and measures a random sample of cups from a morning's service, getting mL and mL. A boxplot of the 16 volumes shows no strong skewness and no outliers. Test at whether the true mean pour for that morning's service is below 355 mL.
State: let be the true mean volume poured per cup across that morning's service. against , tested at . The direction was suspected before the data were collected, so a one-sided alternative is legitimate.
Check random: the 16 cups were a random sample of the morning's pours. Check 10%: that morning's service produces far more than cups, so the 16 sampled cups are less than 10% of the morning's pours. Check sample data: , and the boxplot shows no strong skewness and no outliers.
Standard error: mL.
Numerator: mL.
Test statistic: , with .
One-sided p-value: . Do not double it, because only the low tail points in the direction of .
Table check: in row 15 the upper-tail 0.05 entry is 1.753 and the 0.025 entry is 2.131. Since lies between them, , which contains 0.0320.
Decide: , so reject .
mL, , , and . Since , reject . There is convincing evidence that the dispenser's true mean pour for that morning's service is below 355 mL. Doubling this p-value by mistake would give 0.0639 and reverse the decision, which is why the alternative's direction has to be settled before you read the tail.
Frequently asked questions
Do I use n or n - 1 for the degrees of freedom?
Use . With that is 24. The subtraction happens because is built from deviations around , and once you know and any 24 of the deviations, the 25th is forced. Using thins the tails and reports a p-value slightly smaller than the true one.
When do I double the p-value?
Only when the alternative is two-sided, such as . Then both tails count as extreme and you double the single-tail area. For or you report one tail and do not double. Choose the direction from the question before you look at the data, never after.
What if my sample is smaller than 30 and the data look skewed?
Then the sample data condition fails and the one-sample t procedure is not justified. Say so explicitly rather than running the test anyway. With you need the sample to show no strong skewness and no outliers, or a statement that the population is approximately normal.
Does a p-value of 0.0716 mean there is a 7.16% chance the supplier is right?
No. It means that if the true mean really were 50 seeds, samples of 25 packets would produce a mean at least 2.3 seeds away from 50 about 7.16% of the time. The probability is attached to the data given the null hypothesis, not to the hypothesis given the data.
Why does the 95% interval agree with the test?
Both use the same t curve at and the same standard error, so a two-sided test at and a 95% interval always line up. The interval contains 50, which is the same information as exceeding 0.05. Change either the confidence level or the alternative's direction and the correspondence can break.