Robert_V._Hogg,_Joseph_W._McKean,_Allen_T._Craig

(Jacob Rumans) #1
492 Optimal Tests of Hypotheses

Definition 8.3.1.Let the random variableWbeN(δ,1); let the random variable
V beχ^2 (r),andletW and Vbe independent. The quotient


T=
W

V/r

is said to have anoncentralt-distributionwithrdegrees of freedom and noncen-
trality parameterδ.Ifδ=0, we say thatThas a centralt-distribution.

In the light of this definition, let us reexamine thet-statistics of Examples 6.5.1
and 8.3.1.

Example 8.3.2(Power of the One Samplet-Test).For Example 6.5.1, consider a
more general situation. Assume thatX 1 ,...,Xnis a random sample onXthat has
aN(μ, σ^2 ) distribution. We are interested in testingH 0 :μ=μ 0 versusH 1 :μ =μ 0 ,
whereμ 0 is specified. Then from Example 6.5.1, the likelihood ratio test statistic is


t(X 1 ,...,Xn)=


n(X−μ 0 )




∑n

1

(Xi−X)^2 /(n−1)

=


n(X−μ 0 )/σ




∑n

1

(Xi−X)^2 /[σ^2 (n−1)]

.

The hypothesisH 0 is rejected at levelαif|t|≥tα/ 2 ,n− 1. Supposeμ 1
=μ 0 is an


alternative of interest. BecauseEμ 1 [



nX/σ


nX/σ]=


n(μ 1 −μ 0 )/σ,thepower
of the test to detectμ 1 is


γ(μ 1 )=P(|t|≥tα/ 2 ,n− 1 )=1−P(t≤tα/ 2 ,n− 1 )+P(t≤−tα/ 2 ,n− 1 ), (8.3.5)

wherethas a noncentralt-distribution with noncentrality parameterδ=



n(μ 1 −
μ 0 )/σandn−1 degrees of freedom. This is computed in R by the call
1 - pt(tc,n-1,ncp=delta) + pt(-tc,n-1,ncp=delta)
wheretcistα/ 2 ,n− 1 anddeltais the noncentrality parameterδ.
The following R code computes a graph of the power curve of this test. Notice
that the horizontal range of the plot is the interval [μ 0 − 4 σ/



n, μ 0 +4σ/


n]. As
indicated the parameters need to be set.


Input mu0, sig, n, alpha.


fse = 4*sig/sqrt(n); maxmu = mu0 + fse; tc = qt(1-(alpha/2),n-1)
minmu = mu0 -fse; mu1 = seq(minmu,maxmu,.1)
delta = (mu1-mu0)/(sig/sqrt(n))
gs=1-pt(tc,n-1,ncp=delta) + pt(-tc,n-1,ncp=delta)
plot(gs~mu1,pch=" ",xlab=expression(mu[1]),ylab=expression(gamma))
lines(gs~mu1)
This code is the body of the functiontpowerg.R. Exercise 8.3.5 discusses its use.

Free download pdf