Skip to the workspace
Pebellslearn by building
Statistical Inference  ›  Lesson

Hypothesis Tests and p-values

Statistics 15 minA hypothesis test assumes the change had no effect and asks how surprising the observed difference would be, and the p-value is that probability, not the probability that the null is true.

ai data scientist / Hypothesis Tests and p-values

Explore each scene at your own pace.

01 · The rule

The rule

Hypothesis Tests and p-values

A sceptical finance manager looks at the Quick Checkout result and says: "Conversion jumps around every week. Maybe the new checkout does nothing and you just caught a good fortnight." That is a fair challenge, and a hypothesis test is the formal way to answer it.

The rule

A p-value asks: if nothing changed, how surprising is data this extreme?

A test starts by assuming the boring explanation is true.

  • The null hypothesis says the change has no effect: both checkouts convert at the same rate, and any gap is sampling noise.
  • The test statistic measures how far the result sits from "no effect", in standard errors:
z=observed difference−0SEz = \frac{\text{observed difference} - 0}{SE}

For the checkout test, z=1/0.36≈2.8z = 1 / 0.36 \approx 2.8. The observed lift is almost three standard errors away from zero.

  • The p-value is the chance, if the null were true, of seeing a gap at least this far from zero in either direction. For z≈2.8z \approx 2.8 it is about 0.006: pure noise would produce a gap this large only about 6 times in 1,000 tests.
  • Before looking, you choose a significance level, usually α=0.05\alpha = 0.05. If the p-value is below it, you call the result statistically significant and reject the null.

A p-value is easy to over-read. It is not the probability that the null is true, and it is not the size of the effect. With millions of users, a lift too small to matter can still earn a tiny p-value, so always put the effect and its interval next to it. Tests and intervals agree: a 95% interval that excludes zero goes with a two-sided p-value below 0.05.

Scene 1 of 5
Hover to wake the cannons. Drag to move, or use arrow keys when focused. Press Enter to fire a shot.