Last Lecture Biostatistics 602 - Statistical Iferece Lecture 22 Hyu Mi Kag April 9th, 2013 Is the exact distributio of LRT statistic typically easy to obtai? How about its asymptotic distributio? For testig which ull/alterative hypotheses is the asymptotic distributio valid? What is a Wald Test? Describe a typical way to costruct a Wald Test Hyu Mi Kag Biostatistics 602 - Lecture 22 April 9th, 2013 1 / 31 Hyu Mi Kag Biostatistics 602 - Lecture 22 April 9th, 2013 2 / 31 Asymptotics of LRT Wald Test Theorem 1031 Cosider testig H 0 : θ = θ 0 vs H 1 : θ θ 0 Suppose X 1,, X are iid samples from f(x θ, ad ˆθ is the MLE of θ, ad f(x θ satisfies certai regularity coditios (eg see misc 1062, the uder H 0 : d 2 log λ(x χ 2 1 as Wald test relates poit estimator of θ to hypothesis testig about θ Defiitio Suppose W is a estimator of θ ad W AN (θ, σw 2 The Wald test statistic is defied as Z = W θ 0 S where θ 0 is the value of θ uder H 0 ad S is a cosistet estimator of σ W Hyu Mi Kag Biostatistics 602 - Lecture 22 April 9th, 2013 3 / 31 Hyu Mi Kag Biostatistics 602 - Lecture 22 April 9th, 2013 4 / 31
Advatage to reportig a test result via a p-value Coclusios from Hypothesis Testig Reject H 0 or accept H 0 If size of the test is (α small, the decisio to reject H 0 is covicig If α is large, the decisio may ot be very covicig Defiitio: p-value A p-value p(x is a test statistic satisfyig 0 p(x 1 for every sample poit x Small values of p(x give evidece that H 1 is true A p-value is valid if, for every θ Ω 0 ad every 0 α 1, Pr(p(X α θ α The size α does ot eed to be predefied Each reader ca choose the α he or she cosiders appropriate Ad the ca compare the reported p(x to α So that each reader ca idividually determie whether these data lead to acceptace or rejectio to H 0 The p-value quatifies the evidece agaist H 0 The smaller the p-value, the stroger, the evidece for rejectig H 0 A p-value reports the results of a test o a more cotiuous scale Rather tha just the dichotomous decisio Accept H 0 or Reject H 0 Hyu Mi Kag Biostatistics 602 - Lecture 22 April 9th, 2013 5 / 31 Hyu Mi Kag Biostatistics 602 - Lecture 22 April 9th, 2013 6 / 31 Costructig a valid p-value Example : Two-sided ormal p-value Theorem 8327 Let W(X be a test statistic such that large values of W give evidece that H 1 is true For each sample poit x, defie p(x = sup Pr(W(X W(x θ θ Ω 0 The p(x is a valid p-value Let X = (X 1,, X be a radom sample from a N (θ, σ 2 populatio Cosider testig H 0 : θ = θ 0 versus H 1 : θ θ 0 1 Costruct a size α LRT test 2 Fid a valid p-value, as a fuctio of x Hyu Mi Kag Biostatistics 602 - Lecture 22 April 9th, 2013 7 / 31 Hyu Mi Kag Biostatistics 602 - Lecture 22 April 9th, 2013 8 / 31
Solutio - Costructig LRT Solutio - Costructig ad Simplifyig the Test Combiig the results together Ω = {(θ, σ 2 : θ R, σ 2 > 0} Ω 0 = {(θ, σ 2 : θ = θ 0, σ 2 > 0} λ(x = sup {(θ,σ 2 :θ=θ 0,σ 2 >0} L(θ, σ 2 x sup {(θ,σ 2 :θ R,σ 2 >0} L(θ, σ 2 x For the deomiator, the MLE of θ ad σ 2 are { ˆθ = X ˆσ 2 = (Xi X 2 = 1 s2 X For the umerator, the MLE of θ ad σ 2 are { ˆθ0 = θ 0 ˆσ 2 0 = (Xi θ 0 2 Hyu Mi Kag Biostatistics 602 - Lecture 22 April 9th, 2013 9 / 31 ( ˆσ 2 λ(x = LRT test rejects H 0 if ad oly if ˆσ 2 0 /2 ( ˆσ 2 /2 c ˆσ 2 0 ( (xi x 2 / (xi θ 0 2 / /2 c (xi x 2 (xi θ 0 2 c Hyu Mi Kag Biostatistics 602 - Lecture 22 April 9th, 2013 10 / 31 Solutio - Simplifyig the LRT Solutio - Obtaiig size α test LRT test rejects H 0 if size α test (xi x 2 (xi s 2 + (x θ 0 2 c x θ 0 1 1 + (x θ c 0 2 (xi x 2 (x θ 0 2 (xi x 2 c x θ 0 c c The ext step is specify c to get Uder H 0 X θ 0 T 1 ( X θ 0 Pr c = α Pr ( T 1 c = α c = t 1,α/2 Therefore, size α LRT test rejects H 0 if ad oly if x θ 0 t 1,α/2 Hyu Mi Kag Biostatistics 602 - Lecture 22 April 9th, 2013 11 / 31 Hyu Mi Kag Biostatistics 602 - Lecture 22 April 9th, 2013 12 / 31
Solutio - p-value from two-sided test Example : Oe-sided ormal p-value For a test statistic W(X = X θ 0, uder H 0, regardless of the value of σ 2, W(X T 1 The, a valid p-value ca be defied by p(x = sup θ Ω 0 Pr(W(X W(x θ, σ 2 = Pr(W(X W(x θ 0, σ 2 = 2 Pr(T 1 W(x [ ] = 2 1 F 1 T 1 {W(x} Let X = (X 1,, X be a radom sample from a N (θ, σ 2 populatio Cosider testig H 0 : θ θ 0 versus H 1 : θ > θ 0 1 Costruct a size α LRT test 2 Fid a valid p-value, as a fuctio of x where F 1 T 1 ( is the iverse CDF of t-distributio with 1 degrees of freedom Hyu Mi Kag Biostatistics 602 - Lecture 22 April 9th, 2013 13 / 31 Hyu Mi Kag Biostatistics 602 - Lecture 22 April 9th, 2013 14 / 31 Costructig LRT test Obtaiig oe-sided p-value As show i previous lectures, the LRT size α test rejects H 0 if W(x = x θ 0 t 1,α Because the ull hypothesis cotais multiple possible θ θ 0, we first wat to show that the supreme i the defiitio of p-value p(x = sup θ Ω 0 Pr(W(X W(x θ, σ 2 always occurs at whe θ = θ 0, ad the value of σ does ot matter Cosider ay θ θ 0 ad ay σ ( X Pr(W(X W(x θ, σ 2 θ0 = Pr ( X θ = Pr = Pr W(x θ, σ2 W(x + θ 0 θ ( T 1 W(x + θ 0 θ Pr (T 1 W(x = Pr ( W(X W(x θ 0, σ 2 θ, σ2 θ, σ2 Hyu Mi Kag Biostatistics 602 - Lecture 22 April 9th, 2013 15 / 31 Hyu Mi Kag Biostatistics 602 - Lecture 22 April 9th, 2013 16 / 31
Obtaiig oe-sided p-value (cot d by coditioig o o sufficiet statistic Thus, the p-value for this oe-side test is p(x = sup θ Ω 0 Pr(W(X W(x θ, σ 2 = Pr(W(X W(x θ 0, σ 2 = Pr(T 1 W(x = 1 F 1 T 1 [W(x] Suppose S(X is a sufficiet statistic for the model {f(x θ : θ Ω 0 } (ot ecessarily icludig alterative hypothesis If the ull hypothesis is true, the coditioal distributio of X give S = s does ot deped o θ Agai, let W(X deote a test statistic where large value give evidece that H 1 is true Defie p(x = Pr(W(X W(x S = S(x If we cosider oly the coditioal distributio, by Theorem 8327, this is a valid p-value, meaig that Pr(p(X α S = s α Hyu Mi Kag Biostatistics 602 - Lecture 22 April 9th, 2013 17 / 31 Hyu Mi Kag Biostatistics 602 - Lecture 22 April 9th, 2013 18 / 31 by coditioig o sufficiet statistic (cot d Example - Fisher s Exact Test The for ay θ Ω 0, ucoditioally we have Pr(p(X α θ = Pr(p(X α S = s Pr(S = s θ s Thus, p(x is a valid p-value s α Pr(S = s θ = α Let X 1 ad X 2 be idepedet observatios with X 1 Biomial( 1, p 1, ad X 2 Biomial( 2, p 2 Cosider testig H 0 : p 1 = p 2 versus H 1 : p 1 > p 2 Fid a valid p-value fuctio Solutio Uder H 0, if we let p deote the commo value of p 1 = p 2 The the joi pmf of (X 1, X 2 is ( ( 1 f(x 1, x 2 p = p x 1 (1 p 1 x 1 2 p x 2 (1 p 2 x 2 x 1 x 2 ( ( 1 2 = p x 1+x 2 (1 p 1+ 2 x 1 x 2 x 1 x 2 Therefore S = X 1 + X 2 is a sufficiet statistic uder H 0 Hyu Mi Kag Biostatistics 602 - Lecture 22 April 9th, 2013 19 / 31 Hyu Mi Kag Biostatistics 602 - Lecture 22 April 9th, 2013 20 / 31
Solutio - Fisher s Exact Test (cot d Exercise 81 Give the value of S = s, it is reasoable to use X 1 as a test statistic ad reject H 0 i favor of H 1 for large values of X 1,because large values of X 1 correspod to small values of X 2 = s X 1 The coditioal distributio of X 1 give S = s is a hypergeometric distributio f(x 1 = x 1 s = ( 1 ( 2 x 1 ( 1 + 2 s s x 1 Thus, the p-value coditioal o the sufficiet statistic s = x 1 + x 2 is p(x 1, x 2 = mi( 1,s j=x 1 f(j s I 1,000 tosses of a coi, 560 heads ad 440 tails appear Is it reasoable to assume that the coi is fair? Justify your aswer Hypothesis Let θ (0, 1 be the probability of head 1 H 0 : θ = 1/2 2 H 1 : θ 1/2 Hyu Mi Kag Biostatistics 602 - Lecture 22 April 9th, 2013 21 / 31 Hyu Mi Kag Biostatistics 602 - Lecture 22 April 9th, 2013 22 / 31 Two possible strategies Asymptotic size α test Performig size α Hypothesis Testig 1 Defie a level α test for a reasoably small α 2 Test whether the observatio rejects H 0 or ot 3 Coclude that H 0 is true or false at level α Obtaiig p-value 1 Obtai a p-value fuctio p(x 2 Compute p-value as a quatitative support for the ull hypothesis 1,000 tosses are large eough to approximate usig CLT ( θ(1 θ X AN θ, A two-sided Wald test statistic ca be defied by Z(X = At level α, the H 0 is rejected if ad oly if 056 05 056 044 1000 X θ 0 X(1 X Z(x > z α/2 = 3822 > z α/2 Hyu Mi Kag Biostatistics 602 - Lecture 22 April 9th, 2013 23 / 31 Hyu Mi Kag Biostatistics 602 - Lecture 22 April 9th, 2013 24 / 31
Hypothesis Testig Usig p-value fuctio If the ormal approximatio is used, the p-value ca be obtaied as Sice z α/2 is 196, 257, ad 442 for α = 005, 001, ad 10 5, respectively, we ca coclude that the coi is biased at level 005 ad 001 However, at the level of 10 5, the coi ca be assumed to be fair Pr( Z(X Z(x = Pr( Z(X 3795 = 132 10 4 So, uder the ull hypothesis, the size of test is less tha 132 10 4, suggestig a strog evidece for rejectig H 0 Hyu Mi Kag Biostatistics 602 - Lecture 22 April 9th, 2013 25 / 31 Hyu Mi Kag Biostatistics 602 - Lecture 22 April 9th, 2013 26 / 31 Exercise 82 Costructig a test based o sufficiet statistic I a give city, it is assume that the umber of automobile accidets i a give year follows a Poisso distributio I past years, the average umber of accidets per year was 15, ad this year it was 10 Is it justified to claim that the accidet rate has dropped? Solutio - Hypothesis X 1 Poisso(λ 1, X 2 Poisso(λ 2 1 H 0 : λ 1 = λ 2 2 H 1 : λ 1 λ 2 Uder H 0, let λ 1 = λ 2 = λ f X (x 1, x 2 λ = Pr(X = x 1 λ Pr(X = x 2 λ = e 2λ λ x 1+x 2 x 1!x 2! Let S = X 1 + X 2 S is sufficiet statistic for λ uder H 0 S Poisso(2λ f S (s λ = Pr(S = s 2λ = e 2λ λ s s! Hyu Mi Kag Biostatistics 602 - Lecture 22 April 9th, 2013 27 / 31 Hyu Mi Kag Biostatistics 602 - Lecture 22 April 9th, 2013 28 / 31
Costructig a test based o sufficiet statistic (cot d Costructig a test based o sufficiet statistic (cot d The coditioal distributio of x give s is f(x 1, x 2 s = f X(x 1, x 2 λ f S (s λ = = e 2λ λ x 1 +x 2 x 1!x 2! e 2λ (2λ s s! s! 2 s x 1!x 2! = ( s x 1 2 s Let W(X = X 1, the the p-value coditioed o sufficiet statistic is p(x = Pr(W(X W(x S = S(x = Pr(X 1 x 1 S = s ( s s x 1 +x 2 ( x1 +x 2 x = 1 x 2 s = 1 2 x 1+x 2 021 j=x 1 j=x 1 where x 1 = 15, x 2 = 10 Therefore, H 0 is ot rejected whe α < 05, ad it is ot reasoable to claim that the accidet rate has dropped Hyu Mi Kag Biostatistics 602 - Lecture 22 April 9th, 2013 29 / 31 Hyu Mi Kag Biostatistics 602 - Lecture 22 April 9th, 2013 30 / 31 Today p-value Fisher s Exact Test Examples of Hypothesis Testig Next Lectures Iterval Estimatio Cofidece Iterval Hyu Mi Kag Biostatistics 602 - Lecture 22 April 9th, 2013 31 / 31