What is a P-Value?

Okay, so imagine you flip a coin 100 times and get heads 70 times. That’s weird, right?

A p-value tells you: “If this coin was actually fair, how weird would this result be?”

If the p-value is really small (like 0.001), it means: “Wow, this would almost never happen if the coin was fair.”

That’s basically it. It’s just a number that tells you how surprising your results are.

What P-Values Are NOT

People mess this up a lot. So here’s what they’re definitely NOT:

Wrong ideas: - NOT “the chance I’m right” - NOT “the chance it happened by accident” - NOT “proof of anything”

What they actually are: - Just a number that measures how weird your data looks - A number based on assuming nothing special is happening

Think of it like a smoke detector. If it goes off, that’s surprising. But the alarm doesn’t tell you what’s on fire. It just says “something’s weird.”

Null Hypothesis vs Alternative

Every test starts with two ideas fighting each other.

Null Hypothesis (H₀): “Nothing special is happening” - The medicine doesn’t work - The two groups are the same - The coin is fair

Alternative Hypothesis (H₁): “Something IS happening” - The medicine works - The two groups are different - The coin is rigged

The p-value helps you pick a winner. If the p-value is small enough, you say “okay, I believe H₁.”

The Formula (Don’t Stress It)

\[p\text{-value} = P(\text{your result} \mid H_0 \text{ is true})\]

Translation: “What’s the probability of getting your result if nothing special is actually happening?”

For tests where extreme can go either direction:

\[p\text{-value} = P(|\text{result}| \geq |\text{observed}| \mid H_0)\]

You don’t need to memorize this. Just remember: small p-value = weird result = doubt the H₀

Let’s Test Something Real

We asked 25 students how many hours they study per week:

study_hours <- c(5, 7, 6, 8, 4, 9, 5, 7, 6, 8,
  5, 7, 6, 9, 5, 8, 6, 7, 5, 8, 6, 7, 5, 8, 7)
t.test(study_hours, mu = 6)

P-value = 0.0548. Very close to our 0.05 threshold!

Visualizing P-Values

Red zone = results that would be pretty weird if H₀ was true

How Do You Use It?

Before you run your test, pick a line: usually 0.05.

The rule: - p < 0.05: Result is weird. Reject H₀. - p ≥ 0.05: Result is normal. Keep H₀.

Interactive 3D Visualization

Bottom Line

  • Small p-value: “This result is surprising if H₀ is true”
  • Big p-value: “This result is normal if H₀ is true”
  • You pick 0.05 beforehand: Your threshold for “surprising”
  • If p < 0.05: Reject H₀
  • If p ≥ 0.05: Don’t reject H₀