4.6. Additional Comments About Statistical Tests 277
Consider again the situation at the beginning of this section. Suppose we want
to test
H 0 :μ=30,000 versusH 1 : μ =30, 000. (4.6.7)
Supposen=20andα=0.01. Then the rejection rule (4.6.4) becomes
RejectH 0 in favor ofH 1 if
∣
∣
∣XS/−^30 √, 20000
∣
∣
∣≥ 2. 575. (4.6.8)
Figure 4.6.1 displays the power curve for this test whenσ= 5000 is substituted
in forS. For comparison, the power curve for the test with levelα=0.05 is also
shown. The R functionzpowercomputes a version of this figure.
26000 30000 34000
0.8
0.4
0.05
Test of size = 0.01
Test of size = 0.05
( )
Figure 4.6.1:Power curves for the tests of the hypotheses (4.6.7).
This two-sided test for the mean is approximate. If we assume thatXhas a
normal distribution, then, as Exercise 4.6.3 shows, the following test has exact size
αfor testingH 0 :μ=μ 0 versusH 1 :μ =μ 0 :
RejectH 0 in favor ofH 1 if
∣
∣
∣XS/−√μn^0
∣
∣
∣≥tα/ 2 ,n− 1. (4.6.9)
It too has a bowl-shaped power curve similar to Figure 4.6.1, although it is not as
easy to show; see Lehmann (1986).
For computation in R, the codet.test(x,mu=mu0)obtains the two-sidedt-test
of hypotheses (4.6.1), when the R vectorxcontains the sample.
There exists a relationship between two-sided tests and confidence intervals.
Consider the two-sidedt-test (4.6.9). Here, we use the rejection rule with “if and
only if” replacing “if.” Hence, in terms of acceptance, we have
AcceptH 0 if and only ifμ 0 −tα/ 2 ,n− 1 S/
√
n<X<μ 0 +tα/ 2 ,n− 1 S/
√
n.
But this is easily shown to be
AcceptH 0 if and only ifμ 0 ∈(X−tα/ 2 ,n− 1 S/
√
n,X+tα/ 2 ,n− 1 S/
√
n); (4.6.10)