p-values and q-values


1. The p-value (The “Weirdness Meter” for One Test)

The Idea:
Start by assuming nothing special is going on (scientists call this the null hypothesis—the “boring” explanation). The p-value tells you:

“If nothing special is going on, how likely is it that I’d get results at least this extreme just by dumb luck?”

  • Small p-value (usually < 0.05, or < 5%): “Whoa, this would almost never happen by luck. Something real is probably going on!”
  • Large p-value (≥ 0.05): “Eh, this could easily happen by luck. Not convinced.”

Example: The “Psychic” Friend

Your friend claims they can predict coin flips with their mind. You flip a fair coin 20 times, and they guess 17 out of 20 correctly.

  • Boring explanation (null hypothesis): They’re just guessing (50/50).
  • The math: If someone just guesses 20 times, getting 17 or more right by pure luck happens only about 0.13% of the time, so $p = 0.0013$.
  • Verdict: Since 0.0013 < 0.05, it’s way too weird to be luck—either your friend is psychic, or they’re peeking at the coin.

Pros & Cons of p-values

  • Pros:
    • Simple, universal standard across science, sports, and AP Stats.
    • Great when you’re only testing one specific hypothesis.
  • Cons:
    • Easy to misread: $p = 0.05$ does not mean “there’s a 5% chance the boring explanation is true.” It means “if the boring explanation is true, you’d see data this weird 5% of the time.”
    • Breaks when you do lots of tests: If you test 100 things, 5 of them will look “significant” ($p < 0.05$) purely by luck!
    • Doesn’t tell you how big or how important an effect is (a tiny, useless difference can have a tiny p-value if you collect enough data).

2. The q-value (The “False Alarm Filter” for Lots of Tests)

The Problem:
Suppose instead of testing 1 friend, you test 1,000 random students at your school for psychic powers using the same 20-coin-flip test. Even if nobody is psychic, about 5% of them (~50 students) will get lucky and score $p < 0.05$. If you announce you found 50 psychics, you’re going to look foolish.

The Idea:
When you run hundreds or thousands of tests at once (like testing 20,000 genes for a disease, or 1,000 students), the q-value adjusts the p-value to control the False Discovery Rate (FDR):

“If I label everything with $q \le 0.05$ as a ‘real discovery,’ what fraction of my discoveries are actually just lucky false alarms?”

With $q \le 0.05$, at most 5% of the things you call “real” are false alarms.

Example: Testing the Whole School

You test 1,000 students on 20 coin flips:

  • 50 students get lucky and hit $p = 0.04$ (still < 0.05).
  • 1 student actually rigged the coin and gets 20/20 ($p = 0.000001$).

You now have 51 “significant” results based on p-values. Look at what happens with q-values:

  • For the 50 students at $p = 0.04$: out of the 51 people you’d flag, ~40–50 of them are expected to be pure luck! Their q-value jumps up (say, $q \approx 0.78$), warning you: “If you include these, ~78% of your ‘psychics’ are fake!”
  • For the 20/20 cheater ($p = 0.000001$): their q-value stays tiny ($q \approx 0.001$), because getting 20/20 out of 1,000 tries is still super rare.

Pros & Cons of q-values

  • Pros:
    • Protects you from fooling yourself when testing lots of things at once (essential in genetics, AI/ML, and A/B testing).
    • Less overly strict than older corrections (like Bonferroni), so it doesn’t throw away real discoveries just to avoid false alarms.
  • Cons:
    • Needs many tests (usually dozens to thousands) to estimate accurately—useless for a single experiment.
    • Harder to explain intuitively than a p-value.
    • Can still be tricky if your tests aren’t independent of each other.

Quick Cheat Sheet

Featurep-valueq-value
Best for1 testMany tests at once (100s–1,000s)
ControlsChance of a false alarm on this one test% of false alarms among all your “discoveries”
Question it answers“How weird is this result if it’s just luck?”“If I trust results this strong, what % are fake?”
Rule of thumbOften < 0.05Often < 0.05 (or < 0.10 in big scans)