Understand the idea
One test at the usual 5% cutoff has a 5% chance of crying wolf. Run twenty tests on data with no real effects anywhere, and the chance that at least one comes back 'significant' by pure luck climbs to roughly 64%. Nothing about any single test changed; you just gave chance twenty rolls of the dice instead of one.
Multiple-testing correction pushes back against that. It takes your whole batch of p-values and stretches them so that the threshold for calling something significant reflects how many chances you took. The output is a column of adjusted p-values you compare to your alpha exactly the way you would compare a single p-value: no extra division, no mental math.
There are two different promises a correction can make. Bonferroni and Holm promise that the chance of even ONE false alarm across the whole family stays at alpha: strict, and conservative. Benjamini-Hochberg instead promises that, among whatever you end up calling significant, only a small fraction (on average) are false alarms: looser, and much more forgiving when you are screening hundreds of tests at once.
A p-value adjustment raises each p-value to allow for how many tests were run; the Bonferroni correction and the Holm correction control the chance of any false alarm, while an FDR correction controls the false discovery rate, the expected share of false alarms among the significant results.
Practitioner explanation
This function does not run any hypothesis tests itself: it takes a column of raw p-values you already have (one row per test in the family, optionally labeled) and adjusts them. KernelStats defaults to Benjamini-Hochberg (the default method option), the FDR-controlling procedure appropriate for screening many tests where a handful of false leads is an acceptable price for power. Holm and Bonferroni are offered for FWER control (Holm is uniformly more powerful than Bonferroni and should be preferred whenever a strict FWER guarantee is required), and Benjamini-Yekutieli is offered for FDR control under arbitrary, possibly negative, dependence among the tests.
The card reports the adjusted p-value per test, how many were significant before and after adjustment (n_significant_raw vs n_significant_adjusted), the fraction of the whole family still significant after adjustment (the number significant after adjustment divided by the number of tests m), and n_dropped for any rows with a missing p-value that were excluded before the family was formed. Rows are validated to be genuine p-values in [0, 1]; a value outside that range or a non-numeric cell fails loudly rather than silently corrupting the ranks that Holm and BH depend on.
The FDR methods' validity depends on the dependence structure among the p-values, which KernelStats cannot verify from a column of p-values alone: it does not know whether the underlying tests were on independent data. BH is derived under independence or positive regression dependence (the common case for tests on different variables of the same study); when tests could be negatively correlated in an unknown way, Benjamini-Yekutieli is the conservative, always-valid choice.
When to use it
Consider it when
You have a whole family of p-values from tests run together (one per variable, per subgroup, per comparison) and need to declare significance without the family-wise error rate or false discovery rate ballooning with the number of tests.
Use caution when
For a single, pre-planned hypothesis test correction is unnecessary and only loses power. It is also not a substitute for pre-registering which comparisons you intended to make: correcting a family assembled AFTER seeing which tests looked interesting (rather than every test you actually ran) does not control anything, because the family is no longer complete.
Formulas and symbols
Bonferroni adjusted p-value
m is the number of tests in the family; p_i the i-th raw p-value.
Benjamini-Hochberg adjusted p-value
p_(1) <= ... <= p_(m) are the sorted raw p-values; the running minimum from the largest rank down keeps the adjusted sequence monotone.
Count of significant tests, before and after
Compared against n_significant_raw (using the unadjusted p_i) to show how many 'discoveries' the correction removes.
Assumptions and checks
- If the input values are not genuine p-values from a correctly specified test (uniform on [0,1] under a true null), every corrected value and the whole family-wise or FDR guarantee is meaningless, not just approximate.
In KernelStats: The card verifies every value lies in [0, 1] and flags any value equal to 1; it cannot verify the values actually come from a correctly specified null distribution.
- The correction only controls error over the exact family of tests supplied. Adding tests after seeing which look significant, or omitting pre-planned tests, invalidates the guarantee even though the arithmetic still runs without complaint.
In KernelStats: Not checked by KernelStats: completeness of the family cannot be verified from the p-values alone; the card states this as a standing reminder on every run.
- Independence of observations. Benjamini-Hochberg's FDR guarantee requires the tests to be independent or positively dependent; under unknown or negative dependence it can let the true false discovery rate run higher than the nominal level.
In KernelStats: Not checked by KernelStats: the dependence structure among the tests is not estimated. The card names the assumption for whichever method was chosen (BH assumes independence/positive dependence; BY and the FWER methods Bonferroni/Holm are valid under any dependence) so the analyst can switch if independence is doubtful.
Alternatives
- One-Way ANOVA. You have one factor with several groups and only need the single omnibus question 'do any groups differ?': the ANOVA F-test already controls the family-wise error rate for that one question without needing a correction; only the follow-up pairwise contrasts need one.
- MANOVA (Multivariate ANOVA). You have several outcome variables compared across the same groups and would rather test the joint hypothesis directly (one MANOVA) than correct many separate univariate tests.
Worked example
Scenario
A screen of 20 candidate biomarkers against an outcome yields 20 independent p-values, 5 of which are below 0.05 raw.
Result
Benjamini-Hochberg adjustment (the KernelStats default) survives 3 of the 5 as significant at FDR = 0.05; Bonferroni, which controls the stricter family-wise error rate, survives only 1.
Interpretation
The two 'discoveries' that Bonferroni drops are not necessarily false: Bonferroni is simply the more conservative guarantee. Reporting which correction was used, and why, is part of reporting the result honestly: FWER and FDR answer different questions and are not interchangeable.
Common misconceptions
Misconception
Once I adjust my p-values, it means my original individual tests were wrong and need to be re-run.
Correction
Each raw p-value is still the correct answer for its own single test in isolation. Adjustment does not recompute anything about the individual test; it recalibrates the THRESHOLD of evidence you demand, because you looked at the data many times instead of once. Compare the adjusted p-value to alpha exactly as you would a single p-value: the raw p-value is not the number to report as 'the' result once you have run a correction.
Misconception
A p-value that was significant raw but stops being significant after FDR correction proves there is no real effect there.
Correction
It means the evidence for that one test is not strong enough once you account for how many tests you ran, not that the effect is zero. A larger, better-powered family-wide study could still find it real.
Read more: Misconception: a non-significant result proves there is no effect
References
- Controlling the False Discovery Rate: A Practical and Powerful Approach to Multiple Testing, Benjamini, Y. and Hochberg, Y. (1995), Journal of the Royal Statistical Society, Series B, 57(1), 289-300.
- A Simple Sequentially Rejective Multiple Test Procedure, Holm, S. (1979), Scandinavian Journal of Statistics, 6(2), 65-70.
