Foundations to Frontier
Tests
O. Research Skills › O2 Doing Research

Forming Hypotheses

A hypothesis is a precise, testable claim about what an experiment will show, stated before the experiment. How it is formed decides how much a positive result means: a significant finding about a long-shot hypothesis tested with a small study is more likely false than true. The exercises simulate fields testing many hypotheses, confirm the positive predictive value formula PPV = power·prior / (power·prior + α(1 − prior)) against 200,000 studies, and compare research strategies with the same budget: fishing among 50 vague hypotheses gives findings that are mostly false, while 10 sharp hypotheses tested with larger studies give more true findings and almost no false ones. Practice problems cover optional stopping, the winner's curse, power analysis, replication, and the garden of forking paths.

Level 0: Foundation

★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.

A claim that could fail

A good hypothesis says what will happen, how large the effect should be, and what result would show it wrong, before the data are seen. Vague hypotheses (“the method helps somewhere”) can be made to fit almost any result; sharp ones can fail, which is what makes their success informative. How likely a hypothesis was before the test, and how strong the test is, decide how much a positive result should be believed.

🎮 Research lab

Effect 0.4 when true, two-sided 5% test: power 80.7%, and 64.2% of significant findings are true (the formula Exercise 1 checks against 200,000 simulated studies).

Exercise 2, effect 0.3, 4,000 participants per researcher (true findings, false findings, share true):

fishing: 50 vague hypotheses
0.696, 1.165, 37.4%
fishing with 3 outcomes each
1.535, 3.445, 30.8%
focused: 10 sharp hypotheses
2.574, 0.179, 93.5%
focused, then replicated
1.036, 0.003, 99.8%
Why engineers care

In Exercise 2, a researcher fishing among 50 vague hypotheses with small studies made 0.70 true and 1.17 false findings on average (37.4% true); one testing 10 sharp hypotheses with the same participants made 2.57 true and 0.18 false (93.5% true).

📝 Quick check (Level 0)
0/3 answered
  1. 1. A good hypothesis is…
  2. 2. A significant result about an unlikely hypothesis from a small study is…
  3. 3. The chance a significant finding is true is called its…

Level 1: Beginner

★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.

By hand

  • Hypothesis: a testable statement of an expected effect, with direction and, ideally, size.
  • Falsifiable: some possible result would contradict it (K. Popper).
  • Prior probability: how likely the hypothesis is before the test, from theory, pilots and earlier evidence.
  • Power: the chance the test detects the effect if it is real; grows with effect size and sample size.
  • α (significance level): the chance of a significant result when there is no effect.
  • Positive predictive value (PPV): the share of significant findings that are true.
  • Preregistration: recording hypotheses, outcomes and analysis before collecting data.
📝 Quick check (Level 1)
0/3 answered
  1. 1. Power is the chance of…
  2. 2. Preregistration records…
  3. 3. A hypothesis no result could contradict is…

Level 2: Intermediate

★★★☆☆ Intermediate⏱ 25 minUndergraduate students and practising engineers.

Simulating a field’s findings

Exercise 1.

  • Studies compare two groups of n with a z-test; a true hypothesis has a standardised effect d, a false one none.
  • Each hypothesis is true with a prior probability; the field reports the significant results.
  • Exercise 1 compares the simulated share of true findings with the PPV formula for priors 0.5, 0.1 and 0.02 and n of 100 or 20, with d = 0.4.

Practice.

  • Write the hypothesis as a prediction: direction, size, the outcome measured and the analysis.
  • Raise the prior before testing: theory, pilots and the literature.
  • Choose the sample size by power analysis for the smallest effect worth finding.
  • Preregister the outcome and analysis; label everything else exploratory.
  • Replicate surprising findings before building on them.
true = rng.random(m) < prior                  # which hypotheses are true
z = (true * d + sqrt(2 / n) * randn(m)) / sqrt(2 / n)
sig = abs(z) > 1.96                           # the reported findings
ppv_sim = true[sig].mean()
ppv = power * prior / (power * prior + 0.05 * (1 - prior))
🐍 Exercise 1: how many findings are true
Simulate 200,000 studies for each combination of prior and sample size and compare the share of significant findings that are true with the PPV formula.
📝 Quick check (Level 2)
0/3 answered
  1. 1. With prior 0.02 and power 0.24, the share of significant findings true was about…
  2. 2. Testing after every 10 participants and stopping when significant raised false positives from 5% to…
  3. 3. Significant studies with 20 per group overstated a true effect of 0.3 by a factor of…

Level 3: Advanced

★★★★☆ Advanced⏱ 25 minGraduate level, with full derivations and proofs.

Theory

PPV by Bayes’ rule. With prior π, power 1 − β and level α, the chance of a significant result is (1 − β)π + α(1 − π), of which (1 − β)π comes from true hypotheses: PPV = (1 − β)π / ((1 − β)π + α(1 − π)). With π = 0.1, power 0.8 and α = 0.05, PPV = 0.64; with power 0.24 it falls to 0.35.

Odds form and replication. In odds, posterior odds = prior odds × (1 − β)/α. Each independent significant replication multiplies the odds again by its own (1 − β)/α, so even a weak original finding becomes credible after one or two successful replications.

Sample size. A two-sided z-test of effect d with n per group has power Φ(d/√(2/n) − z_(1−α/2)). Setting this to 1 − β gives n = 2(z_(1−α/2) + z_(1−β))²/d²: 63 per group for d = 0.5 and 80% power; 393 for d = 0.2.

Flexibility inflates α. Reporting a study if any of k independent tests is significant at α gives a false-positive rate 1 − (1 − α)^k. Testing repeatedly as data arrive and stopping at the first significant result can only add chances to be significant, never remove them.

📝 Quick check (Level 3)
0/3 answered
  1. 1. PPV with prior 0.1, power 0.8 and α = 0.05 is…
  2. 2. Participants per group for 80% power at d = 0.5 are about…
  3. 3. Each successful replication multiplies the odds that a finding is true by…

Level 4: Expert

★★★★★ Expert⏱ 30 minResearchers: original papers and open problems.

With a fixed number of participants, how do the number and sharpness of the hypotheses tested change how many findings are true?

History.

  • K. Popper (1934) made falsifiability the mark of a scientific hypothesis; J. Platt’s “Strong inference” (1964) urged testing sharp alternative hypotheses.
  • J. Ioannidis (2005) used the PPV argument to argue that most published findings are false; K. Button and colleagues (2013) showed how low power undermines neuroscience.
  • J. Simmons, L. Nelson and U. Simonsohn (2011) showed that flexible analysis makes almost anything significant; N. Kerr (1998) named HARKing (hypothesising after results are known); A. Gelman and E. Loken (2013) described the garden of forking paths.
  • The Open Science Collaboration (2015) replicated 100 psychology studies and found significant effects in 36%; preregistration spread afterwards.

Exercise 2.

  • 2,000 simulated researchers, each with 4,000 participants; true effects are 0.3 standard deviations; a finding is a result significant in the predicted direction.
  • Fishing: 50 hypotheses with prior 0.05 and 40 per group, with one outcome or with three outcomes per study. Focused: 10 hypotheses with prior 0.3 and 200 per group. Focused then replicated: 5 such hypotheses, each finding repeated with a fresh study of 200 per group.

Seed 0, per researcher:

strategy true findings false findings share true
fishing: 50 vague hypotheses 0.696 1.165 37.4%
fishing with 3 outcomes each 1.535 3.445 30.8%
focused: 10 sharp hypotheses 2.574 0.179 93.5%
focused, then replicated 1.036 0.003 99.8%

Seeds 1 and 2: share true 37.1% and 38.0% (fishing), 30.5% and 30.8% (three outcomes), 93.6% and 93.6% (focused), 99.8% and 99.8% (replicated).

Findings.

  • Fishing produced more false findings than true ones, and trying three outcomes per study tripled the false ones.
  • Focusing the same budget on fewer, likelier hypotheses gave over three times the true findings and about a sixth of the false ones.
  • Replication made findings almost certain at the cost of testing fewer hypotheses.
🐍 Exercise 2 (research): with a fixed number of participants, how do the number and sharpness of the hypotheses tested change how many findings are true?
Simulate researchers with 4,000 participants each who fish among many vague hypotheses or test a few sharp ones, with and without replication.

Hypotheses in practice

  • In machine learning, a hypothesis such as “augmentation X improves robustness to Y by at least Z on benchmarks A and B, with the training budget fixed” can be tested and can fail; “X helps” cannot.
  • Preregistration is growing in ML through registered-report tracks at some workshops and conferences.
  • Ablations test the hypothesis behind each component (topic O2-4).
  • Replications and reproductions check findings before others build on them (topic O2-6).

References

  1. K. R. Popper (1959). The Logic of Scientific Discovery. Hutchinson (first published in German, 1934).
  2. J. R. Platt (1964). “Strong inference.” Science.
  3. J. P. A. Ioannidis (2005). “Why most published research findings are false.” PLOS Medicine.
  4. J. P. Simmons, L. D. Nelson and U. Simonsohn (2011). “False-positive psychology: undisclosed flexibility in data collection and analysis allows presenting anything as significant.” Psychological Science.
  5. Open Science Collaboration (2015). “Estimating the reproducibility of psychological science.” Science.