t-tests and confidence intervals

Test a mean from a small normal sample with a t-test, build confidence intervals and connect them to two-tailed tests.

More
Reading settings

Read offline with Premium

Save lessons and figures on this device with Premium.

Connect at least once every 30 days to confirm Premium. Topic checks, coaching and sync need a connection.

On this page

Reading settings

Appearance and reading tools for your lessons.

Live preview

Take a moment to read at your own pace. Choose the font and spacing that feel comfortable for you.

Pause after each idea, then explain it in your own words before moving on.

Narrower lines take effect when the screen has room.

Colour theme
Reading font
Line spacing
Reading width
Section links
Worked examples

Open example banners when a lesson starts. Hints and solutions stay closed until you open them.

Checking Premium access…

Explore Premium
Revision Mode

Hide questions, activities and worked examples to read the notes. Turn off to show the full lesson.

Checking Premium access…

Explore Premium

Enlarged diagram

With a small sample from a normal population whose variance is unknown, replacing σ by the sample estimate s changes the distribution of the test statistic: it is no longer standard normal but a t-distribution with heavier tails. This lesson carries out a one-sample t-test in the form 9649 expects, builds confidence intervals for a mean and for a proportion, connects an interval to a two-tailed test, and states precisely what “95% confidence” does and does not mean.

Estimating the variance changes the distribution

For a random sample of size n from a normal population with mean μ, the sample mean X bar is normal with variance σ²/n. When σ² is unknown we replace it by the unbiased estimate

s² = 1/(n-1)∑(xᵢ-x bar)².

The resulting statistic

T = (X bar -μ)/(S/square root of n)

follows a t-distribution with n-1 degrees of freedom, tₙ₋₁. It is symmetric like the standard normal but has heavier tails, because s itself varies from sample to sample; as n grows, it approaches the normal. For a small sample the normal-population assumption is essential; for a large sample, the central limit theorem lets the normal distribution be used instead.

Heavier tails when variance is estimated

The solid t distribution with 7 degrees of freedom has density about 0.385 at zero and 0.014 at 3. The dashed standard normal has density about 0.399 at zero and 0.00443 at 3.

The solid t distribution with 7 degrees of freedom has density about 0.385 at zero and 0.014 at 3. The dashed standard normal has density about 0.399 at zero and 0.00443 at 3.The solid t distribution with 7 degrees of freedom has density about 0.385 at zero and 0.014 at 3. The dashed standard normal has density about 0.399 at zero and 0.00443 at 3.
The t₇ density is lower at the centre and higher in the far tails than the standard normal. Both distributions are symmetric about zero and have total area 1.
Open full-size graphOpen full-size graph
What to noticeThe plot window stops at ±4; both distributions continue beyond it. A density height is not a point probability.
Figure data

This table is included in print while it is open.

Figure data: Heavier tails when variance is estimated
Statistict₇Standard normal
-4.000.0033030.0001338
-3.950.0035420.0001633
-3.900.0037990.0001987
-3.850.0040760.0002411
-3.800.0043750.0002919
-3.750.0046970.0003526
-3.700.0050440.0004248
-3.650.0054190.0005105
-3.600.0058240.0006119
-3.550.0062600.0007317
-3.500.0067320.0008727
-3.450.0072400.0010383
-3.400.0077900.0012322
-3.350.0083830.0014587
-3.300.0090240.0017226
-3.250.0097160.0020290
-3.200.0104640.0023841
-3.150.0112720.0027943
-3.100.0121440.0032668
-3.050.0130870.0038098
-3.000.0141050.0044318
-2.950.0152040.0051426
-2.900.0163920.0059525
-2.850.0176750.0068728
-2.800.0190590.0079155
-2.750.0205540.0090936
-2.700.0221670.0104209
-2.650.0239080.0119122
-2.600.0257850.0135830
-2.550.0278090.0154493
-2.500.0299900.0175283
-2.450.0323400.0198374
-2.400.0348690.0223945
-2.350.0375910.0252182
-2.300.0405170.0283270
-2.250.0436610.0317397
-2.200.0470370.0354746
-2.150.0506580.0395500
-2.100.0545380.0439836
-2.050.0586930.0487920
-2.000.0631350.0539910
-1.950.0678810.0595947
-1.900.0729430.0656158
-1.850.0783350.0720649
-1.800.0840700.0789502
-1.750.0901610.0862773
-1.700.0966180.0940491
-1.650.1034500.1022649
-1.600.1106650.1109208
-1.550.1182690.1200090
-1.500.1262630.1295176
-1.450.1346480.1394306
-1.400.1434200.1497275
-1.350.1525730.1603833
-1.300.1620930.1713686
-1.250.1719650.1826491
-1.200.1821690.1941861
-1.150.1926760.2059363
-1.100.2034560.2178522
-1.050.2144700.2298821
-1.000.2256750.2419707
-0.950.2370200.2540591
-0.900.2484500.2660852
-0.850.2599030.2779849
-0.800.2713130.2896916
-0.750.2826060.3011374
-0.700.2937080.3122539
-0.650.3045390.3229724
-0.600.3150160.3332246
-0.550.3250550.3429439
-0.500.3345730.3520653
-0.450.3434870.3605270
-0.400.3517150.3682701
-0.350.3591810.3752403
-0.300.3658120.3813878
-0.250.3715430.3866681
-0.200.3763160.3910427
-0.150.3800810.3944793
-0.100.3827990.3969525
-0.050.3844420.3984439
0.000.3849910.3989423
0.050.3844420.3984439
0.100.3827990.3969525
0.150.3800810.3944793
0.200.3763160.3910427
0.250.3715430.3866681
0.300.3658120.3813878
0.350.3591810.3752403
0.400.3517150.3682701
0.450.3434870.3605270
0.500.3345730.3520653
0.550.3250550.3429439
0.600.3150160.3332246
0.650.3045390.3229724
0.700.2937080.3122539
0.750.2826060.3011374
0.800.2713130.2896916
0.850.2599030.2779849
0.900.2484500.2660852
0.950.2370200.2540591
1.000.2256750.2419707
1.050.2144700.2298821
1.100.2034560.2178522
1.150.1926760.2059363
1.200.1821690.1941861
1.250.1719650.1826491
1.300.1620930.1713686
1.350.1525730.1603833
1.400.1434200.1497275
1.450.1346480.1394306
1.500.1262630.1295176
1.550.1182690.1200090
1.600.1106650.1109208
1.650.1034500.1022649
1.700.0966180.0940491
1.750.0901610.0862773
1.800.0840700.0789502
1.850.0783350.0720649
1.900.0729430.0656158
1.950.0678810.0595947
2.000.0631350.0539910
2.050.0586930.0487920
2.100.0545380.0439836
2.150.0506580.0395500
2.200.0470370.0354746
2.250.0436610.0317397
2.300.0405170.0283270
2.350.0375910.0252182
2.400.0348690.0223945
2.450.0323400.0198374
2.500.0299900.0175283
2.550.0278090.0154493
2.600.0257850.0135830
2.650.0239080.0119122
2.700.0221670.0104209
2.750.0205540.0090936
2.800.0190590.0079155
2.850.0176750.0068728
2.900.0163920.0059525
2.950.0152040.0051426
3.000.0141050.0044318
3.050.0130870.0038098
3.100.0121440.0032668
3.150.0112720.0027943
3.200.0104640.0023841
3.250.0097160.0020290
3.300.0090240.0017226
3.350.0083830.0014587
3.400.0077900.0012322
3.450.0072400.0010383
3.500.0067320.0008727
3.550.0062600.0007317
3.600.0058240.0006119
3.650.0054190.0005105
3.700.0050440.0004248
3.750.0046970.0003526
3.800.0043750.0002919
3.850.0040760.0002411
3.900.0037990.0001987
3.950.0035420.0001633
4.000.0033030.0001338

Worked example 1

Are the packets underweight?

Packets are labelled 500 g. The masses, in grams, of a random sample of 8 packets are

497, 502, 495, 499, 494, 498, 501, 496.

Assuming masses are normally distributed, test at the 5% level whether the mean mass is less than 500 g.

Show full solutionHide solution
  1. Hypotheses and statistics

    Method

    H₀:μ = 500 against H₁:μ < 500, a one-tailed test.

    Reason

    The claim to be tested is a shortfall, and σ is unknown with n small, so use t₇.

    Working

    Answer

    x bar = 3982/8 = 497.75, and s² = 1/7∑(xᵢ-x bar)² = 111/14 ≈ 7.929, so s ≈ 2.816.

  2. Test statistic and decision

    Method

    t = (497.75-500)/(2.816/square root of 8) ≈ -2.260.

    Reason

    The one-tailed 5% critical value of t₇ is -1.895.

    Working

    Answer

    Since -2.260 < -1.895 (equivalently, the p-value 0.029 is below 0.05), reject H₀. There is sufficient evidence at the 5% level that the mean mass of packets is less than 500 g.

A 95% confidence interval for μ from a small sample of a normal population is

x bar ± tₙ₋₁ s/(square root of n),

where tₙ₋₁ is the two-tailed 5% critical value. Other cases use the same pattern: x bar ± z σ/square root of n when σ is known for a normal population; x bar ± z s/square root of n for a large sample from any population; and p hat ± z square root of (p hat (1-p hat)/n) for a proportion from a large sample.

A two-tailed test at the 5% level rejects H₀:μ = μ₀ exactly when μ₀ lies outside the 95% interval built from the same data.

Check your understanding 1

One sample, two conclusions

For the packet data, with two-tailed t₇ critical value 2.365, find a 95% confidence interval for the mean mass. What does it say about a two-tailed 5% test of μ = 500, and why does this differ from the one-tailed result?

Show answerHide answer

497.75±2.365 × 2.816/(square root of 8) = 497.75±2.354, giving (495.40, 500.10). It contains 500, so a two-tailed 5% test would not reject μ = 500: |t| = 2.260 < 2.365. The one-tailed test puts all 5% in the lower tail, so its critical value 1.895 is smaller. The choice of tail must come from the question asked before seeing the data.

Spot the mistake 1

What 95% means

About 4 min

A student writes: “There is a 95% probability that the true mean mass lies between 495.40 g and 500.10 g.” Explain what is wrong and give a correct interpretation.

Write your answer, then compare it with the solution

Show full solutionHide solution
  1. Locate the randomness

    Method

    The true mean is fixed; it is the interval that varies from sample to sample.

    Reason

    Once calculated, this particular interval either contains μ or it does not.

    Working

    Answer

    Correctly: if many random samples of 8 packets were taken and an interval calculated in this way from each, about 95% of those intervals would contain the true mean mass.

Common mistakes

  • Using a z critical value when σ is unknown and the sample is small; the t value with n-1 degrees of freedom is larger.
  • Dividing by n instead of n-1 in s², or using s instead of s/(square root of n) as the standard error.
  • Forgetting to state that the population is assumed normal for a small-sample t-test.
  • Comparing a two-tailed interval with a one-tailed test at the same level.
  • Saying there is a 95% probability that μ lies in a particular calculated interval.

Before you move on

Check your understanding 2

An interval for a proportion

In a random sample of 400 residents, 92 support a proposed bus route. Find an approximate 95% confidence interval for the proportion p of all residents who support it, giving the bounds to three decimal places. Then decide whether the interval supports a claim that a quarter of residents support the route.

The claim p = 0.25 is

Show answerHide answer

The sample is large, so the sample proportion p hat = 92/400 = 0.23 is approximately normal:

s.e. = square root of ((0.23 × 0.77)/400) ≈ 0.021042,; p hat ±1.96 s.e. = 0.23±0.041242,

giving (0.189, 0.271). The value 0.25 lies inside, so a two-tailed test at the 5% level would not reject p = 0.25: the data are consistent with a quarter of residents supporting the route, though they do not prove it.

Paired and two-sample tests continue in Paired and two-sample tests, and χ² tests in χ² tests.

Questions

Open the discussion

Syllabus and review details

Last reviewed:

Back to top