A topic in the Open Knowledge Graph — a free, open map of 15,290 topics and the order to learn them in.

Z-Tests and T-Tests for Means

College Depth 99 in the knowledge graph ☐ I know this ☆ Set as goal
304topics build on this
508prerequisites beneath it
See this on the map →
Hypothesis Testing FundamentalsStandard Normal Distribution and Z-Scores+1 more→→One-Sample Z-Test for Means
z-test t-test test-statistic p-value

Core Idea

A z-test tests hypotheses about a population mean when the population standard deviation σ is known (rare in practice). The test statistic is z = (x̄ - μ₀) / (σ/√n). A t-test is used when σ is unknown and replaced by sample standard deviation s; the test statistic is t = (x̄ - μ₀) / (s/√n), which follows a t-distribution with n-1 degrees of freedom. The t-distribution has heavier tails than normal, so t-tests account for additional uncertainty from estimating σ. Both tests compare observed sample means to hypothesized population means.

How It's Best Learned

Compute z and t statistics from data. Use tables or software to find p-values. Compare z-test and t-test on the same data for large and small samples. Understand why t-distribution is appropriate for small samples.

Common Misconceptions

Using z-test when σ is unknown. Confusing degrees of freedom in t-distribution. Thinking larger t values have larger p-values (opposite is true). Misapplying tests without checking normality assumptions for small samples.

Explainer

You already know the core logic of hypothesis testing: assume the null hypothesis is true, compute how far your sample result is from what the null predicts, and ask how likely such a deviation is by chance. You also know how to convert raw values to z-scores using the standard normal distribution. The z-test and t-test both apply that exact logic to sample means — the only real difference is what you know about the population's variability.

A z-test applies when you know the true population standard deviation σ. The test statistic z = (x̄ − μ₀) / (σ/√n) measures how many standard errors your sample mean sits from the hypothesized population mean μ₀. The denominator σ/√n is the standard error of the mean — the theoretical spread of sample means when repeatedly drawing samples of size n. Because σ is known, this denominator is exact, and the test statistic follows a standard normal distribution precisely. In practice, knowing σ is rare (it would require surveying the entire population), so the z-test is mostly theoretical or used for large samples where the Central Limit Theorem ensures approximate normality.

In real data analysis, you almost always estimate σ from the sample itself using the sample standard deviation s. Plugging s in where σ was gives the t-test statistic: t = (x̄ − μ₀) / (s/√n). But here's the subtle problem: s is itself a random variable — it varies from sample to sample — introducing additional uncertainty into the denominator. This extra randomness makes the test statistic follow a t-distribution rather than a standard normal. The t-distribution looks like a normal distribution but with heavier tails, reflecting that extreme outcomes are somewhat more likely when your estimate of spread is itself imprecise. The exact shape depends on degrees of freedom (df = n − 1): with only a few observations, uncertainty is large and tails are heavy; as n grows, s stabilizes and the t-distribution converges to the standard normal. By n ≈ 30, the two distributions are nearly identical, which is why large-sample z-tests are defensible even when σ is unknown.

The decision rule is the same for both tests: compute the test statistic, find the p-value (the probability of observing a result this extreme under H₀), and compare to your significance level α. A larger absolute value of z or t pushes the p-value *down*, making the result more significant — the opposite of what beginners sometimes assume. When running a two-sided test, you're asking whether your sample mean is far from μ₀ in *either* direction, so you use the total tail probability on both ends. When choosing between z and t, the rule is simple: use t-tests by default. They handle the unknown-σ case correctly, and when n is large enough that z would have been fine, the t-test gives essentially the same answer anyway.

Practice Questions 5 questions

Prerequisite Chain

Understanding Zero → The Number Zero → Counting to Five → Counting to 10 → Counting to 20 → Counting a Set of Objects Up to 20 → Cardinality: The Last Number Counted → Matching Numerals to Quantities → Subitizing Small Quantities → Addition Within 10 → Number Bonds to 10 → Addition Within 20 → Doubles and Near Doubles → Doubles Facts Within 10 → Near Doubles Facts Within 20 → Mental Math Strategies for Addition → Mental Math: Adding and Subtracting Tens → Addition Within 100 → Repeated Addition as Multiplication → Multiplication as Equal Groups → Multiplication: Arrays → Basic Multiplication Facts (0s, 1s, 2s, 5s, 10s) → Multiplication Facts Within 100 → Division as Equal Sharing → Division as Grouping (Measurement Division) → Division: Grouping (Repeated Subtraction) Model → Division: Fair Sharing Model → Division as Equal Sharing → Division as Grouping → Basic Division Facts → Division Facts Within 100 → Multiplication and Division Fact Families → Relationship Between Multiplication and Division → Division Facts as Inverse of Multiplication → Remainders and Quotients in Division → Division Word Problems → Multi-Step Word Problems → Solving Multi-Step Word Problems → Multiplication Word Problems → Division Word Problems → Introduction to Long Division → Factors and Multiples → Prime and Composite Numbers → Equivalent Fractions → Relating Fractions and Decimals → Decimal Place Value → Integers and the Number Line → Comparing and Ordering Integers → Absolute Value → Adding Integers → Subtracting Integers → Multiplying Integers → Dividing Integers → Unit Rates → Proportions → Percent Concept → Converting Between Fractions, Decimals, and Percents → Operations with Rational Numbers → Two-Step Equations → Solving Multi-Step Equations → Equations with Variables on Both Sides → Angle Pairs: Complementary, Supplementary, and Vertical → Parallel Lines and Transversals → Corresponding Angles → Alternate Interior Angles → Triangle Angle Sum Theorem → Exterior Angle Theorem → Triangle Inequality Theorem → Similar Triangles: AA Similarity → Similar Triangles: SSS and SAS Similarity → Proportions in Similar Triangles → Right Triangle Trigonometry Introduction → Sine, Cosine, and Tangent Ratios → Trigonometric Ratios Review → Radian Measure → Converting Between Degrees and Radians → The Unit Circle → Graphing Sine and Cosine → Graphing Tangent and Reciprocal Trigonometric Functions → Derivatives of Trigonometric Functions → Antiderivatives → Indefinite Integrals → Basic Integration Rules → Riemann Sums → Definite Integral Definition → Probability Density Functions and Continuous Distributions → Cumulative Distribution Functions → Continuous Random Variables → Probability Density Functions → Expected Value → Weak Law of Large Numbers → Probability Axioms and Rules → Conditional Probability → Conditional Distributions → Bivariate Normal Distribution → Normal Distribution: Properties and Fundamentals → Standard Normal Distribution and Z-Score Standardization → T-Distribution: Theory and Inference → Confidence Intervals for Means → Z-Tests and T-Tests for Means

Longest path: 100 steps · 508 total prerequisite topics

Prerequisites (3)

Leads To (1)