Duality between confidence intervals and hypothesis tests (source code)

= Duality between confidence intervals and hypothesis tests
{title2=$C(x)=\{\theta:H_\theta\text{ is accepted at }x\}$}

Invert a family of <hypothesis tests> by including each parameter value in the <confidence set> exactly when its test does not reject. For any true value $\theta$, the events $\{\theta\notin C(X)\}$ and $\{\text{reject }H_\theta\}$ are identical. Thus size at most $\alpha$ gives coverage at least $1-\alpha$, and exact size gives exact coverage. When the accepted set is an interval, this is a <confidence interval>.

For the normal sample mean with unknown variance, the central <Student t-distribution> interval excludes zero exactly when $|\sqrt n\,\overline X/S|$ exceeds the same two-sided critical quantile. A two-sided <p-value> strictly below $\alpha$ therefore implies exclusion of zero from the matching closed interval. Boundary conventions agree up to events of probability zero in this continuous model.