Biostatistics • Data Methods & Statistical Communication

P-Hacking & Transparency — P-hacking, multiple testing, and transparency concepts

Understanding how flexible analysis inflates false discoveries and why transparency safeguards scientific integrity.

A scatter plot connecting biological data with a DNA strand and health signal.
Inside this lesson 10 sections 5 questions 8 figures

SECTION 1

Historical Context & Motivation

The concept of statistical significance, anchored to the now-ubiquitous threshold of α = 0.05, was introduced by Ronald Fisher in the 1920s as a rough heuristic for weighing evidence against a null hypothesis. Fisher never intended the 0.05 cutoff to serve as a rigid binary gate for deciding whether a finding is 'real,' yet by the mid-twentieth century, publication norms across biomedical and social sciences had calcified around exactly that interpretation. Researchers quickly learned—sometimes consciously, sometimes not—that certain analytic decisions could nudge a borderline p-value below the magic threshold, a practice later termed p-hacking. The consequences became unmistakable in the early 2010s, when a wave of failed replications across psychology, medicine, and genomics exposed a scientific literature riddled with false positives.

The crisis did not appear overnight. Decades of incentive misalignment—where careers, grants, and journal prestige rewarded novel, statistically significant results—created fertile ground for analytic flexibility to flourish unchecked. The timeline below traces the key moments that brought p-hacking from an unspoken practice to a central concern of modern research methodology.

1925 • Fisher's Significance Threshold

Ronald Fisher publishes Statistical Methods for Research Workers, popularizing the p < 0.05 convention as a convenient benchmark for evaluating evidence against a null hypothesis.

1995 • Early Warnings on Multiple Testing

Yoav Benjamini and Yosef Hochberg introduce the False Discovery Rate (FDR) procedure, offering a principled correction for the explosion of simultaneous tests in genomics and neuroimaging.

2005 • Ioannidis Sounds the Alarm

John Ioannidis publishes 'Why Most Published Research Findings Are False,' demonstrating through probability modeling that the combination of low power, bias, and analytic flexibility renders a majority of statistically significant results likely to be false positives.

2011 • Simmons, Nelson, and Simonsohn

The landmark paper 'False-Positive Psychology' shows how four common researcher degrees of freedom can inflate the false-positive rate from 5% to over 60%, coining widespread use of the term p-hacking.

2015–present • Transparency Revolution

Pre-registration platforms (OSF, ClinicalTrials.gov) and Registered Reports gain traction. Major journals adopt open-data policies, and the ASA issues its 2016 statement on p-values, urging researchers to move beyond significance thresholds.

The central question this lesson addresses is deceptively simple: how do seemingly minor analytic decisions compound to undermine the reliability of statistical evidence, and what structural reforms can restore trustworthiness to published findings? To answer this question, we need to understand the mechanics of p-hacking, the mathematics of multiple testing corrections, and the emerging ecosystem of transparency tools designed to prevent these problems in the first place.

SECTION 2

Core Principles & Definitions

Before examining the mechanics in detail, it is essential to anchor our discussion in a set of foundational concepts. Each represents a distinct facet of the problem: the statistical underpinning of hypothesis testing, the ways that underpinning can be exploited, and the corrective frameworks that have been developed in response. Together, these principles form the conceptual architecture for understanding why the replication crisis occurred and how the scientific community is working to resolve it.

1

P-Value

The probability of observing a test statistic at least as extreme as the one obtained, given that the null hypothesis is true. It is not the probability that the null is true, nor the probability that the result is a fluke—common misinterpretations that fuel p-hacking behavior.
2

P-Hacking

The practice of exploiting researcher degrees of freedom—such as flexible sample sizes, optional stopping, selective outcome reporting, or post-hoc subgroup analysis—to obtain a statistically significant p-value. It inflates the false-positive rate far beyond the nominal α level.
3

Multiple Testing Problem

When multiple hypotheses are tested simultaneously, the probability that at least one yields a false positive grows rapidly. With m independent tests at α = 0.05, the family-wise error rate is 1 − (1 − α)m, reaching 40% with just 10 tests.
4

Pre-Registration

The practice of publicly specifying hypotheses, sample sizes, variables, and analysis plans before data collection. By constraining analytic flexibility prospectively, pre-registration sharply reduces the opportunity for p-hacking.
5

Transparency & Open Science

A suite of practices—open data, open materials, Registered Reports, code sharing—that make the entire research pipeline visible. Transparency does not eliminate error, but it makes errors detectable and correctable.
✦

KEY TAKEAWAY

Think of p-hacking like a rigged slot machine. If you are allowed to pull the lever as many times as you want and only report the jackpots, an outside observer has no way of knowing how many losing pulls preceded them. Pre-registration is the equivalent of declaring how many pulls you will take before you start playing, and transparency is the security camera that lets everyone verify you followed your plan.

SECTION 3

Visualizing P-Hacking's Impact

The diagram below illustrates how researcher degrees of freedom transform a single research question into a branching tree of analytic paths, each producing a different p-value. When researchers traverse this tree selectively—reporting only the path that yields significance—the published p-value no longer reflects the stated α. The garden of forking paths metaphor, coined by Andrew Gelman and Eric Loken, captures this phenomenon: even without deliberate fraud, a researcher who makes data-contingent decisions at each fork implicitly conducts many tests while reporting only one.

The Garden of Forking PathsEach fork = a researcher degree of freedomResearch QuestionInclude outliersExclude outliersDV: CompositeDV: Single itemCovariate ANo covariateLog-transformRaw scalep = 0.230p = 0.087p = 0.110p = 0.038 ★N = 80N = 120N = 80N = 120p = 0.310p = 0.190p = 0.065p = 0.120p = 0.078p = 0.200p = 0.055p = 0.14016 possible analytic paths → 1 reported (p = 0.038)Effective α ≈ 1 − (1 − 0.05)¹⁶ ≈ 0.56 — not 0.05!Only the ★ result is reported — the rest are hidden
The garden of forking paths: a single research question branches into 16 analytic variants through decisions about outlier handling, dependent variable definition, covariates, and sample size. Only the path yielding p = 0.038 (pink border, starred) is reported. The effective error rate across all 16 paths is approximately 56%, not the nominal 5%.

Notice that the diagram contains four decision points (outlier handling, dependent variable, covariate inclusion, and sample size threshold), each with two options. This yields 2⁴ = 16 possible analytic specifications. If each specification is independent and each is tested at α = 0.05, the probability of obtaining at least one significant result—even when the null hypothesis is true for all paths—is approximately 1 − (0.95)16 ≈ 0.56. The pink-bordered terminal node represents the single reported result; the gray nodes are the unreported failures. This selective reporting is the essence of p-hacking: the published p-value is drawn from a distribution of many attempted tests, not from the single test the paper describes.

SECTION 4

Mathematical Framework

To move from intuition to formal reasoning, we need to quantify how the false-positive rate inflates under multiple testing and how correction methods restore the nominal error rate. The mathematical framework rests on two complementary concepts: the family-wise error rate (FWER) and the false discovery rate (FDR). The FWER controls the probability of making even one false positive across all tests, while the FDR controls the expected proportion of false positives among all rejected null hypotheses.

FAMILY-WISE ERROR RATE (UNCORRECTED)

FWER=1−(1−α)mFWER = 1 − (1 − α)ᵐ

Where α is the per-test significance level (typically 0.05), and m is the number of independent tests conducted. This formula assumes independence among tests; correlated tests produce a FWER between α and the formula's value.

BONFERRONI CORRECTION

αadjusted=α/mα_adjusted = α / m

The simplest FWER correction: divide the per-test α by the total number of tests m. For 20 tests at α = 0.05, each individual test must reach p < 0.0025 to be declared significant. The Bonferroni correction is conservative—it controls FWER at or below α but may inflate Type II errors (false negatives).

BENJAMINI-HOCHBERG FDR PROCEDURE

p(i)≤(i/m)×qp₍ᵢ₎ ≤ (i / m) × q

Rank all m p-values from smallest to largest: p₍₁₎ ≤ p₍₂₎ ≤ … ≤ p₍ₘ₎. For a target FDR of q (e.g., 0.05), find the largest rank i such that p₍ᵢ₎ ≤ (i/m) × q. Reject all hypotheses with rank ≤ i. This procedure is less conservative than Bonferroni and is standard in genomics and neuroimaging.

The key insight connecting these formulas to p-hacking is that p-hacking inflates the effective number of tests m without acknowledging it. A researcher who tries three different dependent variables, two covariate sets, and two sample definitions has effectively conducted 3 × 2 × 2 = 12 tests. Reporting only the significant one without adjusting for the other eleven is mathematically equivalent to running a Bonferroni-adjusted study at α = 0.60, not α = 0.05. The correction methods above are not merely technical tools—they are the formal antidote to the inflated error rates that p-hacking produces.

⚠

Important Distinction

The Bonferroni and BH procedures assume you report all m tests. P-hacking circumvents corrections by hiding the unchosen tests. This is why transparency about all analyses attempted is as important as the statistical correction itself.

SECTION 5

A Taxonomy of P-Hacking Strategies

P-hacking is not a single behavior but a family of related practices, each exploiting a different point in the analytic pipeline. Simmons, Nelson, and Simonsohn (2011) identified four primary researcher degrees of freedom, but subsequent literature has expanded the catalog substantially. The diagram below classifies the most common strategies by the stage of research at which they occur, from data collection through reporting.

P-Hacking Strategies by Research StageResearch Pipeline →DATA COLLECTIONOptional stoppingFlexible sample sizeSelective recruitmentDATA PROCESSINGOutlier exclusion rulesVariable transformationComposite score creationANALYSISCovariate fishingSubgroup analysisModel selectionOne-tailed vs two-tailedREPORTINGOutcome switchingHARKingSelective reportingTransparency CountermeasuresPre-registrationLocks data collection planOpen Data & CodeMakes processing verifiableRegistered ReportsPeer review before resultsMultiverse AnalysisReports all forking pathsHARKing = Hypothesizing After Results are KnownPresenting post-hoc findings as if they were predicted a priori
Classification of p-hacking strategies across four stages of the research pipeline: data collection (amber), data processing (cyan), analysis (violet), and reporting (pink). The green bar at bottom shows the corresponding transparency countermeasures for each stage. HARKing (Hypothesizing After Results are Known) is a particularly insidious reporting-stage strategy in which exploratory findings are reframed as confirmatory.

Several of these strategies deserve brief elaboration. Optional stopping refers to the practice of checking for significance after each new data point or batch and stopping data collection as soon as p < 0.05. Under sequential analysis theory, this dramatically inflates the Type I error rate because it provides repeated opportunities to cross the threshold by chance. Covariate fishing involves trying different sets of control variables until the effect of interest becomes significant, often rationalized post-hoc as 'adjusting for confounders.' HARKing (Hypothesizing After Results are Known) may be the most difficult to detect externally, because the paper reads as though the hypothesis was specified in advance. This is precisely why pre-registration with timestamped analysis plans is such a powerful safeguard: it creates a verifiable record of what was planned versus what was discovered.

SECTION 6

Worked Example: Bonferroni & Benjamini-Hochberg Corrections

Suppose a biostatistician analyzes gene-expression data from a clinical trial comparing a new drug to placebo. She tests m = 10 genes for differential expression and obtains the following p-values. The research team wants to identify significant genes while controlling for the multiple testing problem. We will walk through both the Bonferroni correction and the Benjamini-Hochberg procedure.

GeneRaw p-valueRank (i)
Gene D0.0011
Gene A0.0052
Gene G0.0103
Gene B0.0204
Gene F0.0305
Gene J0.0406
Gene C0.0807
Gene E0.1208
Gene H0.3509
Gene I0.75010

P-values for 10 genes, sorted by ascending p-value

Applying Bonferroni and Benjamini-Hochberg Corrections

  1. 1

    Step 1 — Bonferroni Adjusted Threshold

    With m = 10 tests and α = 0.05, the Bonferroni-adjusted threshold is αadj = 0.05 / 10 = 0.005. Any gene with a raw p-value below 0.005 is declared significant under Bonferroni.
    Bonferroni threshold: α_adj = 0.005
  2. 2

    Step 2 — Bonferroni Results

    Gene D (p = 0.001) is below 0.005 → significant. Gene A (p = 0.005) is exactly at the boundary; by strict inequality, it is not significant (p must be strictly less than 0.005). All other genes have p > 0.005 and are not significant.
    Bonferroni: 1 gene significant (Gene D)
  3. 3

    Step 3 — Benjamini-Hochberg Critical Values

    For each ranked p-value p₍ᵢ₎, compute the BH critical value: (i / m) × q, where q = 0.05 and m = 10. This gives thresholds of 0.005, 0.010, 0.015, 0.020, 0.025, 0.030, 0.035, 0.040, 0.045, and 0.050 for ranks 1 through 10 respectively.
  4. 4

    Step 4 — Compare p-values to BH Thresholds

    Starting from the largest rank: Gene I (rank 10, p = 0.750 > 0.050) — fail. Gene H (rank 9, p = 0.350 > 0.045) — fail. Gene E (rank 8, p = 0.120 > 0.040) — fail. Gene C (rank 7, p = 0.080 > 0.035) — fail. Gene J (rank 6, p = 0.040 > 0.030) — fail. Gene F (rank 5, p = 0.030 > 0.025) — fail. Gene B (rank 4, p = 0.020 ≤ 0.020) — pass. Since rank 4 passes, all ranks ≤ 4 are also declared significant.
    BH procedure: 4 genes significant (D, A, G, B)
  5. 5

    Step 5 — Compare the Two Methods

    Bonferroni identified only 1 significant gene, while Benjamini-Hochberg identified 4. The BH procedure is more powerful (fewer false negatives) because it controls the proportion of false discoveries rather than the probability of any false discovery. In high-dimensional genomics settings, where thousands of genes are tested simultaneously, this difference in power is critical.
    BH is more powerful; Bonferroni is more conservative

SECTION 7

Transparency Remedies: Strengths & Limitations

No single transparency tool is a silver bullet. Each intervention addresses a specific vulnerability in the research pipeline and carries its own trade-offs. The table below compares the four primary transparency mechanisms—pre-registration, Registered Reports, open data and code, and multiverse analysis—across several dimensions relevant to biostatistical practice.

MechanismWhat It PreventsStrengthsLimitations
Pre-RegistrationHARKing, covariate fishing, outcome switchingTimestamps analytic intent; allows separation of confirmatory and exploratory analysesCan be vague or amended after the fact; does not prevent undisclosed deviations
Registered ReportsPublication bias, outcome switching, p-hackingPeer review occurs before data collection; acceptance not contingent on significant resultsSlower publication cycle; not yet adopted by many top journals; may inhibit serendipitous discovery
Open Data & CodeUndetectable errors, hidden analytic flexibilityEnables computational reproducibility; facilitates re-analysis and meta-analysisPrivacy constraints (HIPAA, GDPR); requires curation effort; few incentives for data preparation
Multiverse AnalysisSelective specification reporting, hidden model dependenceShows robustness of findings across all defensible analytic specificationsComputationally expensive; difficult to define the full 'multiverse' of reasonable specifications

Comparison of transparency mechanisms in biostatistical research

✦

KEY TAKEAWAY

Think of transparency tools as layers of an audit system in financial accounting. Pre-registration is the budget (what you planned to spend), open data is the receipt (what actually happened), Registered Reports are the external audit (independent review of the plan), and multiverse analysis is the stress test (what happens under alternative assumptions). No single layer suffices, but together they create a system where errors are caught before they propagate.

SECTION 8

Connections to Advanced Frameworks

The problems with p-hacking and the limitations of null hypothesis significance testing (NHST) have accelerated interest in alternative inferential frameworks. While a full treatment of these alternatives lies beyond this lesson, understanding how they relate to the p-hacking problem provides valuable context for advanced coursework. The table below contrasts the traditional NHST framework with two increasingly prominent alternatives: Bayesian inference and estimation-based approaches (sometimes called the 'New Statistics').

DimensionNHST (P-values)Bayesian InferenceEstimation (Effect Sizes + CIs)
Core questionHow surprising is the data under H₀?How should my beliefs update given the data?How large is the effect, and how precise is our estimate?
Vulnerability to p-hackingHigh — binary threshold invites manipulationLower — Bayes Factors are continuous, but prior selection can be exploitedLower — no binary threshold, but CIs can still be selectively reported
Multiple testingRequires explicit correction (Bonferroni, BH)Naturally handled through hierarchical/multilevel modelsNot directly addressed; meta-analytic aggregation is typical
Transparency needsPre-registration, corrections, full reportingPrior specification must be justified and pre-registeredEffect size reporting standards; open data for meta-analysis

NHST vs. alternative inferential frameworks

A critical point emerges from this comparison: no inferential framework is immune to researcher degrees of freedom. Bayesian analyses can be 'p-hacked' through strategic prior selection, and effect-size estimates can be inflated through the same selective reporting that plagues p-values. The deeper lesson is that transparency is not a feature of any particular statistical method—it is an infrastructure that must be built around whatever method is used. As you progress to courses in Bayesian biostatistics, causal inference, or machine learning, the transparency principles learned here—pre-registration, open analysis pipelines, and honest uncertainty quantification—will remain foundational.

ℹ

Looking Ahead

The 2019 call by over 800 statisticians to 'retire statistical significance' (published in Nature) proposed replacing rigid thresholds with continuous measures of evidence, detailed effect-size reporting, and greater emphasis on thoughtful interpretation over mechanical decision rules. This movement is reshaping how biostatistical results are communicated in medical journals and regulatory submissions.

SECTION 9

Practice Problems

Question 1: CONCEPTUAL

A psychology paper reports testing a single hypothesis (the effect of background music on test performance) and obtaining p = 0.04. However, you learn from the supplementary materials that the researchers initially measured three dependent variables (test score, time to completion, and self-reported confidence) and only reported the one with the lowest p-value. Explain why the reported p = 0.04 is misleading, and estimate the effective α level for the reported result.
Show answer
The reported p-value is misleading because it does not account for the multiplicity of tests conducted. The researchers effectively performed three tests but reported only the most favorable result, a classic instance of p-hacking via selective outcome reporting. The effective family-wise error rate is FWER = 1 − (1 − 0.05)³ ≈ 0.143, meaning there was approximately a 14.3% chance of obtaining at least one significant result across the three tests even if all null hypotheses were true. A Bonferroni-corrected threshold for declaring significance with three tests would be 0.05/3 ≈ 0.0167, and the reported p = 0.04 does not survive this correction. The published finding should be treated as exploratory, not confirmatory.

Question 2: BASIC CALCULATION

A researcher conducts m = 20 independent statistical tests, each at α = 0.05. (a) Calculate the probability that at least one test will produce a false positive, assuming all null hypotheses are true. (b) What Bonferroni-corrected threshold should be used for each individual test to maintain an overall FWER of 0.05?
Show answer
(a) Using the FWER formula: FWER = 1 − (1 − 0.05)²⁰ = 1 − (0.95)²⁰ = 1 − 0.3585 ≈ 0.6415. There is approximately a 64.2% chance of at least one false positive across the 20 tests, dramatically exceeding the intended 5% error rate. (b) The Bonferroni-corrected threshold is α_adj = 0.05/20 = 0.0025. Each individual test must yield p < 0.0025 to be declared significant. This is a conservative correction that guarantees FWER ≤ 0.05 regardless of the correlation structure among tests.

Question 3: INTERMEDIATE

A genomics study tests m = 5 genes for differential expression and obtains the following p-values: 0.003, 0.012, 0.029, 0.044, 0.610. Apply the Benjamini-Hochberg procedure at q = 0.05 to determine which genes are significant. Show your work by computing the BH critical value for each rank.
Show answer
First, rank the p-values from smallest to largest (they are already sorted): p₍₁₎ = 0.003, p₍₂₎ = 0.012, p₍₃₎ = 0.029, p₍₄₎ = 0.044, p₍₅₎ = 0.610. Compute BH critical values: (1/5) × 0.05 = 0.010; (2/5) × 0.05 = 0.020; (3/5) × 0.05 = 0.030; (4/5) × 0.05 = 0.040; (5/5) × 0.05 = 0.050. Starting from the largest rank: rank 5 (0.610 > 0.050, fail), rank 4 (0.044 > 0.040, fail), rank 3 (0.029 ≤ 0.030, pass). Since rank 3 passes, all ranks ≤ 3 are significant. Therefore, genes with p = 0.003, 0.012, and 0.029 are declared significant under BH at FDR = 0.05. Note that the gene with p = 0.044 would be significant under an uncorrected test but does not survive BH correction.

Question 4: APPLIED

You are reviewing a manuscript submitted to a biomedical journal. The authors conducted a randomized controlled trial of a dietary supplement on blood pressure. The pre-registration specified systolic blood pressure at 12 weeks as the primary outcome. However, the manuscript reports diastolic blood pressure at 8 weeks as the primary finding (p = 0.03), mentioning in a footnote that systolic blood pressure at 12 weeks was not significant (p = 0.22). The authors argue that the diastolic result is clinically important. Write a critique addressing the transparency issues and suggest specific remedies.
Show answer
This manuscript exhibits two major transparency violations. First, it involves outcome switching: the pre-registered primary outcome (systolic BP at 12 weeks) was not significant, so the authors substituted a different outcome (diastolic BP at 8 weeks) as the primary finding. Second, the relegation of the pre-registered outcome to a footnote constitutes selective reporting that misleads readers about the study's confirmatory evidence. The reported p = 0.03 should be interpreted as exploratory, not confirmatory, because it was not the pre-specified analysis. Remedies: (1) the paper should present the pre-registered outcome (systolic BP at 12 weeks, p = 0.22) as the primary result; (2) the diastolic finding should be clearly labeled as a secondary or exploratory analysis; (3) if multiple outcomes were examined, a multiple testing correction (such as BH) should be applied; (4) a link to the pre-registration should be prominently displayed so readers can verify the original analysis plan.

Question 5: CRITICAL THINKING

A colleague argues: 'Pre-registration is too rigid for biostatistics. Biological data are messy, and sometimes the most interesting findings are unexpected. Requiring pre-registration will stifle discovery.' Construct a nuanced response that acknowledges the legitimate concern while explaining how modern transparency frameworks accommodate exploratory analysis. Reference at least two specific mechanisms discussed in this lesson.
Show answer
Your colleague raises a legitimate concern: rigid pre-registration could, in theory, prevent researchers from pursuing unexpected patterns in biological data. However, modern transparency frameworks explicitly accommodate exploration. Pre-registration does not prohibit exploratory analyses—it requires that they be clearly labeled as such. A pre-registered analysis plan can specify the confirmatory tests while also describing the conditions under which exploratory analyses will be conducted. Registered Reports, for example, allow an 'exploratory analysis' section that is exempt from the pre-registered plan, provided the results are transparently identified as hypothesis-generating rather than hypothesis-confirming. Multiverse analysis further addresses this concern by systematically reporting results across all defensible analytic specifications, including those discovered during the research process. The key distinction is not between exploration and confirmation but between transparent and opaque exploration. Unmarked exploratory results masquerading as confirmatory findings inflate the false-positive rate, undermine replication, and ultimately waste resources. The goal of transparency is not to eliminate discovery but to ensure that the scientific record accurately distinguishes what was predicted from what was found—a distinction that strengthens, rather than weakens, the credibility of genuinely novel findings.

SUMMARY

Lesson Summary

Summary

P-hacking exploits researcher degrees of freedom—decisions about outliers, variables, covariates, sample sizes, and reporting—to obtain statistically significant results that do not reflect genuine effects. The mathematical consequence is an inflated family-wise error rate (FWER) that can exceed 50% even when only a handful of analytic choices are made. Correction methods such as the Bonferroni correction (α/m) and the Benjamini-Hochberg procedure provide formal tools for controlling Type I errors under multiple testing, with BH offering greater statistical power by controlling the false discovery rate rather than the probability of any single false positive.

Statistical corrections alone are insufficient when the number of tests is concealed. Transparency mechanisms—including pre-registration, Registered Reports, open data and code, and multiverse analysis—address the structural incentives that make p-hacking profitable. The fundamental principle is the separation of confirmatory from exploratory analysis: both are valuable, but only when honestly labeled. As alternative frameworks like Bayesian inference and estimation-based statistics gain prominence, the transparency infrastructure developed in response to the p-hacking crisis will remain essential to credible biostatistical practice.

Varsity Tutors • Biostatistics • P-Hacking & Transparency