When do you use a t-test instead of a z-test
Use a t‑test when the population standard deviation is unknown and the sample is small (usually n < 30); use a z‑test when the population standard deviation is known or the sample is large enough for the Central Limit Theorem to justify approximating the sampling distribution with a normal curve.
Statistics · Hypothesis testing
A t‑test and a z‑test are both methods for testing a hypothesis about a population mean, but they differ in the information available about variability. The z‑test assumes you know the true population standard deviation σ, which is rare in practice. The t‑test replaces σ with the sample standard deviation s, accounting for extra uncertainty when the sample size is limited.
Key Conditions
Use a t‑test when:
- σ is unknown and must be estimated from the data
- Sample size is small (n < 30) or moderate with unknown σ
- Data are approximately normally distributed
When the sample size grows, the sample standard deviation becomes a reliable estimator of σ, and the t‑distribution approaches the standard normal distribution. This is why many textbooks allow a z‑test for n ≥ 30 if σ is still unknown but the sample is large. However, the safest rule is to default to the t‑test unless you truly know σ from prior studies or physical measurement.
Choose the correct test by following these steps:
- 1Determine whether σ is known from theory or previous experiments.
- 2Check the sample size; if n ≥ 30 and σ is unknown, you may approximate with a z‑test.
- 3Assess normality; for small n, ensure the data are roughly bell‑shaped or use a non‑parametric alternative.
Comparison of t‑test and z‑test:
| Aspect | t‑test | z‑test |
|---|---|---|
| σ known | No | Yes |
| Typical n | Small to moderate | Large (≥30) |
| Distribution used | Student's t with df = n‑1 | Standard normal (Z) |
Worked example: A researcher measures the breaking strength of 12 steel rods and obtains a mean of 58.4 MPa with a sample standard deviation of 3.2 MPa. The population σ is unknown, so a one‑sample t‑test is appropriate. The test statistic is . With 11 degrees of freedom, the two‑tailed p‑value is about 0.11, so the null hypothesis of a mean of 60 MPa is not rejected at the 0.05 level.
Check yourself
What is the primary reason to prefer a t‑test over a z‑test?
Get this as a lesson built for you
Describe what you are studying and Lernex writes the lesson and the questions around it. Free, and it takes about a minute.
Try itNo account needed to try it.
What people ask next
- How do I calculate the t‑statistic?Ask
- What are degrees of freedom in a t‑test?Ask
- Can I use a t‑test for paired data?Ask
- what does a p-value actually mean
- what is the difference between a type I and type II error
- what is the difference between standard deviation and standard error
- why do you divide by n-1 for sample variance
