Inferential Statistics • Lesson 14
One-Sample t-Test
Learn how to test whether a population mean differs from a specific reference value when the population standard deviation is unknown.
What You Will Learn
Understand when to use a one-sample t-test.
Write the null and alternative hypotheses.
Calculate the standard error using the sample standard deviation.
Calculate and interpret the t-statistic.
Understand degrees of freedom.
Use the p-value to make a statistical decision.
What Is a One-Sample t-Test?
A one-sample t-test is used to test whether the mean of a population differs from a specified reference value.
It is especially useful when the population standard deviation σ is unknown and we estimate variability using the sample standard deviation s.
Collect observations
Measure difference relative to uncertainty
Evaluate evidence against H₀
STEP 1
When Should You Use a One-Sample t-Test?
✓ Typical situation
- • One quantitative variable
- • One sample
- • Compare the population mean with a reference value
- • Population standard deviation is unknown
Example questions
- • Is average delivery time 30 minutes?
- • Is average order value ₹2,500?
- • Is average response time below 500 ms?
- • Is average customer score different from 80?
STEP 2
Write the Hypotheses
NULL HYPOTHESIS
H₀: μ = μ₀
The population mean equals the specified reference value.
ALTERNATIVE HYPOTHESIS
Hₐ: μ ≠ μ₀
The population mean is different from the reference value.
The alternative can also be directional:
μ ≠ μ₀
Two-sided
μ > μ₀
Right-tailed
μ < μ₀
Left-tailed
STEP 3
The One-Sample t-Statistic
t = (x̄ − μ₀) / (s / √n)
x̄
Sample mean
μ₀
Reference population mean
s
Sample standard deviation
n
Sample size
STEP 4
Calculate the Standard Error
Because the population standard deviation is unknown, the one-sample t-test uses the sample standard deviation.
SE = s / √n
The standard error measures how much sample means are expected to vary from sample to sample.
STEP 5
Worked Example
An online store claims that its average delivery time is 30 minutes.
Sample mean
x̄ = 32
Reference mean
μ₀ = 30
Sample standard deviation
s = 8
Sample size
n = 100
Step 1: Calculate SE
SE = 8 / √100
SE = 8 / 10 = 0.8
Step 2: Calculate t
t = (32 − 30) / 0.8
t = 2.5
STEP 6
Degrees of Freedom
For a one-sample t-test, the degrees of freedom are:
df = n − 1
In our example:
df = 100 − 1 = 99
The degrees of freedom determine which t-distribution is used to evaluate the test statistic.
Why the t-Distribution?
When σ is unknown, we estimate it using the sample standard deviation s. This additional uncertainty is reflected in the t-distribution.
z-based approach
Typically used when the population standard deviation σ is known.
t-based approach
Used when σ is unknown and the sample standard deviation s is used instead.
STEP 7
Complete One-Sample t-Test Workflow
Define the research question.
Write H₀ and Hₐ.
Collect a suitable sample.
Calculate the sample mean x̄.
Calculate the sample standard deviation s.
Calculate SE = s / √n.
Calculate the t-statistic.
Calculate or obtain the p-value using df = n − 1.
Compare the p-value with α.
State the conclusion in the context of the original question.
STEP 8
Important Assumptions
Independent observations
Observations should generally be independent of one another.
Quantitative variable
The test is designed for a quantitative measurement when testing a population mean.
Approximate normality
For small samples, the population distribution should be reasonably close to normal. Strong skewness or extreme outliers can make the test unreliable.
Larger samples
With larger samples, the procedure is generally more robust to moderate departures from normality, although severe outliers can still matter.
Real-World Analytics
Website Response Time
A company wants to determine whether the average website response time is greater than the target of 500 milliseconds.
Reference value
μ₀ = 500 ms
Alternative
Hₐ: μ > 500
Sample mean
x̄ = 520 ms
Sample SD
s = 80 ms
n = 100
SE = 80 / √100 = 8
t = (520 − 500) / 8 = 2.5
The t-statistic is positive because the sample mean is above the reference value. The final statistical decision requires the appropriate t-distribution and the chosen significance level.
t-Test vs z-Test
| Feature | One-Sample t-Test | z-Based Test |
|---|---|---|
| Population SD | Usually unknown | Known |
| Variability | Uses sample SD s | Uses population SD σ |
| Reference distribution | t-distribution | Standard normal distribution |
PRACTICE
Test Your Understanding
CHECK YOUR UNDERSTANDING
When is a one-sample t-test commonly used?
CHECK YOUR UNDERSTANDING
What formula gives the one-sample t-statistic?
CHECK YOUR UNDERSTANDING
For a one-sample t-test with n = 25, what are the degrees of freedom?
CHECK YOUR UNDERSTANDING
If x̄ = 32, μ₀ = 30, s = 10, and n = 100, what is the standard error?
CHECK YOUR UNDERSTANDING
If x̄ = 32, μ₀ = 30, and SE = 1, what is the t-statistic?
CHECK YOUR UNDERSTANDING
Why is the t-distribution used when σ is unknown?
Fill in the Blank
For a one-sample t-test, degrees of freedom are n − ______.
The one-sample t-test uses the sample standard deviation, written as ______.
The standard error for the one-sample t-test is s divided by the square root of ______.
The reference population mean is commonly written as μ______.
Analytics Challenge
Customer Order Value
An online store claims that its average order value is ₹2,000. An analyst collects a sample of 64 orders.
x̄ = ₹2,080
μ₀ = ₹2,000
s = ₹320
n = 64
Calculate the standard error:
SE = 320 / √64
SE = 320 / 8 = ₹40
Now calculate t:
t = (2080 − 2000) / 40 = 2
Degrees of freedom:
df = 64 − 1 = 63
Final Challenge
Response-Time Test
A website has a target average response time of 500 ms. A sample of 100 requests gives:
x̄ = 520 ms
μ₀ = 500 ms
s = 80 ms
n = 100
Calculate t:
SE = 80 / √100 = 8
t = (520 − 500) / 8
t = 2.5
The next step would be to evaluate this statistic using the t-distribution with:
df = 99
Lesson 14 Summary
A one-sample t-test compares a population mean with a reference value.
It commonly applies when the population standard deviation σ is unknown.
The test uses the sample standard deviation s.
The standard error is SE = s / √n.
The t-statistic is t = (x̄ − μ₀) / (s / √n).
Degrees of freedom are df = n − 1.
The t-distribution accounts for the additional uncertainty from estimating σ with s.
The final decision can be made using the p-value and a pre-specified significance level.