Class 19 Daniel B. Rowe, Ph.D. Department of Mathematics, Statistics, and Computer Science Copyright 2017 by D.B. Rowe 1
Agenda: Recap Chapter 8.3-8.4 Lecture Chapter 8.5 Go over Exam. Problem Solving Session. 2
Recap Chapter 8.4 8.5 3
8.4 The Nature of Hypothesis Testing Example 1: Friend s Party. H 0 : The party will be a dud vs. H a : The Party will be a great time Example 2: Math 1700 Students Height H 0 : The mean height of Math 1700 students is 69, μ = 69. vs. H a : The mean height of Math 1700 students is not 69, μ 69. 4
8.4 The Nature of Hypothesis Testing Example 1: Friend s Party H 0 : The party will be a dud vs. H a : The Party will be a great time Four outcomes from a hypothesis test. We go. Party Great Correct Decision Party a dud. Type II Error If do not go to party and it s great, we made an error in judgment. We do not go. Type I Error Correct Decision If go to party and it s a dud, we made in error in judgment. 5
8.4 The Nature of Hypothesis Testing Example 2: Math 1700 Height H 0 : μ = 69 vs. H a : μ 69 Four outcomes from a hypothesis test. Fail to reject H 0. μ = 69 μ 69 Correct Decision Type II Error If we reject H 0 and it is true, we made in error in judgment. Reject H 0. Type I Error Correct Decision If we do not reject H 0 and it is false, we have made an error in judgment. 6
8.4 The Nature of Hypothesis Testing Type I Error: true null hypothesis H 0 is rejected. Level of Significance (α): The probability of committing a type I error. (Sometimes α is called the false positive rate.) Type II Error: favor null hypothesis that is actually false. Type II Probability (β): The probability of committing a type II error. Do Not Reject H 0 Reject H 0 H 0 True Type A Correct Decision (1-α) Type I Error (α) H 0 False Type II Error (β) Type B Correct Decision (1-β) 7
8.4 The Nature of Hypothesis Testing We need to determine a measure that will quantify what we should believe. Test Statistic: A random variable whose value is calculated from the sample data and is used in making the decision reject H 0 : or fail to reject H 0. Example: Friend s Party Fraction of parties that were good. Example: Math 1700 Heights Sample mean height. 8
8.4 The Nature of Hypothesis Testing HYPOTHESIS TESTING PAIRS Figure from Johnson & Kuby, 2012. 9
8.5 Hypothesis Test of Mean (σ Known): Probability Approach HYPOTHESIS TESTING PAIRS H 0 : μ = 69 vs. H a : μ 69 Figure from Johnson & Kuby, 2012. 10
8.5 Hypothesis Test of Mean (σ Known): Probability Approach Step 1 The Set-Up: Null (H 0 ) and alternative (H a ) hypotheses H 0 : μ = 69 vs. H a : μ 69 Step 2 The Hypothesis Test Criteria: Test statistic. x 0 z* σ known, n is large so by CLT x is normal / n z* is normal Step 3 The Sample Evidence: Calculate test statistic. x 0 67.2 69 z* 1.74 n=15, x=67.2, 4 / n 4 / 15 normal Step 4 The Probability Distribution: 0.0409 P( z z* ) p value 0.0819 Step 5 The Results: p value, reject H 0, p value> fail to reject H 0 1.74 1.74 0.0409 α = 0.05 11
8.5 Hypothesis Test of Mean (σ Known): Probability Approach HYPOTHESIS TESTING PAIRS H 0 : μ 69 vs. H a : μ < 69 Figure from Johnson & Kuby, 2012. 12
8.5 Hypothesis Test of Mean (σ Known): Probability Approach Step 1 The Set-Up: Null (H 0 ) and alternative (H a ) hypotheses H 0 : μ 69 vs. H a : μ < 69 Step 2 The Hypothesis Test Criteria: Test statistic. x 0 z* σ known, n is large so by CLT x is normal / n z* is normal Step 3 The Sample Evidence: Calculate test statistic. x 0 67.2 69 z* 1.74 n=15, x =67.2, 4 / n 4 / 15 normal Step 4 The Probability Distribution: 0.0409 P( z z*) p value 0.0409 1.74 Step 5 The Results: p value, reject H 0, p value> fail to reject H α = 0.05 0 13
8.5 Hypothesis Test of Mean (σ Known): Probability Approach HYPOTHESIS TESTING PAIRS H 0 : μ 69 vs. H a : μ > 69 Figure from Johnson & Kuby, 2012. 14
8.5 Hypothesis Test of Mean (σ Known): Probability Approach Step 1 The Set-Up: Null (H 0 ) and alternative (H a ) hypotheses H 0 : μ 69 vs. H a : μ > 69 Step 2 The Hypothesis Test Criteria: Test statistic. x 0 z* σ known, n is large so by CLT x is normal / n z* is normal Step 3 The Sample Evidence: Calculate test statistic. x 0 67.2 69 z* 1.74 n=15, x =67.2, 4 / n 4 / 15 normal 0.9591 Step 4 The Probability Distribution: P( z z*) p value 0.9691 1.74 Step 5 The Results: p value, reject H 0, p value> fail to reject H α = 0.05 0 15
Chapter Questions? Homework: Chapter 8 # 5, 15, 22, 24, 35, 47, 57, 59, 81, 93, 97, 106, 109, 119, 145, 157 16
Lecture Chapter 8.5 17
Chapter 8: Introduction to Statistical Inference (continued) Daniel B. Rowe, Ph.D. Department of Mathematics, Statistics, and Computer Science 18
8.5 Hypothesis Test of Mean μ (σ Known): A Classical Approach THE CLASSICAL HYPOTHESIS TEST: 5 STEPS Step 1 The Set-Up: Step 2 The Hypothesis Test Criteria: Step 3 The Sample Evidence: Step 4 The Probability Distribution: Step 5 The Results: 19
THE CLASSICAL HYPOTHESIS TEST: 5 STEPS Step 1 The Set-Up: a. Describe the population parameter of interest. The population parameter of interest is the mean μ, the height of Math 1700 students. 20
8.5 Hypothesis Test of Mean (σ Known): Probability Approach THE PROBABILITY-VALUE HYPOTHESIS TEST: 5 STEPS Step 1 The Set-Up: b. State the null hypothesis (H 0 ) and the alternative hypotheses (H a ). H 0 : μ = 69 vs. H a : μ 69 Figure from Johnson & Kuby, 2012. 21
Scenario: True μ not likely μ 0 =69. Reject H 0 : μ=μ 0 (do not believe H 0 ) let s say we set a cut-off mean μ critical =71 hypothesized mean μ 0 =69 x=72 x sample mean 22
Scenario: True μ likely μ 0 =69. Fail to reject H 0 : μ=μ 0 (not enough evidence not to believe H 0 ) let s say we set a cut-off mean μ critical =71 hypothesized mean μ 0 =69 x=70 sample mean x 23
We need a better (objective) way to set a cut-off value or cut-off values for which we would either believe H 0 or for which we would not have enough evidence not believe H 0. We need to use the normal distribution and probabilities. 24
THE CLASSICAL HYPOTHESIS TEST: 5 STEPS Step 2 The Hypothesis Test Criteria: a. Check the assumptions. Assume we know from past experience that σ=4. Assume that n is large so that by the CLT x is normally distributed. x, x n by SDSM 25
THE CLASSICAL HYPOTHESIS TEST: 5 STEPS Step 2 The Hypothesis Test Criteria: b. Identify the probability distribution and the test statistic to be used. The standard normal distribution is to be used because x is expected to have a normal distribution. Test Statistic for Mean: x 0 z* / n where σ is assumed to be known (8.4) 26
THE CLASSICAL HYPOTHESIS TEST: 5 STEPS Step 2 The Hypothesis Test Criteria: c. Determine the level of significance, α. After much consideration, we assign a tolerable probability of a Type I error to be α=0.05. Type I Error: When a true null hypothesis H 0 is rejected. 27
THE CLASSICAL HYPOTHESIS TEST: 5 STEPS Step 3 The Sample Evidence: a. Collect a sample of information. Take a random sample from the population with mean μ that being questioned. b. Calculate the value of the test statistic. x 0 67.2 69 z* 1.74 / n 4 / 15 Assuming n=15 and 67.2 is sample mean. With known 4. 28
THE CLASSICAL HYPOTHESIS TEST: 5 STEPS Step 4 The Probability Distribution: a. Determine the critical region and critical value(s). Critical Region: The set of values for the test statistic that will cause us to reject the null hypothesis. Critical value(s): The first or boundary value(s) of the critical region(s). 29
There are three possible hypothesis pairs for the mean. H 0 : μ μ 0 vs. H a : μ < μ 0 Reject H 0 if z* x / 0 n less than z( ) Critical Region Reject Non-Critical Region Fail to Reject data indicates μ < μ 0 because x is a lot smaller than 0 z* CV 0 z 30
There are three possible hypothesis pairs for the mean. H 0 : μ μ 0 vs. H a : μ > μ 0 Reject H 0 if greater then z* x 0 z( ) / n Non-Critical Region Fail to Reject Critical Region Reject data indicates μ > μ 0 because x is a lot larger than 0 0 CV z* 31
There are three possible hypothesis pairs for the mean. H 0 : μ = μ 0 vs. H a : μ μ 0 Reject H 0 if z* x / 0 n or if x 0 z* / n data indicates μ μ 0, less than z( / 2) greater than z( / 2) x far from 0 Critical Region Reject Non-Critical Region Fail to Reject Critical Region Reject z* CV 0 CV z* 32
THE CLASSICAL HYPOTHESIS TEST: 5 STEPS Step 4 The Probability Distribution: a. Determine the critical region and critical value(s). b. Determine whether or not the calculated test statistic is in the critical region. H 0 : μ = 69 vs. H a : μ 69 P( z z( / 2)) / 2 z(.025) 1.96 since two sided test., z*=-1.74 Figure from Johnson & Kuby, 2012. 33
THE CLASSICAL HYPOTHESIS TEST: 5 STEPS Step 5 The Results: a. State the decision about H 0. Need a decision rule. Decision rule: a. If the test statistic falls within the critical region, then the decision must be reject H 0. b. If the test statistic is not in the critical region, then the decision must be fail to reject H 0. 34
THE CLASSICAL HYPOTHESIS TEST: 5 STEPS Step 5 The Results: b. State the conclusion about H a. With α = 0.05, there is not sufficient evidence to reject H 0. Fail to reject H 0. z*=-1.74 Figure from Johnson & Kuby, 2012. 35
Let s examine the hypothesis test H 0 : μ 69 vs. H a : μ > 69 with α=0.05 for the heights of Math 1700 students. Generate random data values. H 0 : μ μ 0 vs. H a : μ > μ 0 36
Generated 15 10 6 Calculated normal data values 1 10 6 means with n=15. from μ = 69 and σ=4. (Will repeat for μ = 72.) n=15 n=15 15 10 6 1 10 6 xs ' xs ' H 0 : μ μ 0 vs. H a : μ > μ 0 37
H 0 : μ μ 0 vs. H a : μ > μ 0 n=15 1 10 6 xs ' Fail to Reject Reject H 0 : μ 69 vs. H a : μ > 69 α=.05 When the true mean μ=69, we reject H 0 α fraction of the time. 1-α Commit a Type I Error. μ critical α xs ' Given α, we want μ critical. 38
H 0 : μ μ 0 vs. H a : μ > μ 0 n=15 1 10 6 xs ' Fail to Reject Reject Instead of μ critical we find critical z, z critical =z(α ). 1-α Do this by assuming that H 0 : μ=69 is true, then calculate x 69 z 4 / 15 z critical α zs ' 39
H 0 : μ μ 0 vs. H a : μ > μ 0 H 0 : μ 69 vs. H a : μ > 69 α=.05 n=15 1 10 6 xs ' Fail to Reject Reject When the true mean μ=72, we do not reject H 0 β fraction of the time. Commit a Type II Error 1-β β μ critical (same) xs ' 40
H 0 : μ μ 0 vs. H a : μ > μ 0 n=15 1 10 6 xs ' Fail to Reject Reject Fail to Reject H 0 H 0 True (μ=69 ) Correct Decision (1-α) H 0 False (μ=72 ) Type II Error (β) Reject H 0 Type I Error (α) Correct Decision (1-β) 1-α 1-β Power of the test: 1 P( Reject H H False) 0 0 β α μ critical xs ' Discrimination ability. Ability to detect difference. 41
H 0 : μ μ 0 vs. H a : μ > μ 0 n=15 1 10 6 xs ' z Fail to Reject x 69 4 / 15 Reject Fail to Reject H 0 Reject H 0 H 0 True (μ=69 ) Correct Decision (1-α) Type I Error (α) H 0 False (μ=72 ) Type II Error (β) Correct Decision (1-β) 1-α 1-β Power of the test: 1 P( Reject H H False) 0 0 β α zs ' Discrimination ability. Ability to detect difference. z critical 42
H 0 : μ μ 0 vs. H a : μ > μ 0 n=15 1 10 6 xs ' Fail to Reject Reject We want our α, Prob of Type I Error to be small. So why not just decrease α? 1-α 1-β Decreasing α increases β. β α zs ' And vice versa. z critical 43
H 0 : μ μ 0 vs. H a : μ > μ 0 What is the solution? Increase n. n=30 1 10 6 xs ' Fail to Reject Reject Figure shows n increased to n= 30 from n =15. 1-α 1-β Note α and β both smaller with larger n. β α xs ' 44
H 0 : μ μ 0 vs. H a : μ > μ 0 What is the solution? Increase n. Figure shows n increased to n= 30 from n =15. n=30 1 10 6 xs ' x 69 z 4 / 30 Fail to Reject 1-α Reject 1-β Note α and β both smaller with larger n. β α zs ' 45
Chapter Questions? Homework: Chapter 8 # 5, 15, 22, 24, 35, 47, 57, 59, 81, 93, 97, 106, 109, 119, 145, 157 46
Problem Solving Go Over Exam 47