Tutorials › Generalized Linear Models › Mid-P Values and Exact-Test Conservatism

Conditional and Exact Inference · Tutorial 957 of 981

Mid-P Values and Exact-Test Conservatism

Learn how mid-P values split the probability of a tied outcome, and why that adjustment trades some conservatism for the loss of guaranteed nominal size.

Advanced 10 min read

What You'll Learn

  • Define conventional and mid-P values for a specified ordering of test-statistic outcomes
  • Prove why a conventional discrete exact p-value is super-uniform under the null
  • Derive the relationship between mid-P values and randomized p-values
  • Calculate both p-values from binomial and conditional hypergeometric distributions
  • Assess when a mid-P test can exceed its nominal type I error rate

Why Discrete Exact Tests Can Be Conservative

In an exact conditional test, inference is based on the null distribution of a statistic given the quantities on which the analysis conditions. That distribution often has only a finite set of possible values. Consequently, a nonrandomized test cannot always attain every desired significance level: its rejection probability changes in jumps as outcomes are added to the rejection region. The result is that a test calibrated to have size at most \(\alpha\) may have size substantially below \(\alpha\).

A mid-P adjustment addresses this discreteness by counting half, rather than all, of the null probability at the observed outcome. This usually reduces a conventional exact p-value, but it also changes what can be guaranteed: a mid-P test need not have type I error probability at most its stated level. To compare the methods precisely, first fix how “at least as extreme” is defined.

Definition: Let \(S\) be a statistic whose larger values are defined as more extreme against a specified null hypothesis. Under the null distribution being used, the conventional upper-tail p-value at observed value \(s\) is \(p(s)=P_0(S\geq s)\). The corresponding mid-P value is \(p_{\mathrm{mid}}(s)=P_0(S>s)+\tfrac12 P_0(S=s)\). For a conditional test, these probabilities are calculated under the null distribution conditional on the specified conditioning event.

The statistic \(S\) also specifies the ordering for a two-sided test. For example, an analysis might define a statistic that increases as outcomes become more discordant with the null, then use the upper tail of that statistic. Alternatively, it might define a two-sided p-value by a particular ordering of outcomes or by combining tail probabilities. Those conventions need not give identical p-values. Once the ordering is fixed, the same comparison applies: the conventional p-value includes the full probability of outcomes tied with the observation, while the mid-P value includes half.

Calculating the Two Values

Worked Example: Splitting the Probability of a Tie

Suppose a null distribution assigns probabilities \(0.50\), \(0.30\), and \(0.20\) to statistic values \(S=0\), \(S=1\), and \(S=2\), respectively, with larger values more extreme. The observed value is \(S=1\).

The outcomes strictly more extreme than the observation have \(S=2\), so their probability is \(0.20\). The probability tied with the observation is \(P_0(S=1)=0.30\). Therefore the conventional value is

$$ p(1)=P_0(S\geq 1)=0.20+0.30=0.50. $$

The mid-P value includes half the tied probability:

$$ p_{\mathrm{mid}}(1)=0.20+\frac12(0.30)=0.35. $$

The adjustment is exactly \(0.15\), half the probability mass at the observed statistic. It does not alter the chosen ordering or the null distribution; it alters only how the observed tie is counted.

For a test that rejects when its p-value is at most \(\alpha\), the test size under a fixed null distribution is the probability of rejection under that null. Conventional p-values have a useful finite-sample guarantee, even when the statistic is discrete.

Theorem: Suppose \(S\) has a finite support under a specified null distribution, and define \(p(s)=P_0(S\geq s)\). Then for every \(0\leq\alpha\leq1\), \(P_0\{p(S)\leq\alpha\}\leq\alpha\). Thus the test that rejects when \(p(S)\leq\alpha\) has size at most \(\alpha\). A p-value with this property is called super-uniform under the null.

Proof. List the distinct support values in increasing order, \(s_1<s_2<\cdots<s_m\), and write \(q_j=P_0(S=s_j)\). The tail probabilities \(p(s_j)=\sum_{k=j}^m q_k\) are nonincreasing in \(j\). Therefore the set of indices \(j\) for which \(p(s_j)\leq\alpha\) is either empty or consists of \(j_0,j_0+1,\ldots,m\) for some \(j_0\). In the empty case the rejection probability is zero. Otherwise,

$$ P_0\{p(S)\leq\alpha\} =\sum_{j=j_0}^m q_j =p(s_{j_0}) \leq\alpha. $$

This proves the claimed bound. The inequality can be strict because the tail probabilities jump over some values of \(\alpha\). \(\square\)

What the Mid-P Adjustment Gives Up

The super-uniformity proof depends on including the whole probability mass at each statistic value in the tail. A mid-P value does not do that, so the proof does not apply. A mid-P test can be less conservative, but there is no general guarantee that its size is at most \(\alpha\) for every \(\alpha\).

Worked Example: A Mid-P Test Above Its Nominal Level

Let \(X\sim\operatorname{Binomial}(4,0.5)\), and test against unusually large values of \(X\). The null probabilities are \(P_0(X=k)=\binom{4}{k}/16\), giving probabilities \(1/16,4/16,6/16,4/16,1/16\) for \(k=0,1,2,3,4\), respectively.

At the most extreme observation, \(X=4\), the conventional upper-tail value and the mid-P value are

$$ p(4)=P_0(X\geq4)=\frac{1}{16}=0.0625,\qquad p_{\mathrm{mid}}(4)=\frac12P_0(X=4)=\frac{1}{32}=0.03125. $$

At level \(\alpha=0.05\), the conventional test rejects for no possible observation: its smallest p-value is \(0.0625\), so its size is zero. For the mid-P test, \(X=4\) is rejected. The next possible observation, \(X=3\), has

$$ p_{\mathrm{mid}}(3) =P_0(X>3)+\frac12P_0(X=3) =\frac{1}{16}+\frac12\frac{4}{16} =\frac{3}{16} =0.1875. $$

Thus only \(X=4\) is rejected, and the null rejection probability is \(P_0(X=4)=1/16=0.0625\), which exceeds \(0.05\). In this example the conventional test is conservative, while the mid-P test crosses the nominal level but has size above it.

The example shows why “less conservative” is not equivalent to “exactly calibrated.” A mid-P procedure can be closer to the nominal level in some settings, but its rejection probability must be assessed as a property of the particular null distribution and decision rule. It may also be below the nominal level; the direction and amount of the discrepancy are not fixed by the definition alone.

Connection to Randomized Exact Tests

There is a precise way to split the tied probability while retaining exact calibration: randomize within the observed tie. Let \(U\sim\operatorname{Uniform}(0,1)\) be independent of \(S\). Define the randomized upper-tail p-value by

$$ p_{\mathrm{rand}}(s,U)=P_0(S>s)+U\,P_0(S=s). $$

Conditional on the observed value \(S=s\), its expectation over the auxiliary randomization is the mid-P value:

$$ E_U[p_{\mathrm{rand}}(s,U)] =P_0(S>s)+\frac12P_0(S=s) =p_{\mathrm{mid}}(s). $$

This identity explains the “half” in mid-P. But averaging the randomized value does not preserve its rejection probability: comparing the average to a threshold is not the same as randomly comparing the original value to that threshold.

Theorem: For a finite-support statistic \(S\), if \(U\) is independent and uniform on \((0,1)\), then \(p_{\mathrm{rand}}(S,U)\) is uniform on \((0,1)\) under the null. Consequently, rejecting when \(p_{\mathrm{rand}}(S,U)\leq\alpha\) has null rejection probability exactly \(\alpha\).

Proof. Write the support in decreasing order, \(s_1>s_2>\cdots>s_m\), and let \(q_j=P_0(S=s_j)\). Set \(a_j=\sum_{k<j}q_k\), the probability of values more extreme than \(s_j\). When \(S=s_j\), the randomized p-value is \(a_j+Uq_j\), which is uniform on the interval \((a_j,a_j+q_j)\). These intervals partition \((0,1)\), apart from their endpoints, and the probability of selecting interval \(j\) is \(q_j\), its length. For any interval \(B\subseteq(a_j,a_j+q_j)\), the probability that the randomized p-value lies in \(B\) is

$$ P_0(S=s_j)\frac{\operatorname{length}(B)}{q_j} =q_j\frac{\operatorname{length}(B)}{q_j} =\operatorname{length}(B). $$

Adding this equality over the partition shows that the randomized p-value assigns each interval its length, which is the uniform distribution on \((0,1)\). Hence \(P_0\{p_{\mathrm{rand}}\leq\alpha\}=\alpha\). \(\square\)

Worked Example: Randomization Recovers the Target Size

Return to \(X\sim\operatorname{Binomial}(4,0.5)\), using the upper-tail test at \(\alpha=0.05\). If \(X=4\), the randomized p-value is \(U/16\), so it is at most \(0.05\) precisely when \(U\leq0.8\). Conditional on \(X=4\), the rejection probability is therefore \(0.8\), and the contribution to the overall null rejection probability is

$$ P_0(X=4)P(U\leq0.8)=\frac{1}{16}(0.8)=0.05. $$

For \(X=3\), the randomized p-value lies between \(1/16=0.0625\) and \(5/16=0.3125\), so it cannot be at most \(0.05\). For \(X\leq2\), the randomized p-value is no smaller than the value at \(X=3\). Thus \(X=4\) is the only possible rejecting outcome, and the total rejection probability is exactly \(0.05\). This exact calibration uses additional randomization; the nonrandomized mid-P test instead rejects all \(X=4\) outcomes and has size \(0.0625\).

A Conditional Table Calculation

Worked Example: Upper-Tail Inference With Fixed Margins

Consider a \(2\times2\) table with both row totals equal to \(4\) and both column totals equal to \(4\). Under the conditional null of no association, let \(X\) be the upper-left cell count. Given these margins, \(X\) has a hypergeometric distribution:

$$ P_0(X=x\mid\text{margins}) =\frac{\binom{4}{x}\binom{4}{4-x}}{\binom{8}{4}}, \qquad x=0,1,2,3,4. $$

Since \(\binom{8}{4}=70\), the numerators for \(x=0,1,2,3,4\) are \(1,16,36,16,1\). The conditional probabilities are therefore \(1/70,16/70,36/70,16/70,1/70\), which sum to \(70/70=1\). For an upper-tail observation \(X=4\), the conventional value is \(1/70\), while the mid-P value is half of that point mass:

$$ p(4)=\frac{1}{70}\approx0.01429,\qquad p_{\mathrm{mid}}(4)=\frac{1}{2}\frac{1}{70} =\frac{1}{140}\approx0.00714. $$

At \(\alpha=0.01\), the conventional test does not reject at \(X=4\), its most extreme possible observation. The mid-P test does reject there. For this fixed set of margins, its conditional null rejection probability is \(1/70\approx0.01429\), exceeding \(0.01\). The calculation is conditional throughout: the relevant size is evaluated in the sample space of tables with these margins.

Interpreting and Reporting the Trade-Off

Conventional exact p-values and mid-P values answer closely related but distinct calibration questions. A conventional p-value includes the observed outcome’s full probability and is super-uniform under the specified null distribution. This guarantees a test size no greater than its nominal level, though discreteness may make the test conservative. A mid-P value halves the observed tie. It can reduce that conservatism, but it is not generally super-uniform and does not guarantee type I error control at every nominal level.

In conditional inference, the guarantee is tied to the conditional null distribution actually used. If a test is applied separately at a fixed conditioning outcome, the conventional bound applies under that conditional law. The mid-P size calculation likewise depends on that law. If a procedure averages over different conditioning outcomes, its overall error rate depends on how those outcomes are distributed and how the test is applied within them.

A useful report identifies the convention rather than presenting a p-value as though there were only one possible discrete calculation. State the test statistic or ordering, the null distribution and conditioning event, and whether the reported value is conventional or mid-P. For consequential decisions, compare the mid-P conclusion with the conventional exact result when the distinction could change the decision.

  • Use the conventional value when guaranteed finite-sample size control at the stated level is required.
  • Consider the mid-P value when reducing discreteness-related conservatism is important, while acknowledging that its type I error can exceed the nominal level.
  • Use randomization only deliberately when exact equality to a target size is desired and randomized decisions are acceptable.

A common mistake is to argue, “The mid-P value is smaller, so the test is more powerful and still exact.” The correction is that a smaller p-value can produce more rejections, but the added rejections may raise the null rejection probability above \(\alpha\). “Exact” should therefore be used carefully: the conventional tail calculation gives a finite-sample size bound, whereas a mid-P adjustment is a different convention with no universal size bound.

Check Your Understanding

Use a fixed null distribution and a specified ordering of outcomes in each answer.

  1. For a statistic with \(P_0(S>s)=0.12\) and \(P_0(S=s)=0.20\), calculate the conventional and mid-P values at \(s\).
  2. Why can a conventional exact test have size below, rather than equal to, its nominal level?
  3. In the binomial example at level \(0.05\), calculate the mid-P value at \(X=3\) and explain why that outcome is not rejected.
  4. What guarantee does the randomized p-value have under the null, and what additional ingredient does it require?
  5. Why must a conditional exact test state both its conditioning event and its ordering of outcomes when reporting a p-value?
Clinical Biostats