Course contentsShow
← Data Science
Lesson 353 of 2,14510. Hypothesis Tests for MeansFree lesson

Calculating the t-Statistic

Computing the test statistic as (sample mean - hypothesized mean) divided by the standard error of the mean.

Calculating the t-Statistic

You'll learn: How to compute the t-statistic to measure how far your sample mean is from a hypothesized population mean.

What Is the t-Statistic?

The t-statistic is the core calculation in a one-sample t-test. It tells you how many standard errors your sample mean sits away from the hypothesized population mean. Think of it as a standardized distance measure—like asking "how many yards away is that tree?" instead of just saying "it's over there."

The Formula

The t-statistic is calculated as:

t = (sample mean - hypothesized mean) / standard error of the mean

Or in notation:

t = (x̄ - μ₀) / SE

Where:

  • x̄ = your sample mean
  • μ₀ = the hypothesized population mean (from your null hypothesis)
  • SE = standard error of the mean (s / √n)

Breaking It Down

The numerator (x̄ - μ₀) measures the raw difference between what you observed and what you hypothesized. The denominator (SE) scales that difference by how much variability you'd expect due to random sampling.

A large t-statistic (far from zero) means your sample mean is unusually far from the hypothesized value—suggesting the null hypothesis might be wrong. A t-statistic near zero means your sample mean is close to what you'd expect if the null hypothesis were true.

Analogy

Imagine testing if a new machine produces bolts that average 10 cm. You measure 25 bolts and get x̄ = 10.3 cm with a standard error of 0.1 cm. Your t-statistic is (10.3 - 10) / 0.1 = 3, meaning your sample mean is 3 standard errors above the hypothesized mean—quite unusual!

Key Takeaway: The t-statistic converts the difference between your sample mean and hypothesized mean into a standardized measure using the standard error, forming the basis for hypothesis testing decisions.