TUTORIAL 8 SOLUTIONS #9.11.21 Suppose that a single observation X is taken from a uniform density on [0,θ], and consider testing H 0 : θ = 1 versus H 1 : θ =2. (a) Find a test that has significance level α = 0. What is its power? (b) For 0 <α<1, consider the test that rejects when X [0,α]. What is its significance level and power? (c) What is the significance level and power of the test that rejects when X [1 α, 1]? (d) Find another test that has the same significance level and power as the previous one. (e) Does the likelihood ratio test determine a unique rejection region? 1
(f) What happens if the null and alternative hypotheses are interchanged H 0 : θ = 2 versus H 1 : θ =1? Solution a. Such a test is to reject H 0 if X>1 and do not reject H 0 otherwise. Here and α = P (X >1 H 0 )=0, Power = P (X >1 H 1 )=0.5. b. For this test, the significance level is and the power is P (0 <X<α H 0 )=α, P (0 <X<α H 1 )= α 2. 2
c. For this test, the significance level is P (1 α<x<1 H 0 )=α, and the power is P (1 α<x<1 H 1 )= α 2. d. The tests in b. and c. are two different tests with the same significance level and power. e. The likelihood ratio statistic is f 0 (x) f 1 (x) = I{0 <x<1} { (1/2)I{0 <x<2} 2if0<x<1, = 0if1<x<2, where { 1if0<x<1, I{0 <x<1} = 0 otherwise, and { 1if0<x<2, I{0 <x<2} = 0 otherwise. 3
This likelihood ratio statistic takes only values 0 and 2. Note that f 0 (x)/f 1 (x) =2 if and only if 0 <x<1. Hence if α>0, the rejection region is not unique since the set 0 <x<1 needs to be broken up in order to obtain a likelihood ratio test with such an α. For example, b. and c. are likelihood ratio tests with the same significance level α. f. If the null and alternative hypotheses are interchanged, i.e. H 0 : θ = 2 versus H 1 : θ =1, then the significance level and power of the tests in a., b. and c. will be correspondingly different. 4
Now the likelihood ratio test statistic is f 0 (x) (1/2)I{0 <x<2} = f 1 (x) { I{0 <x<1} 1/2 if0<x<1, = if 1 <x<2, which takes values 1/2 and. Given 0 <α<1/2, a likelihood ratio test is: we reject H 0 if and only if X<2α since P (0 <X<2α H 0 )=2α(1/2) = α. This test will have power P (0 <X<2α H 1 )=2α. The likelihood ratio test is again not unique. Another likelihood ratio test with the same significance level and power is: Reject H 0 if and only if 1 2α <X<1. 5
#9.11.24 Let X be a binomial random variable with n trials and probability p of success. a. What is the generalized likelihood ratio for testing H 0 : p =0.5 versus H A : p 0.5? b. Show that the test rejects for large values of X n/2. c. Using the null distribution of X, show how the significance level corresponding to a rejection region X n/2 >kcan be determined. d. If n = 10 and k = 2, what is the significance level of the test? e. Use the normal approximation to the binomial distribution to find the significance level if n = 100 and k = 10. Solution 6
a. The generalized likelihood ratio test statistic is ( nx ) (1/2) n Λ= ( max nx ) 0<p<1 p x (1 p) n x. The denominator is maximized when p = x/n, the mle of p under Ω. Hence Λ=( n/2 x )x ( n/2 n x )n x. b. Λ=( n/2 x )x ( n/2 n x )n x =[( 2x n ) 2x/n (2 2x n ) 2+2x/n ] n/2 =[y y (2 y) (2 y) ] n/2 = [(1 + v) (1+v) (1 v) (1 v) ] n/2, where y =2x/n =1+v. The last expression is symmetric about v = 0 and is a maximum at v =0. 7
Since the test rejects H 0 when Λ is small, it rejects H 0 if and the only if v = 1 2x/n is large. This is equivalent to X n/2 is large. c. The significance level α of the test that rejects H 0 when X n/2 >kis given by P ( X n/2 >k H 0 ). This probability can be determined using the pmf of the B(n, 0.5) distribution. d. If n = 10 and k =2, P ( X n/2 >k H 0 ) = P ( X 5 > 2 H 0 ) = P (X =0 H 0 )+P (X =1 H 0 ) +P (X =2 H 0 )+P (X =8 H 0 ) +P (X =9 H 0 )+P (X =10 H 0 ) =0.11. 8
e. Using the normal approximation to the binomial distribution B(100, 0.5), X is approximately normally distributed with mean 50 and variance np(1 p) = 25. Thus the significance level of the test is P ( X 50 > 10) P ( Z > 2) = 0.046. Here Z N(0, 1). 9
#9.11.30 Suppose that the null hypothesis is true, that the distribution of the test statistic, T say, is continuous with cdf F and that the test rejects for large values of T. Let V denote the p-value of the test. a. Show that V =1 F (T ). b. Conclude that the null distribution of V is uniform.(hint: See Proposition C of Section 2.3.) c. If the null hypothesis is true, what is the probability that the p-value is greater than 0.1? d. Show that the test rejects if V < α has significance level α. 10
Solution a. Let the value of the observed T statistic be T = t. Under H 0, p-value = P (T >t) =1 P (T t) =1 F (t). Hence V =1 F (T ). b. From Proposition C of Section 2.3, F (T ) has the uniform distribution on [0, 1]. The cdf s of F (T ) and 1 F (T ) are the same and so 1 F (T ) also has a uniform distribution on [0, 1]. Hence it follows from a. that V has the uniform distribution on [0, 1]. c. It follows from b. that under H 0, P (V >0.1) = 0.9. 11
d. Consider a test that rejects H 0 if V< α. Then the significance level of this test is P (V <α H 0 )=α since V has the uniform distribution on [0, 1] under H 0. 12
#9.11.40 Consider testing goodness of fit for a multinomial distribution with two cells. Denote the number of observations in each cell by X 1 and X 2 and let the hypothesized probabilities be p 1 and p 2. Pearson s chi-square statistic is equal to 2 (X i np i ) 2. np i i=1 Show that this may be expressed as (X 1 np 1 ) 2 np 1 (1 p 1 ). Because X 1 is binomially distributed, the following holds approximately under the null hypothesis: X 1 np 1 N(0, 1). np1 (1 p 1 ) 13
Thus, the square of the quantity on the left-hand side is approximately distributed as a chi-square random variable with 1 degree of freedom. Solution Observe that p 1 + p 2 = 1 and X 1 + X 2 = n. Then Pearson s chi-square statistic is equal to (X 1 np 1 ) 2 + (X 2 np 2 ) 2 np 1 np 2 = (X 1 np 1 ) 2 + (n X 1 n(1 p 1 )) 2 np 1 n(1 p 1 ) = (X 1 np 1 ) 2 np 1 (1 p 1 ). 14