The ideas of test statistics and pivots are very closely related.

Pivot for parameter \(\theta\)
A pivot is a function of the data and parameters whose distribution does not depend on any unknown parameters,
\[ Q \;\;=\;\; g(X_1, \dots, X_n, \theta) \;\;\sim\;\; \mathcal{Standard\;distn} \]
Test statistic for null hypothesis \(\theta = \theta_0\)
This is a function of the data (and known constants such as \(\theta_0\)) whose distribution does not depend on any unknown parameters,
\[ Q \;\;=\;\; g(X_1, \dots, X_n, \theta_0) \;\;\sim\;\; \mathcal{Standard\;distn} \]

If a function \(g(X_1, \dots, X_n, \theta)\) can be used as a pivot for \(\theta\), then \(g(X_1, \dots, X_n, \theta_0)\) can be used as a test statistic for testing whether \(\theta = \theta_0\).

To simplify the notation, we will express the distributions as \(Q(\theta) \sim \mathcal{Standard\;distn}\).

Relationship between confidence interval and test

Confidence intervals and tests about the parameter \(\theta\) are also closely related. The diagram below illustrates a possible standard distribution for \(Q(\theta) \sim \mathcal{Standard\;distn}\). The distribution could be a \(\NormalDistn(0,1)\) distribution, a \(\ChiSqrDistn(k \text{ df})\) distribution or any other standard distribution.

Quantiles of this distribution have also been shown with tail probabilities of \(\frac {\alpha}{2}\) in each tail and probability \((1 - \alpha)\) between them.

\((1 - \alpha)\) confidence interval for parameter \(\theta\)
The confidence interval consists of the values of the parameter that result in the pivot, \(Q(\theta)\), being in the middle \((1 - \alpha)\) of the distribution,

Two-tailed test for H0: \(\theta = \theta_0\) at significance level \(\alpha\)
We reject the null hypothesis if the value of the test statistic, \(Q(\theta_0)\), is in one of the two tails of the distribution (with total tail area \(\alpha\)),

Because of this relationship between confidence intervals and tests, we can perform a hypothesis test from a confidence interval.

Test from confidence interval

If we reject the null hypothesis in a 2-tailed test about whether \(\theta = \theta_0\) when the parameter value \(\theta_0\) is outside a \((1 - \alpha)\) confidence interval for \(\theta\), then the test has significance level \(\alpha\).

Similarly, we can find a confidence interval based on a hypothesis test.

Confidence interval from test

A \((1 - \alpha)\) confidence interval can be found as the values \(\theta_0\) that are not rejected by a 2-tailed test of whether \(\theta = \theta_0\) at significance level \(\alpha\).

We will give examples of both in the following pages.