Course contentsShow
← Mathematics
Lesson 3022 of 3,12159. Statistics — Descriptive and InferentialFree lesson

Test Statistics and P-values

Computing test statistics from sample data and understanding p-values as probabilities under the null hypothesis.

Test Statistics and P-values

You'll learn how to compute numerical summaries from your sample data that measure how unusual they are under the null hypothesis, and what the p-value really means.

The Test Statistic

Once you've stated your null and alternative hypotheses, the next step is to turn your sample data into a single number that measures how far your observations are from what the null hypothesis predicts. This number is called a test statistic.

Think of the test statistic as a "weirdness score." If you hypothesize that a coin is fair (null hypothesis: p = 0.5), but you flip it 100 times and get 70 heads, you need a way to quantify just how unexpected that is. The test statistic standardizes your sample result—often by comparing it to its expected value and dividing by its standard error—so you can measure this distance in a meaningful way.

Common forms:

  • For a population mean: z = (x̄ - μ₀) / (σ/√n) or t = (x̄ - μ₀) / (s/√n)
  • For a proportion: z = (p̂ - p₀) / √(p₀(1-p₀)/n)

The P-value

The p-value is the probability of observing a test statistic as extreme as (or more extreme than) what you actually got, assuming the null hypothesis is true.

It answers: "If the null hypothesis were really true, how likely would it be to see data this weird or weirder just by random chance?"

A small p-value (typically < 0.05) suggests your data is very unusual under the null hypothesis, providing evidence against it. A large p-value means your data is consistent with the null—no surprise here.

Key Takeaway: The test statistic quantifies how far your sample is from the null hypothesis prediction; the p-value translates that distance into a probability of seeing such extreme results under the null.