Tutorials › High-Dimensional Genomic Data Analysis › Local FDR From P-Values

Empirical Bayes and Local FDR · Tutorial 194 of 795

Local FDR From P-Values

Learn to derive and calculate the two-group local FDR from p-value densities, and to interpret its assumptions, diagnostics, and distinction from a tail-area false discovery rate.

Advanced 12 min read

What You'll Learn

  • State the two-group mixture model for continuous p-values and identify its null and alternative densities.
  • Derive the local FDR as the posterior probability that a test is null, conditional on its p-value.
  • Calculate local FDR values from specified alternative densities and null proportions.
  • Explain how the local FDR changes across the p-value range and why it need not be a monotone function for every alternative density.
  • Distinguish a pointwise local FDR from the false discovery rate among all tests below a p-value threshold.
  • Diagnose problems caused by a misspecified null density, an invalid alternative density, or boundary estimates.

Why a P-Value Has a Posterior Null Probability

A p-value is evidence against a particular null hypothesis, but it is not itself the probability that the null hypothesis is true. In a large genomic analysis, a useful question is instead: among tests with a p-value near \(p\), what proportion are null? The two-group local false discovery rate answers this question by combining a model for the fraction of null tests with the p-value densities expected under the null and the alternative.

For an exact continuous test under a correctly specified null, the p-value is uniformly distributed on \([0,1]\). Small p-values are therefore uncommon among null tests. If alternative tests tend to produce small p-values, their density is concentrated near zero, and an observed small p-value can have a low posterior probability of coming from the null. The calculation is a Bayes rule calculation; its interpretation depends on the mixture model being appropriate.

Definition: Let \(H\) indicate whether a randomly selected test is null: \(H=0\) for a null test and \(H=1\) for a non-null test. Write \(P(H=0)=\pi_0\) and \(P(H=1)=1-\pi_0\). If the p-value \(P\) has density \(f_0(p)\) given \(H=0\), and density \(f_1(p)\) given \(H=1\), its marginal density is \(f(p)=\pi_0f_0(p)+(1-\pi_0)f_1(p)\). At points where \(f(p)>0\), the local false discovery rate is \(\operatorname{lfdr}(p)=P(H=0\mid P=p)=\frac{\pi_0f_0(p)}{\pi_0f_0(p)+(1-\pi_0)f_1(p)}\).

For exact continuous null p-values, \(f_0(p)=1\) for \(0\leq p\leq1\), so the local FDR becomes

$$ \operatorname{lfdr}(p)= \frac{\pi_0}{\pi_0+(1-\pi_0)f_1(p)}. $$

Here \(f_1(p)\) is a density, not the probability that an alternative test has a p-value exactly equal to \(p\). For a continuous variable, that probability is zero; the density describes relative concentration near \(p\). A density value can exceed 1 without being a probability, provided the density is nonnegative and integrates to 1.

Deriving the Posterior Formula

The formula follows by comparing the joint density of a null test and its p-value with the marginal p-value density. For a small interval from \(p\) to \(p+\Delta\), the probability of a null test whose p-value falls in that interval is approximately \(\pi_0 f_0(p)\Delta\). The probability of any test in the same interval is approximately \(f(p)\Delta\). Their ratio tends, as the interval narrows, to the conditional probability of a null test at p-value \(p\).

$$ \begin{aligned} P(H=0\mid P\in[p,p+\Delta]) &\approx \frac{\pi_0 f_0(p)\Delta}{f(p)\Delta}\\ &= \frac{\pi_0 f_0(p)} {\pi_0f_0(p)+(1-\pi_0)f_1(p)}. \end{aligned} $$

The cancellation of \(\Delta\) gives the density version of Bayes’ rule. This derivation requires a valid two-group model with \(0\leq\pi_0\leq1\), nonnegative densities integrating to 1, and a positive marginal density at the p-value being considered. The uniform-null simplification additionally requires exact continuous null p-values from a correctly specified null distribution. If null p-values are conservative, discrete, or affected by a misspecified null, their density need not be 1 and that simplification is not justified.

This is a posterior probability conditional on the observed p-value and the stated model. It is not a frequentist probability that a fixed null hypothesis is true, and it does not by itself establish that a biological effect is absent. The posterior interpretation also depends on treating the null proportion and densities as known; when they are estimated from many tests, the result is an estimated local FDR.

Worked Calculations Across the P-Value Range

Worked Example: A Beta Alternative Density

Suppose, hypothetically, that \(\pi_0=0.9\), the null p-value density is uniform, and the alternative p-value density is \(f_1(p)=0.4p^{-0.6}\) for \(0<p\leq1\). This is a valid density because it is nonnegative and \(\int_0^1 0.4p^{-0.6}\,dp=0.4(1/0.4)=1\). It places more alternative probability near zero. The mixture assumptions are that a test is null with probability 0.9 and, conditional on that status, its p-value follows the stated density.

At \(p=0.01\), the alternative density is \(f_1(0.01)=0.4(0.01)^{-0.6}=6.33957\). Therefore,

$$ \operatorname{lfdr}(0.01) = \frac{0.9}{0.9+0.1(6.33957)} = \frac{0.9}{1.53396} = 0.5867. $$

Under this model, a test with p-value 0.01 has an estimated posterior null probability of about 58.67%. A small p-value does not guarantee a low local FDR: the assumed null proportion is high, and the alternative density, though elevated near zero, does not outweigh the prior null odds by enough to make the posterior null probability small.

At \(p=0.05\), \(f_1(0.05)=0.4(0.05)^{-0.6}=2.41367\), so

$$ \operatorname{lfdr}(0.05) = \frac{0.9}{0.9+0.1(2.41367)} = \frac{0.9}{1.14137} = 0.7885. $$

For comparison, at \(p=0.5\), \(f_1(0.5)=0.606287\), giving \(\operatorname{lfdr}(0.5)=0.9/[0.9+0.1(0.606287)]=0.9369\). At \(p=1\), \(f_1(1)=0.4\) and \(\operatorname{lfdr}(1)=0.9/0.94=0.9574\). In this example the posterior null probability rises as the p-value moves away from the region where the alternative density is concentrated.

Worked Example: A Different Alternative Shape

Suppose instead that \(\pi_0=0.8\) and \(f_1(p)=2(1-p)\) on \([0,1]\). This is nonnegative, and \(\int_0^1 2(1-p)\,dp=[2p-p^2]_0^1=1\), so it is a valid alternative density. With a uniform null density, the two-group local FDR formula applies.

At \(p=0.1\), \(f_1(0.1)=2(0.9)=1.8\). Substitution gives

$$ \operatorname{lfdr}(0.1) = \frac{0.8}{0.8+0.2(1.8)} = \frac{0.8}{1.16} = 0.6897. $$

At \(p=0.6\), \(f_1(0.6)=0.8\), and \(\operatorname{lfdr}(0.6)=0.8/[0.8+0.2(0.8)]=0.8333\). At \(p=0.95\), \(f_1(0.95)=0.1\), giving \(\operatorname{lfdr}(0.95)=0.8/[0.8+0.2(0.1)]=0.9756\). These values illustrate that the local FDR depends on the relative densities and the null proportion, not just on a universal cutoff for p-values. Here it increases with \(p\) because the alternative density decreases across the range.

Worked Example: Using an Estimated Alternative Density

Imagine a hypothetical analysis in which the fitted null proportion is \(\widehat{\pi}_0=0.85\), the null p-value density is taken to be uniform, and a normalized density estimate for the alternative gives \(\widehat f_1(0.02)=4.0\) and \(\widehat f_1(0.20)=1.2\). These density estimates are assumed to come from a nonnegative estimate that integrates to 1; the two displayed values alone would not establish that condition. Plugging them into the mixture formula gives estimated local FDRs.

For a test with p-value 0.02,

$$ \widehat{\operatorname{lfdr}}(0.02) = \frac{0.85}{0.85+0.15(4.0)} = \frac{0.85}{1.45} = 0.5862. $$

For a test with p-value 0.20,

$$ \widehat{\operatorname{lfdr}}(0.20) = \frac{0.85}{0.85+0.15(1.2)} = \frac{0.85}{1.03} = 0.8252. $$

Conditional on these fitted values and the model, the estimated posterior null probabilities are 58.62% and 82.52%, respectively. These are pointwise estimates; estimation error in \(\widehat{\pi}_0\) and \(\widehat f_1\) can affect them, particularly where the density is estimated from sparse data.

Local FDR and Tail-Area Error Rates

The local FDR is a posterior probability at a particular p-value. A tail-area false discovery rate concerns a collection of tests selected by a rule such as \(P\leq t\). Under the same continuous two-group model with a uniform null, the expected fraction of null tests in that tail, expressed as a population conditional probability, is

$$ P(H=0\mid P\leq t) = \frac{\pi_0t}{\pi_0t+(1-\pi_0)F_1(t)}, \qquad F_1(t)=\int_0^t f_1(u)\,du. $$

The numerator is the probability of a null test with p-value at most \(t\), since the null cumulative probability is \(t\). The denominator is the marginal probability of being in that tail. In contrast, \(\operatorname{lfdr}(p)\) compares densities at a particular value \(p\). A tail probability averages evidence over an interval; it is not obtained simply by substituting \(t\) into a local FDR formula. The two summaries answer different questions and can differ substantially.

A useful way to read the local formula is through posterior odds. For a uniform null and positive \(f_1(p)\), the posterior odds of null to alternative are \(\operatorname{lfdr}(p)/[1-\operatorname{lfdr}(p)]=\pi_0/[(1-\pi_0)f_1(p)]\). Thus, at a point where the alternative density is high relative to the null density, the posterior null probability falls. When the alternative density is low, it rises. A nonmonotone alternative density can produce a nonmonotone local FDR; no general monotonicity claim follows from the two-group formula alone.

Diagnostics, Assumptions, and Limitations

Before interpreting local FDR values, check the ingredients of the calculation. The null p-value distribution should be uniform when the continuous null is exact; systematic departures can indicate calibration problems or a model that does not represent the null tests. The estimated alternative density should be nonnegative, integrate to 1, and be estimated stably over the p-value range where local FDRs are reported. A density estimate that is negative, poorly normalized, or erratic at the boundaries cannot be inserted uncritically into Bayes’ formula.

The mixture interpretation also requires that the tests being pooled can reasonably be described by a common null proportion and component densities. Tests with very different calibration or alternative behavior may need a more appropriate stratified or otherwise structured model. Dependence among tests does not, by itself, change the one-test Bayes identity when the marginal mixture model is correct. However, dependence can matter for estimating the mixture from a collection of tests and for assessing how stable the fitted quantities are.

Boundary behavior deserves attention. Continuous p-values equal exactly to 0 with probability zero under the model, so an observed zero often reflects rounding or finite numerical precision. If an alternative density becomes unbounded as \(p\) approaches zero, the local FDR may have a well-defined limit there even though the density at zero is not finite. Do not treat a rounded zero as an ordinary interior p-value without considering how it was produced. Conversely, when the alternative density is very small, the local FDR can be close to 1; that is not a calculation failure if the fitted model supports it.

A common mistake is to say, “The p-value is 0.01, so there is a 1% probability the null is true,” or to equate a small p-value directly with a small local FDR. A p-value is a tail probability calculated under a null model, whereas the local FDR is a posterior probability that also depends on \(\pi_0\) and the alternative density. Another mistake is to use a tail-area error rate as though it were the local FDR at its threshold. The correction is to state which conditional probability is being calculated, use the matching density or cumulative probability, and report the model assumptions that support its interpretation.

Key takeaway: With exact continuous null p-values, the local FDR at \(p\) is \(\pi_0/[\pi_0+(1-\pi_0)f_1(p)]\). Its value is determined jointly by the null proportion and the alternative density at that p-value; it is neither the p-value itself nor the false discovery rate for all tests below a threshold.

Check Your Understanding

Answer each question using the two-group continuous p-value model. Solutions follow the questions.

  1. With a uniform null density, \(\pi_0=0.75\), and \(f_1(0.1)=2\), calculate the local FDR at \(p=0.1\).
  2. Why does a density value such as \(f_1(p)=3\) not violate the requirement that probabilities lie between 0 and 1?
  3. State the additional condition needed to replace \(f_0(p)\) by 1 in the general local FDR formula.
  4. Explain why a tail-area false discovery rate at threshold \(t\) is not generally equal to \(\operatorname{lfdr}(t)\).
  5. If \(f_1(p)\) is smaller at one p-value than at another, with the same \(\pi_0\) and uniform null, what happens to the local FDR at the first p-value?

Solutions. (1) \(\operatorname{lfdr}(0.1)=0.75/[0.75+0.25(2)]=0.75/1.25=0.6000\). (2) A density is probability per unit of p-value, not a probability at a point; it may exceed 1 while remaining nonnegative and integrating to 1 over \([0,1]\). (3) The null p-values must be exact and continuous under a correctly specified null, making their density uniform on \([0,1]\). (4) The tail-area rate uses probabilities integrated over all p-values at most \(t\), while the local FDR uses the component densities at the single value \(t\). (5) The local FDR is larger at the first p-value, because a smaller alternative density means less alternative weight relative to the uniform null density.

Clinical Biostats