Statistical tests
All definitions, theorems, proofs and examples appear here verbatim and with the same numbering as in the lecture notes. Shaded boxes marked Learning aid are supplements for practice: learning goals, interactive experiments and self-tests. Proofs are collapsed; “Step by step” reveals them one paragraph at a time.
9.1 Errors and their asymmetry
We use the notions of Definition 2.13, Remark 2.14: a test \(\varphi\colon\X\to[0,1]\) of \(\Theta_0\) against \(\Theta_1\), its power function \(G_\varphi(\vartheta)=\E_\vartheta[\varphi]\) and its level. The four possible situations are summarised as follows.
| decision for \(H_0\) | decision for \(H_1\) (rejection of \(H_0\)) | |
| \(H_0\) is true | correct decision | type I error |
| \(H_1\) is true | type II error | correct decision |
A test of level \(\alpha\) satisfies \(\sup_{\vartheta\in\Theta_0}G_\varphi(\vartheta)\le\alpha\), so its type I error probability is controlled by a value \(\alpha\) chosen in advance. No such control exists for the type II error probability \(1-G_\varphi(\vartheta)\), \(\vartheta\in\Theta_1\), which can be as large as \(1-\alpha\) for parameters close to \(\Theta_0\) (Figure 27). Hence only a rejection of \(H_0\) is a reliable decision: it is either correct or a type I error, which happens with probability at most \(\alpha\). The statement that one wants to establish must therefore be chosen as the alternative \(H_1\); see Example 9.6. Among all tests of level \(\alpha\), one seeks tests whose power \(G_\varphi(\vartheta)\) on \(\Theta_1\) is as large as possible.
- (i)
To check whether a die is fair, let \(X_1,\dots,X_n\) be i.i.d. Bernoulli variables indicating whether the \(i\)-th roll shows a six, with unknown success probability \(p\in\Theta=(0,1)\). The hypothesis is \(\Theta_0=\{1/6\}\), and a natural test rejects it if \(|M-1/6|>c\) for a critical value \(c\).
- (ii)
A vehicle type complies with an emission limit of \(80\) milligrams \(\mathrm{NO}_x\) per kilometre if the mean emission \(\mu\) of independent test drives satisfies \(\mu\le80\). Modelling the measurements as i.i.d. \(\Nor(\mu,\sigma^2)\) with \(\vartheta=(\mu,\sigma)\in\Theta=\R\times(0,\infty)\), the statement \(\mu\le80\) corresponds to \(\Theta_0=(-\infty,80]\times(0,\infty)\).
In both cases, the key question is how to choose the critical value.
9.2 Gauss tests
Consider the Gaussian product model with \(Q_\mu=\Nor(\mu,\sigma_0^2)\), \(\mu\in\Theta=\R\), and known \(\sigma_0>0\). Let \(\mu_0\in\R\), \(\alpha\in(0,1)\), and test \(H_0\colon\mu\le\mu_0\) against \(H_1\colon\mu>\mu_0\) with \[\varphi(\vect X)\coloneqq\1\Big\{M>\mu_0+z_{1-\alpha}\frac{\sigma_0}{\sqrt n}\Big\}.\] Then the power function is \[G_\varphi(\mu)=\Phi\Big(\sqrt n\,\frac{\mu-\mu_0}{\sigma_0}-z_{1-\alpha}\Big),\qquad\mu\in\R.\] It is increasing with \(G_\varphi(\mu_0)=\alpha\), so \(\varphi\) is a test of level \(\alpha\), and \(G_\varphi(\mu)\to1\) as \(n\to\infty\) for every \(\mu>\mu_0\).
Proof
Under \(\P_\mu\), the variable \(Z\coloneqq\sqrt n(M-\mu)/\sigma_0\) is standard normal. With \(\delta\coloneqq\sqrt n(\mu-\mu_0)/\sigma_0\), we obtain \(G_\varphi(\mu)=\P_\mu(Z>z_{1-\alpha}-\delta)=1-\Phi(z_{1-\alpha}-\delta)=\Phi(\delta-z_{1-\alpha})\) by Proposition 6.1 (ii). The remaining claims follow since \(\Phi\) is increasing with \(\Phi(z_{1-\alpha})=1-\alpha\) and \(\delta\to\infty\) for \(\mu>\mu_0\).
□For \(H_0\colon\mu\ge\mu_0\) against \(H_1\colon\mu<\mu_0\), the test \(\1\{M<\mu_0-z_{1-\alpha}\sigma_0/\sqrt n\}\) has level \(\alpha\) and power function \(\Phi\big(\sqrt n(\mu_0-\mu)/\sigma_0-z_{1-\alpha}\big)\), by the same argument.
In the model of Theorem 9.2, the test \[\varphi(\vect X)\coloneqq\1\Big\{\sqrt n\,\frac{|M-\mu_0|}{\sigma_0}>z_{1-\alpha/2}\Big\}\] of \(H_0\colon\mu=\mu_0\) against \(H_1\colon\mu\neq\mu_0\) has the power function \[G_\varphi(\mu)=\Phi(\delta-z_{1-\alpha/2})+\Phi(-\delta-z_{1-\alpha/2}),\qquad\text{where }\delta\coloneqq\sqrt n\,\frac{\mu-\mu_0}{\sigma_0}.\] In particular, \(G_\varphi(\mu_0)=\alpha\), so \(\varphi\) is a test of level \(\alpha\).
Proof
With \(Z\) as in the previous proof, \(\sqrt n(M-\mu_0)/\sigma_0=Z+\delta\), and \(\P_\mu(|Z+\delta|>z_{1-\alpha/2})=1-\Phi(z_{1-\alpha/2}-\delta)+\Phi(-z_{1-\alpha/2}-\delta)\).
□9.3 \(t\)-tests and p-values
If the variance is unknown, we replace \(\sigma_0\) by \(\sqrt{V^*}\) and the normal quantiles by quantiles of the \(t\)-distribution.
Consider the Gaussian product model with \(Q_\vartheta=\Nor(\mu,\sigma^2)\), \(\vartheta=(\mu,\sigma^2)\in\R\times(0,\infty)\), let \(n\ge2\), \(\mu_0\in\R\), \(\alpha\in(0,1)\), and \[T_{\mu_0}\coloneqq\sqrt n\,\frac{M-\mu_0}{\sqrt{V^*}}.\] Each of the following tests has level \(\alpha\):
- (i)
\(\1\{T_{\mu_0}>t_{n-1;1-\alpha}\}\) for \(H_0\colon\mu\le\mu_0\) against \(H_1\colon\mu>\mu_0\);
- (ii)
\(\1\{T_{\mu_0}<-t_{n-1;1-\alpha}\}\) for \(H_0\colon\mu\ge\mu_0\) against \(H_1\colon\mu<\mu_0\);
- (iii)
\(\1\{|T_{\mu_0}|>t_{n-1;1-\alpha/2}\}\) for \(H_0\colon\mu=\mu_0\) against \(H_1\colon\mu\neq\mu_0\).
Proof
Under \(\P_{(\mu,\sigma^2)}\), \(T_\mu\sim t_{n-1}\) by Theorem 6.9 (iv). For (i) and \(\mu\le\mu_0\), we have \(T_{\mu_0}\le T_\mu\), and hence \(\P_{(\mu,\sigma^2)}(T_{\mu_0}>t_{n-1;1-\alpha})\le\P_{(\mu,\sigma^2)}(T_\mu>t_{n-1;1-\alpha})=\alpha\). Part (ii) follows in the same way, and (iii) from the symmetry of \(t_{n-1}\).
□The power functions of the \(t\)-tests can be computed from the noncentral \(t\)-distribution, and they tend to \(1\) as \(n\to\infty\) for every parameter in the alternative; see [Georgii2013,LehmannRomano2022]. Figure 28 compares them with the Gauss tests.
Instead of fixing \(\alpha\) in advance, one often reports the smallest level at which the observation leads to a rejection.
Let \(T\colon\X\to\R\) be a statistic such that large values of \(T\) speak against \(H_0\). For an observation \(\vect x\), the number \[\pv(\vect x)\coloneqq\sup_{\vartheta\in\Theta_0}\P_\vartheta\big(T\ge T(\vect x)\big)\] is called the p-value of \(\vect x\).
The test \(\1\{\pv\le\alpha\}\) has level \(\alpha\) for every \(\alpha\in(0,1)\); see [LehmannRomano2022]. A small p-value means that, under every parameter in the hypothesis, an observation at least as extreme as \(\vect x\) would be unlikely. The p-value is not the probability that \(H_0\) holds.
We continue Example 8.3 and use the one-sided \(t\)-tests of Theorem 9.4 at level \(\alpha=0.05\) with \(t_{8;0.95}=1.860\). The observed test statistic is \(T_{80}=3\cdot(76.44-80)/5.59=-1.907\).
A manufacturer who wants to demonstrate compliance has to choose this statement as the alternative, that is, test \(H_0\colon\mu\ge80\) against \(H_1\colon\mu<80\). Since \[M=76.44<80-1.860\cdot5.59/3=76.53,\] the hypothesis is rejected, and the p-value is \(\P(t_8\le-1.907)\approx0.046\). The rejection is either correct or a type I error, whose probability is at most \(5\%\).
A supervisory authority that wants to demonstrate a violation tests \(H_0\colon\mu\le80\) against \(H_1\colon\mu>80\). Since \(M=76.44\) is not larger than \(80+1.860\cdot5.59/3=83.47\), the hypothesis cannot be rejected, and the p-value is about \(0.954\). This decision is either correct or a type II error, whose probability is not controlled, so it does not show that the vehicle complies with the limit.