hypothesis testing lecture 18 biostatistics 602
play

Hypothesis Testing Lecture 18 Biostatistics 602 - Statistical - PowerPoint PPT Presentation

. . March 21th, 2013 Biostatistics 602 - Lecture 18 Hyun Min Kang March 21th, 2013 Hyun Min Kang Hypothesis Testing Lecture 18 Biostatistics 602 - Statistical Inference . Summary . . Hypothesis Testing Recap . . . . . . . . . .


  1. • One-sided hypothesis: H • One-sided hypothesis: H • Two-sided hypothesis: H . Composite hypothesis . . vs H . vs H . . vs H . Hyun Min Kang Biostatistics 602 - Lecture 18 March 21th, 2013 . 9 / 35 . . . . Simple hypothesis . . Simple and composite hypothesis Summary . Hypothesis Testing Recap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Both H 0 and H 1 consist of only one parameter value. • H 0 : θ = θ 0 ∈ Ω 0 • H 1 : θ = θ 1 ∈ Ω c 0 One or both of H 0 and H 1 consist more than one parameter values.

  2. • One-sided hypothesis: H • Two-sided hypothesis: H . . March 21th, 2013 Biostatistics 602 - Lecture 18 Hyun Min Kang . vs H . vs H . . Composite hypothesis . 9 / 35 . . . . . Simple hypothesis . Simple and composite hypothesis Summary . . Hypothesis Testing Recap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Both H 0 and H 1 consist of only one parameter value. • H 0 : θ = θ 0 ∈ Ω 0 • H 1 : θ = θ 1 ∈ Ω c 0 One or both of H 0 and H 1 consist more than one parameter values. • One-sided hypothesis: H 0 : θ ≤ θ 0 vs H 1 : θ > θ 0 .

  3. • Two-sided hypothesis: H . . March 21th, 2013 Biostatistics 602 - Lecture 18 Hyun Min Kang . vs H . . Composite hypothesis . . . 9 / 35 Simple hypothesis Recap Simple and composite hypothesis . . . Summary . Hypothesis Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Both H 0 and H 1 consist of only one parameter value. • H 0 : θ = θ 0 ∈ Ω 0 • H 1 : θ = θ 1 ∈ Ω c 0 One or both of H 0 and H 1 consist more than one parameter values. • One-sided hypothesis: H 0 : θ ≤ θ 0 vs H 1 : θ > θ 0 . • One-sided hypothesis: H 0 : θ ≥ θ 0 vs H 1 : θ < θ 0 .

  4. . . March 21th, 2013 Biostatistics 602 - Lecture 18 Hyun Min Kang . . Composite hypothesis . . . Simple hypothesis . Simple and composite hypothesis Recap . . . . Summary . . . . . . . Hypothesis Testing 9 / 35 . . . . . . . . . . . . . . . . . . . . . . . . . . . Both H 0 and H 1 consist of only one parameter value. • H 0 : θ = θ 0 ∈ Ω 0 • H 1 : θ = θ 1 ∈ Ω c 0 One or both of H 0 and H 1 consist more than one parameter values. • One-sided hypothesis: H 0 : θ ≤ θ 0 vs H 1 : θ > θ 0 . • One-sided hypothesis: H 0 : θ ≥ θ 0 vs H 1 : θ < θ 0 . • Two-sided hypothesis: H 0 : θ = θ 0 vs H 1 : θ ̸ = θ 0 .

  5. . . March 21th, 2013 Biostatistics 602 - Lecture 18 Hyun Min Kang Two-sided composite hypothesis. (some effect) H (no effect) H i.i.d. 10 / 35 An Example of Hypothesis Summary . Hypothesis Testing Recap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . X 1 , · · · , X n ∼ N ( θ, 1) Let X i is the change in blood pressure after a treatment.

  6. . An Example of Hypothesis March 21th, 2013 Biostatistics 602 - Lecture 18 Hyun Min Kang Two-sided composite hypothesis. (some effect) (no effect) . i.i.d. 10 / 35 Summary . . . . . . . . . . . Recap Hypothesis Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . X 1 , · · · , X n ∼ N ( θ, 1) Let X i is the change in blood pressure after a treatment. : θ = 0 H 0 : θ ̸ = 0 H 1

  7. • One may want the proportion to be less than a specified maximum • We want to test whether the products produced by the machine is . March 21th, 2013 Biostatistics 602 - Lecture 18 Hyun Min Kang (unacceptable) H (acceptable) H acceptable. . acceptable proportion 11 / 35 . Another Example of Hypothesis Summary . Hypothesis Testing Recap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . • Let θ denotes the proportion of defective items from a machine.

  8. • We want to test whether the products produced by the machine is . . March 21th, 2013 Biostatistics 602 - Lecture 18 Hyun Min Kang (unacceptable) H (acceptable) H acceptable. 11 / 35 Another Example of Hypothesis Summary . Hypothesis Testing Recap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . • Let θ denotes the proportion of defective items from a machine. • One may want the proportion to be less than a specified maximum acceptable proportion θ 0 .

  9. . Another Example of Hypothesis March 21th, 2013 Biostatistics 602 - Lecture 18 Hyun Min Kang (unacceptable) H (acceptable) H acceptable. . 11 / 35 Summary . Hypothesis Testing Recap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . • Let θ denotes the proportion of defective items from a machine. • One may want the proportion to be less than a specified maximum acceptable proportion θ 0 . • We want to test whether the products produced by the machine is

  10. . Summary March 21th, 2013 Biostatistics 602 - Lecture 18 Hyun Min Kang (unacceptable) (acceptable) acceptable. . Another Example of Hypothesis 11 / 35 . . . Recap . . Hypothesis Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . • Let θ denotes the proportion of defective items from a machine. • One may want the proportion to be less than a specified maximum acceptable proportion θ 0 . • We want to test whether the products produced by the machine is : θ ≤ θ 0 H 0 : θ > θ 0 H 1

  11. . W x (the subset of sample space for which H is rejected is called the rejection region or critical region). Rejection region ( R ) on a hypothesis is usually defined through a test statistic W X . For example, R x c x . R x W x c x Hyun Min Kang Biostatistics 602 - Lecture 18 March 21th, 2013 2 For which sample points H is rejected and H is accepted as true . . sample space for which H is accepted is called the acceptable region). . . . . . . . . . . Recap Hypothesis Testing . Summary Hypothesis Testing Procedure A hypothesis testing procedure is a rule that specifies: . . 1 For which sample points H is accepted as true (the subset of the 12 / 35 . . . . . . . . . . . . . . . . . . . . . . . . . . .

  12. . W x (the subset of sample space for which H is rejected is called the rejection region or critical region). Rejection region ( R ) on a hypothesis is usually defined through a test statistic W X . For example, R x c x . R x W x c x Hyun Min Kang Biostatistics 602 - Lecture 18 March 21th, 2013 2 For which sample points H is rejected and H is accepted as true . . Recap . . . . . . . . . . Hypothesis Testing . Summary Hypothesis Testing Procedure A hypothesis testing procedure is a rule that specifies: . . 12 / 35 . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 For which sample points H 0 is accepted as true (the subset of the sample space for which H 0 is accepted is called the acceptable region).

  13. . c x rejection region or critical region). Rejection region ( R ) on a hypothesis is usually defined through a test statistic W X . For example, R x W x R . x W x c x Hyun Min Kang Biostatistics 602 - Lecture 18 March 21th, 2013 . . 12 / 35 Hypothesis Testing . . . . . . . . . . Recap . Summary Hypothesis Testing Procedure A hypothesis testing procedure is a rule that specifies: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 For which sample points H 0 is accepted as true (the subset of the sample space for which H 0 is accepted is called the acceptable region). 2 For which sample points H 0 is rejected and H 1 is accepted as true (the subset of sample space for which H 0 is rejected is called the

  14. . A hypothesis testing procedure is a rule that specifies: March 21th, 2013 Biostatistics 602 - Lecture 18 Hyun Min Kang Rejection region ( R ) on a hypothesis is usually defined through a test rejection region or critical region). . . . . . 12 / 35 Hypothesis Testing Procedure . . Hypothesis Testing Recap . . . . . . . . . Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 For which sample points H 0 is accepted as true (the subset of the sample space for which H 0 is accepted is called the acceptable region). 2 For which sample points H 0 is rejected and H 1 is accepted as true (the subset of sample space for which H 0 is rejected is called the statistic W ( X ) . For example, = { x : W ( x ) > c , x ∈ X} R 1 { x : W ( x ) ≤ c , x ∈ X} = R 2

  15. • Test 1 : Reject H if x • Test 2 : Reject H if x . . March 21th, 2013 Biostatistics 602 - Lecture 18 Hyun Min Kang x i x rejection region = rejection region = x i x rejection region = rejection region = 13 / 35 . . . . . . . . . . i.i.d. Example of hypothesis testing Summary . Hypothesis Testing Recap . . . . . . . . . . . . . . . . . . . . . . . . . . . ∼ Bernoulli ( p ) . Consider hypothesis tests X 1 , X 2 , X 3 p ≤ 0 . 5 : H 0 : p > 0 . 5 H 1

  16. • Test 2 : Reject H if x . i.i.d. March 21th, 2013 Biostatistics 602 - Lecture 18 Hyun Min Kang x i x rejection region = rejection region = . 13 / 35 Example of hypothesis testing Hypothesis Testing Summary . . . . . . . . . . . Recap . . . . . . . . . . . . . . . . . . . . . . . . . . . ∼ Bernoulli ( p ) . Consider hypothesis tests X 1 , X 2 , X 3 p ≤ 0 . 5 : H 0 : p > 0 . 5 H 1 • Test 1 : Reject H 0 if x ∈ { (1 , 1 , 1) } ⇐ ⇒ rejection region = { (1 , 1 , 1) } ⇐ ⇒ rejection region = { x : ∑ x i > 2 }

  17. . . March 21th, 2013 Biostatistics 602 - Lecture 18 Hyun Min Kang . i.i.d. Example of hypothesis testing Summary 13 / 35 Hypothesis Testing Recap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ∼ Bernoulli ( p ) . Consider hypothesis tests X 1 , X 2 , X 3 p ≤ 0 . 5 : H 0 : p > 0 . 5 H 1 • Test 1 : Reject H 0 if x ∈ { (1 , 1 , 1) } ⇐ ⇒ rejection region = { (1 , 1 , 1) } ⇐ ⇒ rejection region = { x : ∑ x i > 2 } • Test 2 : Reject H 0 if x ∈ { (1 , 1 , 0) , (1 , 0 , 1) , (0 , 1 , 1) , (1 , 1 , 1) } ⇐ ⇒ rejection region = { (1 , 1 , 0) , (1 , 0 , 1) , (0 , 1 , 1) , (1 , 1 , 1) } ⇐ ⇒ rejection region = { x : ∑ x i > 1 }

  18. . H s X n . Decision Truth Accept H Reject H Correct Decision x Type I error H Type II error Correct Decision Hyun Min Kang Biostatistics 602 - Lecture 18 March 21th, 2013 x An example rejection region R . Hypothesis Testing . . . . . . . . . . Recap . Summary Example 14 / 35 . . . . . . . . . . . . . . . . . . . . . . . . . . . Let X 1 , · · · , X n be changes in blood pressure after a treatment. : θ = 0 H 0 : θ ̸ = 0 H 1

  19. . Correct Decision . Decision Truth Accept H Reject H H Type I error . H Type II error Correct Decision Hyun Min Kang Biostatistics 602 - Lecture 18 March 21th, 2013 x 14 / 35 Example . . . . . . . . . . Recap Summary . Hypothesis Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . Let X 1 , · · · , X n be changes in blood pressure after a treatment. : θ = 0 H 0 : θ ̸ = 0 H 1 { } An example rejection region R = x : s X / √ n > 3

  20. . . March 21th, 2013 Biostatistics 602 - Lecture 18 Hyun Min Kang Correct Decision Type II error Type I error Correct Decision Truth Decision . x 14 / 35 . Hypothesis Testing . . . . . . . . . . Example Recap Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . Let X 1 , · · · , X n be changes in blood pressure after a treatment. : θ = 0 H 0 : θ ̸ = 0 H 1 { } An example rejection region R = x : s X / √ n > 3 Accept H 0 Reject H 0 H 0 H 1

  21. c (if the alternative hypothesis is true), the probability of making a If . . . . . . . . Type II error type II error is Pr X R Pr X R Hyun Min Kang Biostatistics 602 - Lecture 18 March 21th, 2013 . . . Hypothesis Testing . . . . . . . . . . Recap . Summary Type I and Type II error . Type I error . . error is 15 / 35 . . . . . . . . . . . . . . . . . . . . . . . . . . . If θ ∈ Ω 0 (if the null hypothesis is true), the probability of making a type I Pr ( X ∈ R | θ )

  22. . Type I error March 21th, 2013 Biostatistics 602 - Lecture 18 Hyun Min Kang type II error is . . Type II error . error is . . . . Recap . . . . Type I and Type II error . . . . . . Hypothesis Testing . Summary 15 / 35 . . . . . . . . . . . . . . . . . . . . . . . . . . . If θ ∈ Ω 0 (if the null hypothesis is true), the probability of making a type I Pr ( X ∈ R | θ ) If θ ∈ Ω c 0 (if the alternative hypothesis is true), the probability of making a ∈ R | θ ) = 1 − Pr ( X ∈ R | θ ) Pr ( X /

  23. c (alternative is true), the probability of rejecting H is called the • Probability of type I error = • Probability of type II error = c . power of test for this particular value of . if . if . If for all , for all c , which is typically not possible in practice. Hyun Min Kang Biostatistics 602 - Lecture 18 March 21th, 2013 An ideal test should have power function satisfying 16 / 35 . Hypothesis Testing . . . . . . . . . . Recap . Summary Power function . Definition - The power function . . The power function of a hypothesis test with rejection region R is the . . . . . . . . . . . . . . . . . . . . . . . . . . . function of θ defined by β ( θ ) = Pr ( X ∈ R | θ ) = Pr ( reject H 0 | θ )

  24. • Probability of type I error = • Probability of type II error = . . March 21th, 2013 Biostatistics 602 - Lecture 18 Hyun Min Kang c , which is typically not possible in practice. for all , for all An ideal test should have power function satisfying c . if . if 16 / 35 The power function of a hypothesis test with rejection region R is the . . . . . . . . . . . Recap Hypothesis Testing Summary Power function . Definition - The power function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . function of θ defined by β ( θ ) = Pr ( X ∈ R | θ ) = Pr ( reject H 0 | θ ) If θ ∈ Ω c 0 (alternative is true), the probability of rejecting H 0 is called the power of test for this particular value of θ .

  25. • Probability of type II error = . . March 21th, 2013 Biostatistics 602 - Lecture 18 Hyun Min Kang c , which is typically not possible in practice. for all , for all An ideal test should have power function satisfying c . if . The power function of a hypothesis test with rejection region R is the 16 / 35 . Definition - The power function . . . . . . . . . . Recap Hypothesis Testing . Summary Power function . . . . . . . . . . . . . . . . . . . . . . . . . . . . function of θ defined by β ( θ ) = Pr ( X ∈ R | θ ) = Pr ( reject H 0 | θ ) If θ ∈ Ω c 0 (alternative is true), the probability of rejecting H 0 is called the power of test for this particular value of θ . • Probability of type I error = β ( θ ) if θ ∈ Ω 0 .

  26. . Definition - The power function March 21th, 2013 Biostatistics 602 - Lecture 18 Hyun Min Kang c , which is typically not possible in practice. for all , for all An ideal test should have power function satisfying . . . The power function of a hypothesis test with rejection region R is the . Power function . . . . . . . . . . Recap Hypothesis Testing 16 / 35 . Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . function of θ defined by β ( θ ) = Pr ( X ∈ R | θ ) = Pr ( reject H 0 | θ ) If θ ∈ Ω c 0 (alternative is true), the probability of rejecting H 0 is called the power of test for this particular value of θ . • Probability of type I error = β ( θ ) if θ ∈ Ω 0 . • Probability of type II error = 1 − β ( θ ) if θ ∈ Ω c 0 .

  27. . Power function March 21th, 2013 Biostatistics 602 - Lecture 18 Hyun Min Kang The power function of a hypothesis test with rejection region R is the . . Definition - The power function . . Summary . . . . 16 / 35 . . . . . . . Recap Hypothesis Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . function of θ defined by β ( θ ) = Pr ( X ∈ R | θ ) = Pr ( reject H 0 | θ ) If θ ∈ Ω c 0 (alternative is true), the probability of rejecting H 0 is called the power of test for this particular value of θ . • Probability of type I error = β ( θ ) if θ ∈ Ω 0 . • Probability of type II error = 1 − β ( θ ) if θ ∈ Ω c 0 . An ideal test should have power function satisfying β ( θ ) = 0 for all θ ∈ Ω 0 , β ( θ ) = 1 for all θ ∈ Ω c 0 , which is typically not possible in practice.

  28. . . x x x i x i . . 1 Compute the power function . Test 1 rejects H if and only if all ”success” are observed. i.e. 2 What is the maximum probability of making type I error? . . 3 What is the probability of making type II error if ? Hyun Min Kang Biostatistics 602 - Lecture 18 March 21th, 2013 R H . . . . . . . . . . . . Recap Hypothesis Testing Summary H Example of power function . Problem . . i.i.d. 17 / 35 . . . . . . . . . . . . . . . . . . . . . . . . . . . X 1 , X 2 , · · · , X n ∼ Bernoulli ( θ ) where n = 5 .

  29. . 1 Compute the power function R x x x i x i . . . . . 2 What is the maximum probability of making type I error? . . 3 What is the probability of making type II error if ? Hyun Min Kang Biostatistics 602 - Lecture 18 March 21th, 2013 Test 1 rejects H if and only if all ”success” are observed. i.e. 17 / 35 Example of power function Problem Recap Hypothesis Testing . Summary . . . . . i.i.d. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . X 1 , X 2 , · · · , X n ∼ Bernoulli ( θ ) where n = 5 . : θ ≤ 0 . 5 H 0 : θ > 0 . 5 H 1

  30. . 2 What is the maximum probability of making type I error? R . . 1 Compute the power function . . . i.i.d. . 3 What is the probability of making type II error if ? Hyun Min Kang Biostatistics 602 - Lecture 18 March 21th, 2013 . 17 / 35 Example of power function Summary . Problem . Hypothesis Testing Recap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . X 1 , X 2 , · · · , X n ∼ Bernoulli ( θ ) where n = 5 . : θ ≤ 0 . 5 H 0 : θ > 0 . 5 H 1 Test 1 rejects H 0 if and only if all ”success” are observed. i.e. = { x : x = (1 , 1 , 1 , 1 , 1) } 5 ∑ { x : x i = 5 } = i =1

  31. . 2 What is the maximum probability of making type I error? R . . 1 Compute the power function . . . i.i.d. . 3 What is the probability of making type II error if ? Hyun Min Kang Biostatistics 602 - Lecture 18 March 21th, 2013 . 17 / 35 Example of power function Summary . Problem . Hypothesis Testing Recap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . X 1 , X 2 , · · · , X n ∼ Bernoulli ( θ ) where n = 5 . : θ ≤ 0 . 5 H 0 : θ > 0 . 5 H 1 Test 1 rejects H 0 if and only if all ”success” are observed. i.e. = { x : x = (1 , 1 , 1 , 1 , 1) } 5 ∑ { x : x i = 5 } = i =1

  32. . 2 What is the maximum probability of making type I error? R . . 1 Compute the power function . . . i.i.d. . 3 What is the probability of making type II error if ? Hyun Min Kang Biostatistics 602 - Lecture 18 March 21th, 2013 . 17 / 35 Example of power function Summary . Problem . Hypothesis Testing Recap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . X 1 , X 2 , · · · , X n ∼ Bernoulli ( θ ) where n = 5 . : θ ≤ 0 . 5 H 0 : θ > 0 . 5 H 1 Test 1 rejects H 0 if and only if all ”success” are observed. i.e. = { x : x = (1 , 1 , 1 , 1 , 1) } 5 ∑ { x : x i = 5 } = i =1

  33. . i.i.d. March 21th, 2013 Biostatistics 602 - Lecture 18 Hyun Min Kang . . 2 What is the maximum probability of making type I error? . . 1 Compute the power function . . R . 17 / 35 . Example of power function . Hypothesis Testing Recap . . . . . . . . . . Problem . . Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . X 1 , X 2 , · · · , X n ∼ Bernoulli ( θ ) where n = 5 . : θ ≤ 0 . 5 H 0 : θ > 0 . 5 H 1 Test 1 rejects H 0 if and only if all ”success” are observed. i.e. = { x : x = (1 , 1 , 1 , 1 , 1) } 5 ∑ { x : x i = 5 } = i =1 3 What is the probability of making type II error if θ = 2/3 ?

  34. . . . . . . . . When , the power function is Type I error. max max Type II error when . . . . . . . . . Hyun Min Kang Biostatistics 602 - Lecture 18 March 21th, 2013 . Maximum type I error . . . . . . . . . . . . Recap Hypothesis Testing . Summary Solution for Test 1 . Power function . . Pr X i Because X i Binomial , . 18 / 35 . . . . . . . . . . . . . . . . . . . . . . . . . . . β ( θ ) = Pr ( reject H 0 | θ ) = Pr ( X ∈ R | θ )

  35. . max . . . . . . . When , the power function is Type I error. max . Maximum type I error Type II error when . . . . . . . . Hyun Min Kang Biostatistics 602 - Lecture 18 March 21th, 2013 . . . Power function . . . . . . . . . . Recap Hypothesis Testing . Summary Solution for Test 1 . . . . Because X i Binomial , 18 / 35 . . . . . . . . . . . . . . . . . . . . . . . . . . . β ( θ ) = Pr ( reject H 0 | θ ) = Pr ( X ∈ R | θ ) ∑ = Pr ( X i = 5 | θ )

  36. . . . . . . . When , the power function is Type I error. max max Type II error when . . . . . . . . . Hyun Min Kang Biostatistics 602 - Lecture 18 March 21th, 2013 . . . . . . . . . . . . . . Recap Hypothesis Testing . Summary Solution for Test 1 Power function Maximum type I error . . . 18 / 35 . . . . . . . . . . . . . . . . . . . . . . . . . . . β ( θ ) = Pr ( reject H 0 | θ ) = Pr ( X ∈ R | θ ) ∑ = Pr ( X i = 5 | θ ) Because ∑ X i ∼ Binomial (5 , θ ) , β ( θ ) = θ 5 .

  37. . . Maximum type I error . . max max . Type II error when . . . . . . . . Hyun Min Kang Biostatistics 602 - Lecture 18 March 21th, 2013 . 18 / 35 Solution for Test 1 . . . . . . Hypothesis Testing . Summary . . Power function . . . . . Recap . . . . . . . . . . . . . . . . . . . . . . . . . . . β ( θ ) = Pr ( reject H 0 | θ ) = Pr ( X ∈ R | θ ) ∑ = Pr ( X i = 5 | θ ) Because ∑ X i ∼ Binomial (5 , θ ) , β ( θ ) = θ 5 . When θ ∈ Ω 0 = (0 , 0 . 5] , the power function β ( θ ) is Type I error.

  38. . . Maximum type I error . . max max . Type II error when . . . . . . . . Hyun Min Kang Biostatistics 602 - Lecture 18 March 21th, 2013 . 18 / 35 . . . Summary Solution for Test 1 Recap Power function . . . . . . . . . . . Hypothesis Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . β ( θ ) = Pr ( reject H 0 | θ ) = Pr ( X ∈ R | θ ) ∑ = Pr ( X i = 5 | θ ) Because ∑ X i ∼ Binomial (5 , θ ) , β ( θ ) = θ 5 . When θ ∈ Ω 0 = (0 , 0 . 5] , the power function β ( θ ) is Type I error. θ ∈ (0 , 0 . 5] θ 5 = 0 . 5 5 = 1/32 ≈ 0 . 031 θ ∈ (0 , 0 . 5] β ( θ ) =

  39. . . March 21th, 2013 Biostatistics 602 - Lecture 18 Hyun Min Kang . . . max max . . Maximum type I error . . 18 / 35 . . . . . . . Recap . Hypothesis Testing . . Summary Solution for Test 1 . . Power function . . . . . . . . . . . . . . . . . . . . . . . . . . . . β ( θ ) = Pr ( reject H 0 | θ ) = Pr ( X ∈ R | θ ) ∑ = Pr ( X i = 5 | θ ) Because ∑ X i ∼ Binomial (5 , θ ) , β ( θ ) = θ 5 . When θ ∈ Ω 0 = (0 , 0 . 5] , the power function β ( θ ) is Type I error. θ ∈ (0 , 0 . 5] θ 5 = 0 . 5 5 = 1/32 ≈ 0 . 031 θ ∈ (0 , 0 . 5] β ( θ ) = Type II error when θ = 2/3 3 = 1 − (2/3) 5 = 211/243 ≈ 0 . 868 3 = 1 − θ 5 � 1 − β ( θ ) | θ = 2 � θ = 2

  40. . . R x i x i . . 1 Compute the power function . H 2 What is the maximum probability of making type I error? . . 3 What is the probability of making type II error if ? Hyun Min Kang Biostatistics 602 - Lecture 18 March 21th, 2013 Test 2 rejects H if and only if 3 or more ”success” are observed. i.e. H . Hypothesis Testing . . . . . . . . . . Recap . Summary Another Example . Problem . . i.i.d. 19 / 35 . . . . . . . . . . . . . . . . . . . . . . . . . . . X 1 , X 2 , · · · , X n ∼ Bernoulli ( θ ) where n = 5 .

  41. . . R x i x i . . 1 Compute the power function . . 2 What is the maximum probability of making type I error? . . 3 What is the probability of making type II error if ? Hyun Min Kang Biostatistics 602 - Lecture 18 March 21th, 2013 Test 2 rejects H if and only if 3 or more ”success” are observed. i.e. 19 / 35 Another Example . . . . . . Hypothesis Testing . Summary . . Problem . . i.i.d. . . . Recap . . . . . . . . . . . . . . . . . . . . . . . . . . . X 1 , X 2 , · · · , X n ∼ Bernoulli ( θ ) where n = 5 . : θ ≤ 0 . 5 H 0 : θ > 0 . 5 H 1

  42. . 2 What is the maximum probability of making type I error? R . . 1 Compute the power function . . . i.i.d. . 3 What is the probability of making type II error if ? Hyun Min Kang Biostatistics 602 - Lecture 18 March 21th, 2013 . 19 / 35 Summary . Another Example . Problem Hypothesis Testing Recap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . X 1 , X 2 , · · · , X n ∼ Bernoulli ( θ ) where n = 5 . : θ ≤ 0 . 5 H 0 : θ > 0 . 5 H 1 Test 2 rejects H 0 if and only if 3 or more ”success” are observed. i.e. 5 ∑ = { x : x i ≥ 3 } i =1

  43. . i.i.d. March 21th, 2013 Biostatistics 602 - Lecture 18 Hyun Min Kang . . 2 What is the maximum probability of making type I error? . . 1 Compute the power function . . R . 19 / 35 . . . Summary Another Example Recap . . . . . . . . . . Problem . Hypothesis Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . X 1 , X 2 , · · · , X n ∼ Bernoulli ( θ ) where n = 5 . : θ ≤ 0 . 5 H 0 : θ > 0 . 5 H 1 Test 2 rejects H 0 if and only if 3 or more ”success” are observed. i.e. 5 ∑ = { x : x i ≥ 3 } i =1 3 What is the probability of making type II error if θ = 2/3 ?

  44. . . Maximum type I error is Maximum type I error . . . . . . . . We need to find the maximum of for is increasing in . . Type II error when . . . . . . . . Hyun Min Kang Biostatistics 602 - Lecture 18 March 21th, 2013 . 20 / 35 . . . Solution for Test 2 Summary . Hypothesis Testing Recap . . . . . . . . . . Power function . . . . . . . . . . . . . . . . . . . . . . . . . . . ( 5 ) ( 5 ) ( 5 ) θ 3 (1 − θ ) 2 + ∑ θ 4 (1 − θ ) + θ 5 β ( θ ) = Pr ( X i ≥ 3 | θ ) = 3 4 5

  45. . . Maximum type I error is Maximum type I error . . . . . . . . We need to find the maximum of for is increasing in . . Type II error when . . . . . . . . Hyun Min Kang Biostatistics 602 - Lecture 18 March 21th, 2013 . 20 / 35 . Solution for Test 2 . . . . . . . . . . . . Recap Power function Hypothesis Testing . Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . ( 5 ) ( 5 ) ( 5 ) θ 3 (1 − θ ) 2 + ∑ θ 4 (1 − θ ) + θ 5 β ( θ ) = Pr ( X i ≥ 3 | θ ) = 3 4 5 θ 3 (6 θ 2 − 15 θ + 10) =

  46. . . Maximum type I error . . is increasing in . Maximum type I error is . Type II error when . . . . . . . . Hyun Min Kang Biostatistics 602 - Lecture 18 March 21th, 2013 . 20 / 35 Power function . . . Solution for Test 2 Summary . Hypothesis Testing Recap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ( 5 ) ( 5 ) ( 5 ) θ 3 (1 − θ ) 2 + ∑ θ 4 (1 − θ ) + θ 5 β ( θ ) = Pr ( X i ≥ 3 | θ ) = 3 4 5 θ 3 (6 θ 2 − 15 θ + 10) = We need to find the maximum of β ( θ ) for θ ∈ Ω 0 = (0 , 0 . 5] β ′ ( θ ) = 30 θ 2 ( θ − 1) 2 > 0

  47. . . March 21th, 2013 Biostatistics 602 - Lecture 18 Hyun Min Kang . . . . . Maximum type I error . . . 20 / 35 Power function Solution for Test 2 . . . . . . . . . . Recap Hypothesis Testing . . Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . ( 5 ) ( 5 ) ( 5 ) θ 3 (1 − θ ) 2 + ∑ θ 4 (1 − θ ) + θ 5 β ( θ ) = Pr ( X i ≥ 3 | θ ) = 3 4 5 θ 3 (6 θ 2 − 15 θ + 10) = We need to find the maximum of β ( θ ) for θ ∈ Ω 0 = (0 , 0 . 5] β ′ ( θ ) = 30 θ 2 ( θ − 1) 2 > 0 β ( θ ) is increasing in θ ∈ (0 , 1) . Maximum type I error is β (0 . 5) = 0 . 5 Type II error when θ = 2/3 3 = 1 − θ 3 (6 θ 2 − 15 θ + 10) � 1 − β ( θ ) | θ = 2 3 ≈ 0 . 21 θ = 2 �

  48. . test if . . . . . . . A test with power function is a level sup test In other words, the maximum probability of making a type I error is equal or less than . Any size test is also a level test Hyun Min Kang Biostatistics 602 - Lecture 18 March 21th, 2013 . Level . . . . . . . . . . . . Recap Hypothesis Testing . Summary Sizes and Levels of Tests . . . sup In other words, the maximum probability of making a type I error is . 21 / 35 . . . . . . . . . . . . . . . . . . . . . . . . . . . Size α test A test with power function β ( θ ) is a size α test if β ( θ ) = α θ ∈ Ω 0

  49. . test if . . . . . . . A test with power function is a level sup test In other words, the maximum probability of making a type I error is equal or less than . Any size test is also a level test Hyun Min Kang Biostatistics 602 - Lecture 18 March 21th, 2013 . Level . Summary . . . . . . . . . . Recap Hypothesis Testing . Sizes and Levels of Tests . . . . sup 21 / 35 . . . . . . . . . . . . . . . . . . . . . . . . . . . Size α test A test with power function β ( θ ) is a size α test if β ( θ ) = α θ ∈ Ω 0 In other words, the maximum probability of making a type I error is α .

  50. . sup March 21th, 2013 Biostatistics 602 - Lecture 18 Hyun Min Kang test test is also a level Any size . or less than In other words, the maximum probability of making a type I error is equal sup . . . . 21 / 35 Recap . . . . . Sizes and Levels of Tests . Summary . . . . . . . . Hypothesis Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . Size α test A test with power function β ( θ ) is a size α test if β ( θ ) = α θ ∈ Ω 0 In other words, the maximum probability of making a type I error is α . Level α test A test with power function β ( θ ) is a level α test if β ( θ ) ≤ α θ ∈ Ω 0

  51. . . March 21th, 2013 Biostatistics 602 - Lecture 18 Hyun Min Kang test test is also a level Any size In other words, the maximum probability of making a type I error is equal sup . . . . sup 21 / 35 . . . . . . . . . . . . Recap Hypothesis Testing Sizes and Levels of Tests Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . Size α test A test with power function β ( θ ) is a size α test if β ( θ ) = α θ ∈ Ω 0 In other words, the maximum probability of making a type I error is α . Level α test A test with power function β ( θ ) is a level α test if β ( θ ) ≤ α θ ∈ Ω 0 or less than α .

  52. . . March 21th, 2013 Biostatistics 602 - Lecture 18 Hyun Min Kang In other words, the maximum probability of making a type I error is equal sup . . . . . sup . Hypothesis Testing . . . . . . . . . . Recap . Summary Sizes and Levels of Tests 21 / 35 . . . . . . . . . . . . . . . . . . . . . . . . . . . Size α test A test with power function β ( θ ) is a size α test if β ( θ ) = α θ ∈ Ω 0 In other words, the maximum probability of making a type I error is α . Level α test A test with power function β ( θ ) is a level α test if β ( θ ) ≤ α θ ∈ Ω 0 or less than α . Any size α test is also a level α test

  53. . . Test 2 . . . . . . . . sup The size is 0.5 Hyun Min Kang Biostatistics 602 - Lecture 18 March 21th, 2013 . 22 / 35 Summary . . . . . . . Recap Hypothesis Testing . Revisiting Previous Examples . Test 1 . . . . sup . . . . . . . . . . . . . . . . . . . . . . . . . . . . θ 5 = 0 . 5 5 = 0 . 03125 β ( θ ) = sup θ ∈ Ω 0 θ ∈ Ω 0 The size is 0 . 03125 , and this is a level 0 . 05 test, or a level 0 . 1 test, but not a level 0 . 01 test.

  54. . . March 21th, 2013 Biostatistics 602 - Lecture 18 Hyun Min Kang The size is 0.5 sup . . Test 2 . . sup . 22 / 35 Test 1 . . . . . . . . . . . Recap Hypothesis Testing . Summary Revisiting Previous Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . θ 5 = 0 . 5 5 = 0 . 03125 β ( θ ) = sup θ ∈ Ω 0 θ ∈ Ω 0 The size is 0 . 03125 , and this is a level 0 . 05 test, or a level 0 . 1 test, but not a level 0 . 01 test. β ( θ ) = 0 . 5 θ ∈ Ω 0

  55. . . March 21th, 2013 Biostatistics 602 - Lecture 18 Hyun Min Kang c . the largest power if probability as small as possible; equivalently, we want the test with 2 Within this level of tests, we search for the test with Type II error . . Constructing a good test . Summary . Hypothesis Testing Recap . . . . . . . . . . 23 / 35 . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 Construct all the level α test.

  56. . Constructing a good test March 21th, 2013 Biostatistics 602 - Lecture 18 Hyun Min Kang probability as small as possible; equivalently, we want the test with 2 Within this level of tests, we search for the test with Type II error . . . . . Summary . Hypothesis Testing Recap . . . . . . . . . . 23 / 35 . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 Construct all the level α test. the largest power if θ ∈ Ω c 0 .

  57. . of the standard distribution satisfy . . . . . Let T t n with pdf f T n t and cdf F T n t . The -th quantile t n or -th quantile t n Pr T . t n or t n F T n Pr T t n or t n F T n t n t n Hyun Min Kang Biostatistics 602 - Lecture 18 March 21th, 2013 . . . . . . . . . . . . . . Recap Hypothesis Testing . Summary Review on standard normal and t distribution . Quantile of standard normal distribution . 24 / 35 Quantile of t distribution or . z z F Z z z Pr Z F Z z or z Pr Z . . . . . . . . . . . . . . . . . . . . . . . . . . . Let Z ∼ N (0 , 1) with pdf f Z ( z ) and cdf F Z ( z ) . The α -th quantile z α or (1 − α ) -th quantile z 1 − α of the standard distribution satisfy

  58. . of the standard distribution satisfy . . . . Let T t n with pdf f T n t and cdf F T n t . The -th quantile t n or -th quantile t n Pr T . t n or t n F T n Pr T t n or t n F T n t n t n Hyun Min Kang Biostatistics 602 - Lecture 18 March 21th, 2013 . . . . . . . . . . . . . . Recap Hypothesis Testing . Summary Review on standard normal and t distribution . Quantile of standard normal distribution . 24 / 35 . z Quantile of t distribution . z z F Z or z Pr Z or . . . . . . . . . . . . . . . . . . . . . . . . . . . Let Z ∼ N (0 , 1) with pdf f Z ( z ) and cdf F Z ( z ) . The α -th quantile z α or (1 − α ) -th quantile z 1 − α of the standard distribution satisfy z α = F − 1 Pr ( Z ≥ z α ) = α Z (1 − α )

  59. . of the standard distribution satisfy . . . . Let T t n with pdf f T n t and cdf F T n t . The -th quantile t n or -th quantile t n Pr T . t n or t n F T n Pr T t n or t n F T n t n t n Hyun Min Kang Biostatistics 602 - Lecture 18 March 21th, 2013 . . . . . . . . . . . . . . Recap Hypothesis Testing . Summary Review on standard normal and t distribution . Quantile of standard normal distribution . . or or z z . Quantile of t distribution 24 / 35 . . . . . . . . . . . . . . . . . . . . . . . . . . . Let Z ∼ N (0 , 1) with pdf f Z ( z ) and cdf F Z ( z ) . The α -th quantile z α or (1 − α ) -th quantile z 1 − α of the standard distribution satisfy z α = F − 1 Pr ( Z ≥ z α ) = α Z (1 − α ) z 1 − α = F − 1 Pr ( Z ≤ z 1 − α ) = α Z ( α )

  60. . F T n . Quantile of t distribution . . Pr T t n or t n Pr T or t n or t n F T n t n t n Hyun Min Kang Biostatistics 602 - Lecture 18 March 21th, 2013 . 24 / 35 . Recap Hypothesis Testing . Summary Review on standard normal and t distribution . Quantile of standard normal distribution . . . . . . . . or . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Let Z ∼ N (0 , 1) with pdf f Z ( z ) and cdf F Z ( z ) . The α -th quantile z α or (1 − α ) -th quantile z 1 − α of the standard distribution satisfy z α = F − 1 Pr ( Z ≥ z α ) = α Z (1 − α ) z 1 − α = F − 1 Pr ( Z ≤ z 1 − α ) = α Z ( α ) − z α = z 1 − α Let T ∼ t n − 1 with pdf f T , n − 1 ( t ) and cdf F T , n − 1 ( t ) . The α -th quantile t n − 1 ,α or (1 − α ) -th quantile t n − 1 , 1 − α of the standard distribution satisfy

  61. . . March 21th, 2013 Biostatistics 602 - Lecture 18 Hyun Min Kang or or . . Quantile of t distribution . . or or 24 / 35 . . . . . . . . . . . . Quantile of standard normal distribution Hypothesis Testing Recap Summary Review on standard normal and t distribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . Let Z ∼ N (0 , 1) with pdf f Z ( z ) and cdf F Z ( z ) . The α -th quantile z α or (1 − α ) -th quantile z 1 − α of the standard distribution satisfy z α = F − 1 Pr ( Z ≥ z α ) = α Z (1 − α ) z 1 − α = F − 1 Pr ( Z ≤ z 1 − α ) = α Z ( α ) − z α = z 1 − α Let T ∼ t n − 1 with pdf f T , n − 1 ( t ) and cdf F T , n − 1 ( t ) . The α -th quantile t n − 1 ,α or (1 − α ) -th quantile t n − 1 , 1 − α of the standard distribution satisfy t n − 1 α = F − 1 Pr ( T ≥ t n − 1 ,α ) = α T , n − 1 (1 − α ) t n − 1 , 1 − α = F − 1 Pr ( T ≤ t n − 1 , 1 − α ) = α T , n − 1 ( α ) = − t n − 1 ,α t n − 1 , 1 − α

  62. . over L x L x where is the MLE of over , and is the MLE of (restricted MLE). L The likelihood ratio test is a test that rejects H if and only if x c where c . Hyun Min Kang Biostatistics 602 - Lecture 18 March 21th, 2013 x sup . x . . . . . . . . . . Recap Hypothesis Testing . Summary Likelihood Ratio Tests (LRT) . Definition . . x sup L 25 / 35 . . . . . . . . . . . . . . . . . . . . . . . . . . . Let L ( θ | x ) be the likelihood function of θ . The likelihood ratio test statistic for testing H 0 : θ ∈ Ω 0 vs. H 1 : θ ∈ Ω c 0 is

  63. . The likelihood ratio test is a test that rejects H if and only if is the MLE of over , and is the MLE of over (restricted MLE). x . c where c . Hyun Min Kang Biostatistics 602 - Lecture 18 March 21th, 2013 where 25 / 35 . . . Summary Likelihood Ratio Tests (LRT) Recap Definition . Hypothesis Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Let L ( θ | x ) be the likelihood function of θ . The likelihood ratio test statistic for testing H 0 : θ ∈ Ω 0 vs. H 1 : θ ∈ Ω c 0 is sup θ ∈ Ω L ( θ | x ) = L (ˆ sup θ ∈ Ω 0 L ( θ | x ) θ 0 | x ) λ ( x ) = L (ˆ θ | x )

  64. . . March 21th, 2013 Biostatistics 602 - Lecture 18 Hyun Min Kang . c where c x The likelihood ratio test is a test that rejects H if and only if (restricted MLE). . . 25 / 35 Definition . Hypothesis Testing . Summary Likelihood Ratio Tests (LRT) . . . . . . . . Recap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Let L ( θ | x ) be the likelihood function of θ . The likelihood ratio test statistic for testing H 0 : θ ∈ Ω 0 vs. H 1 : θ ∈ Ω c 0 is sup θ ∈ Ω L ( θ | x ) = L (ˆ sup θ ∈ Ω 0 L ( θ | x ) θ 0 | x ) λ ( x ) = L (ˆ θ | x ) where ˆ θ is the MLE of θ over θ ∈ Ω , and ˆ θ 0 is the MLE of θ over θ ∈ Ω 0

  65. . Likelihood Ratio Tests (LRT) March 21th, 2013 Biostatistics 602 - Lecture 18 Hyun Min Kang (restricted MLE). . . . Definition . 25 / 35 Summary . Hypothesis Testing Recap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Let L ( θ | x ) be the likelihood function of θ . The likelihood ratio test statistic for testing H 0 : θ ∈ Ω 0 vs. H 1 : θ ∈ Ω c 0 is sup θ ∈ Ω L ( θ | x ) = L (ˆ sup θ ∈ Ω 0 L ( θ | x ) θ 0 | x ) λ ( x ) = L (ˆ θ | x ) where ˆ θ is the MLE of θ over θ ∈ Ω , and ˆ θ 0 is the MLE of θ over θ ∈ Ω 0 The likelihood ratio test is a test that rejects H 0 if and only if λ ( x ) ≤ c where 0 ≤ c ≤ 1 .

  66. • Difference choice of c • The smaller the c , the smaller type I error. • The larger the c , the smaller the type II error. • Choose c such that type I error probability of LRT is bound above by give different tests. March 21th, 2013 Biostatistics 602 - Lecture 18 Hyun Min Kang test. Then we get a size sup Pr reject H sup c x sup Pr . . . Properties of LRT Summary . Hypothesis Testing Recap . . . . . . . . . . 26 / 35 . . . . . . . . . . . . . . . . . . . . . . . . . . . • For example • If c = 1 , null hypothesis will always be rejected. • If c = 0 , null hypothesis will never be rejected.

  67. • Choose c such that type I error probability of LRT is bound above by . . March 21th, 2013 Biostatistics 602 - Lecture 18 Hyun Min Kang test. Then we get a size sup Pr reject H sup c x sup Pr . 26 / 35 Hypothesis Testing . . . Properties of LRT Summary . Recap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . • For example • If c = 1 , null hypothesis will always be rejected. • If c = 0 , null hypothesis will never be rejected. • Difference choice of c ∈ [0 , 1] give different tests. • The smaller the c , the smaller type I error. • The larger the c , the smaller the type II error.

  68. . Properties of LRT March 21th, 2013 Biostatistics 602 - Lecture 18 Hyun Min Kang test. Then we get a size sup Pr reject H sup sup . 26 / 35 Summary Recap . . . . Hypothesis Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . • For example • If c = 1 , null hypothesis will always be rejected. • If c = 0 , null hypothesis will never be rejected. • Difference choice of c ∈ [0 , 1] give different tests. • The smaller the c , the smaller type I error. • The larger the c , the smaller the type II error. • Choose c such that type I error probability of LRT is bound above by α . Pr ( λ ( x ) ≤ c ) = β ( θ ) θ ∈ Ω 0 θ ∈ Ω 0

  69. . Summary March 21th, 2013 Biostatistics 602 - Lecture 18 Hyun Min Kang sup sup sup . Properties of LRT 26 / 35 . . . . . . . . . Recap . . Hypothesis Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . • For example • If c = 1 , null hypothesis will always be rejected. • If c = 0 , null hypothesis will never be rejected. • Difference choice of c ∈ [0 , 1] give different tests. • The smaller the c , the smaller type I error. • The larger the c , the smaller the type II error. • Choose c such that type I error probability of LRT is bound above by α . Pr ( λ ( x ) ≤ c ) = β ( θ ) θ ∈ Ω 0 θ ∈ Ω 0 = Pr ( reject H 0 ) = α θ ∈ Ω 0 Then we get a size α test.

  70. . n . . . . L x n i exp x i exp . n i x i We need to find MLE of over and . Hyun Min Kang Biostatistics 602 - Lecture 18 March 21th, 2013 . . . . . . . . . . . . . . Recap Hypothesis Testing . Summary Example of LRT . Problem . . i.i.d. H H For the LRT test and its power function . Solution 27 / 35 . . . . . . . . . . . . . . . . . . . . . . . . . . . ∼ N ( θ, σ 2 ) where σ 2 is known. Consider X 1 , · · · , X n

  71. . x i . . . . . L x n i exp n . exp n i x i We need to find MLE of over and . Hyun Min Kang Biostatistics 602 - Lecture 18 March 21th, 2013 . . . . . . . . . . . . . . Recap Hypothesis Testing . Summary Example of LRT Problem Solution . . i.i.d. H For the LRT test and its power function . 27 / 35 . . . . . . . . . . . . . . . . . . . . . . . . . . . ∼ N ( θ, σ 2 ) where σ 2 is known. Consider X 1 , · · · , X n : θ ≤ θ 0 H 0

  72. . x i . . . . . . L x n i exp n . exp n i x i We need to find MLE of over and . Hyun Min Kang Biostatistics 602 - Lecture 18 March 21th, 2013 . Solution . . . . . . . . . . . . Recap Hypothesis Testing . Summary Example of LRT . Problem . . i.i.d. For the LRT test and its power function 27 / 35 . . . . . . . . . . . . . . . . . . . . . . . . . . . ∼ N ( θ, σ 2 ) where σ 2 is known. Consider X 1 , · · · , X n : θ ≤ θ 0 H 0 : θ > θ 0 H 1

  73. . i . . . n n exp n x i For the LRT test and its power function We need to find MLE of over and . Hyun Min Kang Biostatistics 602 - Lecture 18 March 21th, 2013 . Solution 27 / 35 . Summary . Hypothesis Testing Recap Problem . . . . . . . . . i.i.d. . . . Example of LRT . . . . . . . . . . . . . . . . . . . . . . . . . . . ∼ N ( θ, σ 2 ) where σ 2 is known. Consider X 1 , · · · , X n : θ ≤ θ 0 H 0 : θ > θ 0 H 1 − ( x i − θ ) 2 1 [ ] ∏ √ L ( θ | x ) = 2 σ 2 2 πσ 2 exp i =1

  74. . exp . Solution . . . n We need to find MLE of i.i.d. over and . Hyun Min Kang Biostatistics 602 - Lecture 18 March 21th, 2013 For the LRT test and its power function 27 / 35 . Summary Recap . . . . . . . . . . . . Problem . Example of LRT Hypothesis Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . ∼ N ( θ, σ 2 ) where σ 2 is known. Consider X 1 , · · · , X n : θ ≤ θ 0 H 0 : θ > θ 0 H 1 − ( x i − θ ) 2 1 [ ] ∏ √ L ( θ | x ) = 2 σ 2 2 πσ 2 exp i =1 i =1 ( x i − θ ) 2 ( 1 ) n [ ∑ n ] √ − = 2 σ 2 2 πσ 2

  75. . . March 21th, 2013 Biostatistics 602 - Lecture 18 Hyun Min Kang exp n . . Solution . For the LRT test and its power function i.i.d. . . Problem . . . . . . . . . . . . Recap Hypothesis Testing 27 / 35 Summary Example of LRT . . . . . . . . . . . . . . . . . . . . . . . . . . . ∼ N ( θ, σ 2 ) where σ 2 is known. Consider X 1 , · · · , X n : θ ≤ θ 0 H 0 : θ > θ 0 H 1 − ( x i − θ ) 2 1 [ ] ∏ √ L ( θ | x ) = 2 σ 2 2 πσ 2 exp i =1 i =1 ( x i − θ ) 2 ( 1 ) n [ ∑ n ] √ − = 2 σ 2 2 πσ 2 We need to find MLE of θ over Ω = ( −∞ , ∞ ) and Ω 0 = ( −∞ , θ 0 ] .

  76. . i n i x i x i n n i x i n x i i The equation above minimizes when n i x i n x . Hyun Min Kang Biostatistics 602 - Lecture 18 March 21th, 2013 x i n . Summary . . . . . . . . . . Recap Hypothesis Testing . 28 / 35 , or . . . . . . . . . . . . . . . . . . . . . . . . . . . MLE of θ over Ω = ( −∞ , ∞ ) i =1 ( x i − θ ) 2 [ ∑ n ] To maximize L ( θ | x ) , we need to maximize exp − 2 σ 2 i =1 ( x i − θ ) 2 . equivalently to minimize ∑ n

  77. . x i n n n i x i n i The equation above minimizes when n n i x i n x . Hyun Min Kang Biostatistics 602 - Lecture 18 March 21th, 2013 . 28 / 35 . . Summary Hypothesis Testing . . . . . . Recap . . . , or . . . . . . . . . . . . . . . . . . . . . . . . . . . MLE of θ over Ω = ( −∞ , ∞ ) i =1 ( x i − θ ) 2 [ ∑ n ] To maximize L ( θ | x ) , we need to maximize exp − 2 σ 2 i =1 ( x i − θ ) 2 . equivalently to minimize ∑ n i + θ 2 − 2 θ x i ) ∑ ( x i − θ ) 2 ∑ ( x 2 = i =1 i =1

  78. . n . n n n i The equation above minimizes when i , or x i n x . Hyun Min Kang Biostatistics 602 - Lecture 18 March 21th, 2013 n 28 / 35 . Summary Hypothesis Testing Recap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . MLE of θ over Ω = ( −∞ , ∞ ) i =1 ( x i − θ ) 2 [ ∑ n ] To maximize L ( θ | x ) , we need to maximize exp − 2 σ 2 i =1 ( x i − θ ) 2 . equivalently to minimize ∑ n i + θ 2 − 2 θ x i ) ∑ ( x i − θ ) 2 ∑ ( x 2 = i =1 i =1 n θ 2 − 2 θ ∑ ∑ x 2 = x i + i =1 i =1

  79. . , or March 21th, 2013 Biostatistics 602 - Lecture 18 Hyun Min Kang n i n n n . n 28 / 35 . . . . . . Summary . . . Hypothesis Testing . Recap . . . . . . . . . . . . . . . . . . . . . . . . . . . . MLE of θ over Ω = ( −∞ , ∞ ) i =1 ( x i − θ ) 2 [ ∑ n ] To maximize L ( θ | x ) , we need to maximize exp − 2 σ 2 i =1 ( x i − θ ) 2 . equivalently to minimize ∑ n i + θ 2 − 2 θ x i ) ∑ ( x i − θ ) 2 ∑ ( x 2 = i =1 i =1 n θ 2 − 2 θ ∑ ∑ x 2 = x i + i =1 i =1 ∑ n The equation above minimizes when θ = ˆ θ = i =1 x i = x .

  80. • However, if x . . March 21th, 2013 Biostatistics 602 - Lecture 18 Hyun Min Kang if X if X X To summarize, . Therefore , the likelihood function will be an increasing function. , and , x does not fall into a valid range of n . Summary Hypothesis Testing Recap . . . . . . . . . . 29 / 35 . . . . . . . . . . . . . . . . . . . . . . . . . . . MLE of θ over Ω 0 = ( −∞ , θ 0 ] ∑ n • L ( θ | x ) is maximized at θ = = x if x ≤ θ 0 . i =1 x i

  81. . . March 21th, 2013 Biostatistics 602 - Lecture 18 Hyun Min Kang if X if X X To summarize, n 29 / 35 Summary . . . . . . . Hypothesis Testing . . . . Recap . . . . . . . . . . . . . . . . . . . . . . . . . . . MLE of θ over Ω 0 = ( −∞ , θ 0 ] ∑ n • L ( θ | x ) is maximized at θ = = x if x ≤ θ 0 . i =1 x i • However, if x ≥ θ 0 , x does not fall into a valid range of ˆ θ 0 , and θ ≤ θ 0 , the likelihood function will be an increasing function. Therefore ˆ θ 0 = θ 0 .

  82. . . March 21th, 2013 Biostatistics 602 - Lecture 18 Hyun Min Kang To summarize, . n Summary 29 / 35 Hypothesis Testing . Recap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . MLE of θ over Ω 0 = ( −∞ , θ 0 ] ∑ n • L ( θ | x ) is maximized at θ = = x if x ≤ θ 0 . i =1 x i • However, if x ≥ θ 0 , x does not fall into a valid range of ˆ θ 0 , and θ ≤ θ 0 , the likelihood function will be an increasing function. Therefore ˆ θ 0 = θ 0 . { X if X ≤ θ 0 ˆ θ 0 = θ 0 if X > θ 0

  83. if X n x exp exp exp n x if X Therefore, the likelihood test rejects the null hypothesis if and only if . exp c and x . Hyun Min Kang Biostatistics 602 - Lecture 18 March 21th, 2013 . 30 / 35 . . . . . . Likelihood ratio test . . . . Summary . Hypothesis Testing Recap . . . . . . . . . . . . . . . . . . . . . . . . . . .  1 if X ≤ θ 0  λ ( x ) = L (ˆ i =1( xi − θ 0)2 θ 0 | x )  [ ] ∑ n  − = 2 σ 2 L (ˆ if X > θ 0 θ | x ) i =1( xi − x )2 [ ]  ∑ n  −  2 σ 2

Recommend


More recommend