Chalk−1

Math · Introductory statistics · Worked example

Run a one-sample t-test

A filling machine should put 500 mL in each bottle. A random sample of 25 bottles has mean 497.2 mL and standard deviation 6 mL. Test H0: μ=500 against Ha: μ≠500 at α=0.05.

Try one — Chalk checks each line

State the hypotheses

The claim is 500 mL, and a machine can drift either way, so the alternative is two-sided. The level α=0.05 is fixed before anyone looks at the bottles.

Check the conditions

The bottles were sampled at random and measured independently. With 25 of them, the test needs fills that are roughly normal, with no clear outliers.

Compute t

The standard error is 6⁢/25=1.2 mL. The mean sits 2.8 mL below the claim, which is about 2.33 standard errors.

625=1.2497.2−5001.2≈−2.33

Predict before you find the p-value

With ∣⁢t⁢∣≈2.33 and 24 degrees of freedom, predict whether the two-sided p is above or below 0.05, and why. The next step checks it.

Find the p-value

There are 25−1=24 degrees of freedom. A t at least 2.333 from 0 in either direction has probability about 0.0283. A t table agrees, since 2.333 lies between the two-tailed critical values 2.064 for 0.05 and 2.492 for 0.02.

Decide

0.0283≤0.05, so reject H0. The data give convincing evidence that the mean fill differs from 500 mL, and the sample says it is lower. The 95⁢% interval, 497.2±2.064×1.2, runs from about 494.72 to 499.68 mL and leaves out 500 as well.

497.2−2.064⋅1.2≈494.72497.2+2.064⋅1.2≈499.68

A near miss

Suppose the same 25 bottles were each measured before and after a repair. Those 50 numbers are paired, so the test runs on the 25 differences as one sample, not on two means as if they were independent.

Result

t≈−2.33 and p≈0.028, so reject H0 at the 5⁢% level. The machine appears to underfill on average, by somewhere between about 0.3 and 5.3 mL (95⁢% confidence).

Your turn

1. One like the example

A random sample of 16 packages has mean mass 52.3 g and standard deviation 6.4 g. The label claims a mean of 50 g. Test H0: μ=50 against Ha: μ≠50 at α=0.05.

Show the answer and explanation

t≈1.44 with 15 degrees of freedom and p≈0.17, so fail to reject H0.

SE=6.4⁢/16=1.6, so t=(52.3−50)⁢/1.6 ≈1.44. The two-sided p of about 0.17 is above 0.05. The data are consistent with a mean of 50 g, and 50 also lies inside the 95⁢% interval 48.89 to 55.71 g.

t=52.3−506.4⁢/16t=2.31.6t≈1.44

2. A variation

Before collecting any data, you suspect that a café’s large cup holds less than the 16 oz it advertises. A random sample of 36 cups has mean 15.8 oz and standard deviation 0.6 oz. Test the claim at α=0.05.

Show the answer and explanation

t=−2 with 35 degrees of freedom and a left-tail p≈0.027, so reject H0. The data give convincing evidence that the cups hold less than 16 oz on average.

The suspicion points one way and came first, so Ha: μ<16 and the p-value is the left tail. SE=0.6⁢/36=0.1, and t=(15.8−16)⁢/0.1=−2. The area to the left of −2 with 35 degrees of freedom is about 0.027.

t=15.8−160.6⁢/36t=−0.20.1t=−2

3. Somewhere new

Ten students take a reading test before and after a summer program. Their score changes, after minus before, have mean 3.2 points and standard deviation 4.0 points. Is there evidence that scores rose on average, at α=0.05?

Show the answer and explanation

Yes. t≈2.53 with 9 degrees of freedom and a right-tail p≈0.016, so reject H0: μ=0. The data give convincing evidence that scores rose on average. Without a group that skipped the program, the rise cannot be credited to the program.

Each student gives one change, so the ten changes are a single sample. Test their mean against μ0=0 with Ha: μ>0. SE=4.0⁢/10≈1.265 and t=3.2⁢/1.265≈2.53, with a right tail of about 0.016. With only ten students, the changes must be roughly normal.

x¯=3.2, s=4, n=10S⁢E=sn=410≈1.265t=3.2−01.265≈2.53

Keep exploring

In Statistics, Distributions with t≈−2.333, 24 degrees of freedom and two tails gives p≈0.0283. With the left tail only, p halves to about 0.0142.

Return to the concept →
Sources and scope

Authored study material. Tool results depend on the stated inputs and model assumptions.

After reading

Try it, then study it

Open the example in its tool to check steps or change values, then review the key terms as flashcards.

Find the p-value in Statistics Check t in Math See α=0.05 as the intervals that miss μ in Confidence-Interval Coverage Study the 8 key terms Open worked example on a board Confidence interval in Math Reference

Your existing work stays on this device. Examples open as editable copies.