01 / 21

\(p\)-Values &
Test Inversion

Understand how p-values connect hypothesis tests to confidence sets through the elegant duality of test inversion.

Statistics

What Is a \(p\)-Value?

Given a test statistic \( T(X) \) and observed value \( T(x) \), the p-value is the probability, computed under the null hypothesis \( H_0 \), of observing a test statistic at least as extreme as \( T(x) \):

The p-value is not the probability that \( H_0 \) is true. It is a random variable that measures the compatibility of the observed data with the null model. Smaller values indicate stronger evidence against \( H_0 \).

The \(p\)-Value Distribution

p-value Density 0 0.5 1
Under \(H_0\): Uniform(0,1)
Under \(H_1\): skewed right
\(\alpha\)

Anatomy of a Hypothesis Test

\(H_0\): Null
The parameter \(\theta\) lies in a restricted set \(\Theta_0\). This is the "status quo" claim we test against.
\(H_1\): Alternative
The complement \(\Theta_0^c\). The test rejects \(H_0\) in favor of \(H_1\) when evidence is strong enough.
\(\alpha\): Level
Maximum probability of a Type I error: \(\sup_{\theta \in \Theta_0} P_\theta(\text{reject } H_0) \leq \alpha\).

The Duality Between Tests and Confidence Sets

Hypothesis Test
For each \(\theta_0\):
Test \(H_0{:}\;\theta=\theta_0\)
Accept if \(\mathbf{x} \in A(\theta_0)\)
Equivalently:
Accept if \(p(\theta_0) > \alpha\)
invert
Confidence Set
Collect all \(\theta_0\)
not rejected:
\(C(\mathbf{x}) = \{\theta_0 : \mathbf{x} \in A(\theta_0)\}\)
\(= \{\theta_0 : p(\theta_0) > \alpha\}\)

The Test Inversion Theorem

Proof sketch: Fix any true \(\theta^\star\). Then \(\theta^\star \in C(X)\) iff \(X \in A(\theta^\star)\). Since \(A(\theta^\star)\) is the acceptance region of a level-\(\alpha\) test, we have \(P_{\theta^\star}(X \in A(\theta^\star)) \geq 1 - \alpha\).

\(p\)-Value Formulation

Since we reject \( H_0{:}\;\theta = \theta_0 \) whenever \( p(\theta_0) \leq \alpha \), the inverted confidence set can be written purely in terms of p-values:

This is powerful: compute the p-value as a function of \(\theta_0\), then the confidence set is the superlevel set of that function at height \(\alpha\). No separate construction needed.

Pivotal vs. Non-Pivotal Inversion

Pivotal Quantity Direct Inversion
Requirement Distribution of \(Q(X,\theta)\) is free of \(\theta\) Only need a valid level-\(\alpha\) test for each \(\theta_0\)
p-value Exact, from known CDF of pivot May require asymptotic or simulation-based computation
Resulting CI Typically a closed-form interval May be a general set (not necessarily an interval)
Example \(\frac{\bar{X}-\mu}{S/\sqrt{n}} \sim t_{n-1}\) Likelihood ratio test for non-regular models

Visualizing \(p(\theta_0)\) as a Function

\(\theta_0\)
\(p(\theta_0)\)
0 0.5 1
\(\theta_L\)
\(\hat{\theta}\)
\(\theta_U\)
\(\alpha\)
\(C(\mathbf{x})\)

How to Apply Test Inversion

1
Choose a test family. For each \(\theta_0 \in \Theta\), specify a level-\(\alpha\) test of \(H_0{:}\;\theta = \theta_0\) vs. \(H_1{:}\;\theta \neq \theta_0\).
2
Compute \(p(\theta_0)\). For each candidate \(\theta_0\), calculate the p-value of the test using your observed data \(\mathbf{x}\).
3
Form the confidence set. Collect all \(\theta_0\) for which \(p(\theta_0) > \alpha\). This is \(C(\mathbf{x})\).
4
Find boundaries (if interval). Solve \(p(\theta_0) = \alpha\) analytically or numerically to get the endpoints of the confidence interval.

Example 1: Normal Mean

Let \(X_1, \ldots, X_n \stackrel{\text{iid}}{\sim} N(\mu, \sigma^2)\) with \(\sigma^2\) known. Test \(H_0{:}\;\mu = \mu_0\) using the z-test:

Example 2: Likelihood Ratio Inversion

For a general parametric model, use the likelihood ratio test. The LRT statistic for \(H_0{:}\;\theta = \theta_0\) is:

The p-value is \(p(\theta_0) = P(\chi^2_k \geq \Lambda(\theta_0))\). The inverted confidence set is:

Example 3: LRT Contour Visualization

\(\theta_0\)
\(\ell(\theta_0)\)
\(\ell(\hat\theta) - \frac{1}{2}\chi^2_{1,\alpha}\)
\(\hat\theta\)
\(\theta_L\)
\(\theta_U\)
\(C(\mathbf{x})\)

Why Test Inversion Matters

Generality
Works for any parameter in any model: scalar, vector, or functional. No pivot needed.
Unification
Every standard CI (\(z, t, \chi^2, F\)) can be derived as an inverted test. One principle, many CIs.
Non-standard sets
Produces disconnected or unbounded confidence sets when the parameter space or test structure requires it.

Common Mistakes

✕ \(p\)-value = \(P(H_0 \text{ true})\)
The p-value is computed under \(H_0\), not about its truth. It measures data compatibility, not posterior probability.
✕ CI "traps" the parameter
The parameter is fixed; the interval is random. The coverage probability is a pre-data statement about the procedure, not about a specific realized interval.
✕ Ignoring test choice
Inverting a Wald test vs. a LRT vs. a score test gives different confidence sets. The "best" CI depends on which test is most powerful.

Summary: Three Inverted Tests

Wald Test Score Test LRT
Statistic \(\frac{(\hat\theta - \theta_0)^2}{I(\hat\theta)^{-1}}\) \(\frac{U(\theta_0)^2}{I(\theta_0)}\) \(-2\log\frac{L(\theta_0)}{L(\hat\theta)}\)
Null dist. \(\chi^2_1\) \(\chi^2_1\) \(\chi^2_1\)
CI shape Symmetric around \(\hat\theta\) Centered at \(\hat\theta\) (approx.) Contour of \(\ell(\theta)\)
Advantage Simplest computation Evaluated only at \(\theta_0\); no MLE needed Transformation-invariant
Weakness Not invariant to reparametrization May not be an interval Requires full MLE

Question 1 of 5

Under \(H_0\), a valid p-value for a continuous test statistic has which distribution?

Question 2 of 5

In test inversion, a \(1{-}\alpha\) confidence set \(C(\mathbf{x})\) consists of all parameter values \(\theta_0\) such that:

Question 3 of 5

You invert a two-sided z-test of \(H_0{:}\;\mu=\mu_0\) for normal data with known \(\sigma\). The resulting confidence interval is:

Question 4 of 5

Which statement about confidence sets obtained by test inversion is true?

Question 5 of 5

The LRT-based confidence set \(\{\theta_0 : \Lambda(\theta_0) \leq \chi^2_{k,\alpha}\}\) is equivalent to: