Skip to content

Multiple Testing Correction

A p-value is a tail probability under a specified null model. It is not the probability that the reported result is a false positive. The significance level, alpha, specifies the rejection rule before the data are examined. Under a valid test, a true null has a rejection probability no greater than alpha.

If 20,000 tested hypotheses are all true nulls and each test has a false-positive rate of 0.05, the expected number of false positives is 1,000. Independence is not needed for that expectation. The realized count varies, and an experiment containing real effects has fewer than 20,000 true nulls.

Define the family before selecting results

Section titled “Define the family before selecting results”

Specify which hypotheses belong to the analysis, such as all genes in one differential-expression comparison. Apply the correction to that family. Selecting genes because their raw p-values are small and correcting only that selection does not preserve the intended error control.

The family and the error criterion depend on the scientific claim. Bonferroni controls the probability of at least one false rejection in the family. Benjamini-Hochberg controls the expected false discovery proportion under independence or suitable positive dependence. It does not specify the false-positive probability of each selected gene or guarantee a fixed fraction in one experiment.

The CRISPR method lesson defines RRA enrichment and MLE Wald tests as separate gene families. Its comparison preserves each correction and keeps the primary discovery list separate from sensitivity results.

Download pvalues.csv into your working directory. This invented dataset contains 1,000 tests, including 900 nulls and 100 nonzero effects. Its is_true column records the simulation labels; real gene studies do not provide that answer key.

Run each language’s blocks in order. R uses ggplot2, and Python uses pandas, Matplotlib, and statsmodels.

For this simulation, continuous valid null p-values have a uniform distribution. Nonzero effects can add small p-values. A histogram is a diagnostic, but it cannot identify which individual results are true effects. Discrete tests, conservative tests, dependence, or model problems can produce other shapes, so investigate the test and study design before attributing a shape to a fault.

library(ggplot2)
data <- read.csv("pvalues.csv")
dir.create("outputs", showWarnings = FALSE)
histogram <- ggplot(data, aes(pvalue)) +
geom_histogram(binwidth = 0.05, boundary = 0, fill = "#3B6DB3",
color = "white") +
labs(x = "P-value", y = "Number of genes") +
theme_minimal(base_size = 12)
ggsave("outputs/pval-hist-r.png", histogram, width = 5, height = 4, dpi = 150)

Histogram of p-values from the simulated gene tests.

The table reports discoveries and the false discoveries identified by the simulation labels. Its last column is the realized false discovery proportion for this dataset. The false discovery rate is the expectation of that proportion over repeated experiments, with proportion zero when there are no discoveries.

alpha <- 0.05
adjusted <- list(
Raw = data$pvalue,
Bonferroni = p.adjust(data$pvalue, method = "bonferroni"),
BH = p.adjust(data$pvalue, method = "BH")
)
summary_rows <- data.frame()
for (method in names(adjusted)) {
rejected <- adjusted[[method]] <= alpha
discoveries <- sum(rejected)
false_discoveries <- sum(rejected & data$is_true == 0)
proportion <- false_discoveries / max(discoveries, 1)
summary_rows <- rbind(summary_rows, data.frame(
method = method, discoveries = discoveries,
false_discoveries = false_discoveries, proportion = proportion
))
cat(sprintf("%s: discoveries = %d, false = %d, proportion = %.4f\n",
method, discoveries, false_discoveries, proportion))
}
Raw: discoveries = 130, false = 46, proportion = 0.3538
Bonferroni: discoveries = 18, false = 0, proportion = 0.0000
BH: discoveries = 43, false = 2, proportion = 0.0465

Bonferroni rejects fewer hypotheses here because its criterion concerns any false rejection in the family. BH permits more discoveries while controlling a different expected error measure. Neither correction creates biological importance or compensates for invalid individual tests.

summary_rows$method <- factor(summary_rows$method,
levels = c("Raw", "Bonferroni", "BH"))
discovery_plot <- ggplot(summary_rows, aes(method, discoveries)) +
geom_col(fill = "#3B6DB3", width = 0.6) +
geom_text(aes(label = discoveries), vjust = -0.4) +
labs(x = NULL, y = "Rejected hypotheses") +
theme_minimal(base_size = 12)
ggsave("outputs/discoveries-r.png", discovery_plot,
width = 5, height = 4, dpi = 150)

Number of rejected hypotheses under each rule at alpha 0.05.

State the hypothesis family, correction method, and chosen threshold. Report effect estimates and uncertainty alongside adjusted p-values. Describe filtering rules and whether they depend on the test statistic. Use the RNA-seq differential-expression guide for a count-model application.

The paired ATAC-seq lesson defines its hypothesis family over tested genomic regions. Its motif lesson corrects a separate family of enrichment tests and distinguishes those p-values from motif site scores.

The Spatial autocorrelation lesson adjusts eight declared permutation tests with the Benjamini-Hochberg method. Those tests describe one tissue section, so the adjusted p-values say nothing about a difference between donors.

Does a BH-adjusted p-value below 0.05 mean that this particular gene has a 5% probability of being a false discovery?

It does not. BH controls an expected proportion across the discovery procedure under its assumptions. It does not assign a posterior probability to an individual hypothesis.

The R p-value adjustment reference describes Bonferroni, Holm, Benjamini-Hochberg, and Benjamini-Yekutieli corrections. It distinguishes family-wise error control from false discovery rate control and states the dependence conditions.

The ASA release of March 7, 2016 presents six principles for p-value interpretation. It is the announcement of the statement and explains why a p-value does not measure the probability that a hypothesis is true.