Statistical Hypothesis Testing Review q A statistical hypothesis

  • Slides: 30
Download presentation
Statistical Hypothesis Testing Review q A statistical hypothesis is an assertion concerning one or

Statistical Hypothesis Testing Review q A statistical hypothesis is an assertion concerning one or more populations. q In statistics, a hypothesis test is conducted on a set of two mutually exclusive statements: H 0 : null hypothesis H 1 : alternate hypothesis q Example H 0 : μ = 17 H 1 : μ ≠ 17 q We sometimes refer to the null hypothesis as the “equals” hypothesis. EGR 252 S 12 Ch 10 Lec 2 and 3 9 th edition rev 3 Slide 1

Potential errors in decision-making q α Ø Probability of committing a Type I error

Potential errors in decision-making q α Ø Probability of committing a Type I error Ø Probability of rejecting the null hypothesis given that the null hypothesis is true Ø P (reject H 0 | H 0 is true) EGR 252 S 12 Ch 10 Lec 2 and 3 9 th edition rev 3 qβ Ø Probability of committing a Type II error Ø Power of the test = 1 - β (probability of rejecting the null hypothesis given that the alternate is true. ) Ø Power = P (reject H 0 | H 1 is true) Slide 2

Hypothesis Testing – Approach 1 q Approach 1 - Fixed probability of Type 1

Hypothesis Testing – Approach 1 q Approach 1 - Fixed probability of Type 1 error. 1. State the null and alternative hypotheses. 2. Choose a fixed significance level α. 3. Specify the appropriate test statistic and establish the critical region based on α. Draw a graphic representation. 4. Calculate the value of the test statistic based on the sample data. 5. Make a decision to reject H 0 or fail to reject H 0, based on the location of the test statistic. 6. Make an engineering or scientific conclusion. EGR 252 S 12 Ch 10 Lec 2 and 3 9 th edition rev 3 Slide 3

Hypothesis Testing – Approach 2 q Approach 2 - Significance testing based on the

Hypothesis Testing – Approach 2 q Approach 2 - Significance testing based on the calculated P-value 1. State the null and alternative hypotheses. 2. Choose an appropriate test statistic. 3. Calculate value of test statistic and determine Pvalue. Draw a graphic representation. 4. Make a decision to reject H 0 or fail to reject H 0, based on the P-value. 5. Make an engineering or scientific conclusion. p = 0. 05 P-value 0 ↓ 0. 25 EGR 252 S 12 Ch 10 Lec 2 and 3 9 th edition rev 3 0. 50 0. 75 1. 00 P-value Slide 4

Example: Single Sample Test of the Mean P -value Approach A sample of 20

Example: Single Sample Test of the Mean P -value Approach A sample of 20 cars driven under varying highway conditions achieved fuel efficiencies as follows: Sample mean x = 34. 271 mpg Sample std dev s = 2. 915 mpg Test the hypothesis that the population mean equals 35. 0 mpg vs. μ < 35. Step 1: State the hypotheses. H 0: μ = 35 H 1: μ < 35 Step 2: Determine the appropriate test statistic. σ unknown, n = 20 Therefore, use t distribution EGR 252 S 12 Ch 10 Lec 2 and 3 9 th edition rev 3 Slide 5

Single Sample Example (cont. ) Approach 2: = -1. 11842 Find probability from chart

Single Sample Example (cont. ) Approach 2: = -1. 11842 Find probability from chart or use Excel’s tdist function. P(x ≤ -1. 118) = TDIST (1. 118, 19, 1) = 0. 139665 p = 0. 14 0_______1 Decision: Fail to reject null hypothesis Conclusion: The mean is not significantly less than 35 mpg. EGR 252 S 12 Ch 10 Lec 2 and 3 9 th edition rev 3 Slide 6

Example (concl. ) Approach 1: Predetermined significance level (alpha) Step 1: Use same hypotheses.

Example (concl. ) Approach 1: Predetermined significance level (alpha) Step 1: Use same hypotheses. Step 2: Let’s set alpha at 0. 05. Step 3: Determine the critical value of t that separates the “reject H 0 region” from the “do not reject H 0 region”. t , n-1 = t 0. 05, 19 = 1. 729 Since H 1 specifies “< ” we declare tcrit = -1. 729 Step 4: Using the equation, we calculate tcalc = -1. 11842 Step 5: Decision Fail to reject H 0 Step 6: Conclusion: The mean is not significantly less than 35 mpg. EGR 252 S 12 Ch 10 Lec 2 and 3 9 th edition rev 3 Slide 7

Your turn … same data, different hypotheses A sample of 20 cars driven under

Your turn … same data, different hypotheses A sample of 20 cars driven under varying highway conditions achieved fuel efficiencies as follows: Sample mean = 34. 271 mpg Sample std dev (s) = 2. 915 mpg Test the hypothesis that the population mean equals 35. 0 mpg vs. μ ≠ 35 at an α level of 0. 05. Be sure to draw the picture. Step 1 Step 2 Step 3 Step 4 Step 5 Step 6 (Conclusion will be different. ) EGR 252 S 12 Ch 10 Lec 2 and 3 9 th edition rev 3 Slide 8

Two-Sample Hypothesis Testing A professor has designed an experiment to test the effect of

Two-Sample Hypothesis Testing A professor has designed an experiment to test the effect of reading the textbook before attempting to complete a homework assignment. Four students who read the textbook before attempting the homework recorded the following times (in hours) to complete the assignment: 3. 1, 2. 8, 0. 5, 1. 9 hours Five students who did not read the textbook before attempting the homework recorded the following times to complete the assignment: 0. 9, 1. 4, 2. 1, EGR 252 S 12 Ch 10 Lec 2 and 3 9 th edition rev 3 5. 3, 4. 6 hours Slide 9

Two-Sample Hypothesis Testing q Define the difference in the two means as: μ 1

Two-Sample Hypothesis Testing q Define the difference in the two means as: μ 1 - μ 2 = d 0 where d 0 is the actual value of the hypothesized difference q What are the Hypotheses? H 0: ________ H 1: _______________ or H 1: ________ EGR 252 S 12 Ch 10 Lec 2 and 3 9 th edition rev 3 Slide 10

Our Example Using Excel Reading: No reading: n 1 = 4 mean x 1

Our Example Using Excel Reading: No reading: n 1 = 4 mean x 1 = 2. 075 n 2 = 5 mean x 2 = 2. 860 s 12 = 1. 363 s 22 = 3. 883 If we have reason to believe the population variances are “equal”, we can conduct a t- test assuming equal variances in Minitab or Excel. t-Test: Two-Sample Assuming Equal Variances Read Mean Variance Observations Pooled Variance Do. Not. Read 2. 075 2. 860 1. 3625 3. 883 4 5 2. 8027857 Hypothesized Mean Difference 0 df 7 t Stat -0. 698986 P(T<=t) one-tail 0. 2535567 t Critical one-tail 1. 8945775 P(T<=t) two-tail 0. 5071134 t Critical two-tail 2. 3646226 EGR 252 S 12 Ch 10 Lec 2 and 3 9 th edition rev 3 Slide 11

Your turn … q Lower-tail test (μ 1 - μ 2 < 0) Ø

Your turn … q Lower-tail test (μ 1 - μ 2 < 0) Ø “Fixed α” approach (“Approach 1”) at α = 0. 05 level. Ø “p-value” approach (“Approach 2”) q Upper-tail test (μ 2 – μ 1 > 0) Ø “Fixed α” approach at α = 0. 05 level. Ø “p-value” approach q Two-tailed test (μ 1 - μ 2 ≠ 0) Ø “Fixed α” approach at α = 0. 05 level. Ø “p-value” approach Recall EGR 252 S 12 Ch 10 Lec 2 and 3 9 th edition rev 3 Slide 12

Our Example – Hand Calculation Reading: n 1 = 4 mean x 1 =

Our Example – Hand Calculation Reading: n 1 = 4 mean x 1 = 2. 075 s 12 = 1. 363 n 2 = 5 mean x 2 = 2. 860 s 22 = 3. 883 No reading: To conduct the test by hand, we must calculate sp 2. = 2. 803 and EGR 252 S 12 Ch 10 Lec 2 and 3 9 th edition rev 3 sp = 1. 674 = ? ? Slide 13

Lower-tail test (μ 1 - μ 2 < 0) Why? q Draw the picture:

Lower-tail test (μ 1 - μ 2 < 0) Why? q Draw the picture: Ø Approach 1: df = 7, t 0. 05, 7 = 1. 895 tcrit = -1. 895 q Calculation: Ø tcalc = ((2. 075 -2. 860)-0)/(1. 674*sqrt(1/4 + 1/5)) = -0. 70 q Graphic: q Decision: q Conclusion: EGR 252 S 12 Ch 10 Lec 2 and 3 9 th edition rev 3 Slide 14

Upper-tail test (μ 2 – μ 1 > 0) Conclusions q The data do

Upper-tail test (μ 2 – μ 1 > 0) Conclusions q The data do not support the hypothesis that the mean time to complete homework is less for students who read the textbook. or q There is no statistically significant difference in the time required to complete the homework for the people who read the text ahead of time vs those who did not. or q The data do not support the hypothesis that the mean completion time is less for readers than for non-readers. EGR 252 S 12 Ch 10 Lec 2 and 3 9 th edition rev 3 Slide 15

Our Example Using Excel Reading: No reading: n 1 = 4 n 2 =

Our Example Using Excel Reading: No reading: n 1 = 4 n 2 = 5 mean x 1 = 2. 075 mean x 2 = 2. 860 s 12 = 1. 363 s 22 = 3. 883 What if we do not have reason to believe the population variances are “equal”? We can conduct a t- test assuming unequal variances in Minitab or Excel. t-Test: Two-Sample Assuming Equal Variances Read Mean Variance Observations Pooled Variance Do. Not. Read t-Test: Two-Sample Assuming Unequal Variances 2. 075 2. 860 1. 3625 3. 883 4 5 2. 8027857 Read Mean Do. Not. Read 2. 075 2. 86 1. 3625 3. 883 Observations 4 5 Variance Hypothesized Mean Difference 0 df 7 t Stat -0. 698986 t Stat P(T<=t) one-tail 0. 2535567 P(T<=t) one-tail 0. 2409258 t Critical one-tail 1. 8945775 P(T<=t) two-tail 0. 5071134 P(T<=t) two-tail 0. 4818516 t Critical two-tail 2. 3646226 EGR 252 S 12 Ch 10 Lec 2 and 3 9 th edition rev 3 -0. 7426759 Slide 16

Another Example: Low Carb Meals Suppose we want to test the difference in carbohydrate

Another Example: Low Carb Meals Suppose we want to test the difference in carbohydrate content between two “low-carb” meals. Random samples of the two meals are tested in the lab and the carbohydrate content per serving (in grams) is recorded, with the following results: n 1 = 15 n 2 = 10 x 1 = 27. 2 x 2 = 23. 9 s 12 = 11 s 22 = 23 tcalc = ___________ ν = _______ (using equation in table 10. 3) EGR 252 S 12 Ch 10 Lec 2 and 3 9 th edition rev 3 Slide 17

Example (cont. ) q What are our options for hypotheses? H 0 : μ

Example (cont. ) q What are our options for hypotheses? H 0 : μ 1 - μ 2 = 0 H 1 : μ 1 - μ 2 > 0 or H 0 : μ 1 - μ 2 = 0 H 1 : μ 1 - μ 2 ≠ 0 q At an α level of 0. 05, Ø One-tailed test, t 0. 05, 15 = 1. 753 Ø Two-tailed test, t 0. 025, 15 = 2. 131 q How are our conclusions affected? Ø Our data don’t support a conclusion that the mean carb content of the two meals are different at an alpha level of. 05 (What is H 1 ? ) Ø Our data do support a conclusion that Meal 1 has more average carbs than Meal 2 at an alpha level of. 05. (What is H 1 ? ) EGR 252 S 12 Ch 10 Lec 2 and 3 9 th edition rev 3 Slide 18

Special Case: Paired Sample T-Test Which designs are paired-sample? A. Car Radial Belted 1

Special Case: Paired Sample T-Test Which designs are paired-sample? A. Car Radial Belted 1 ** ** Radial, Belted tires 2 ** ** placed on each car. 3 ** ** 4 ** ** B. Person Pre Post 1 ** ** Pre- and post-test 2 ** ** administered to each 3 ** ** person. 4 ** ** C. Student Test 1 Test 2 1 ** ** 4 scores from test 1, 2 ** ** 4 scores from test 2. 3 ** ** 4 ** ** EGR 252 S 12 Ch 10 Lec 2 and 3 9 th edition rev 3 Slide 19

Sheer Strength Example* An article in the Journal of Strain Analysis compares several methods

Sheer Strength Example* An article in the Journal of Strain Analysis compares several methods for predicting the shear strength of steel plate girders. Data for two of these methods, when applied to nine specific girders, are shown in the table on the next slide. We would like to determine if there is any difference, on average, between the two methods. Procedure: We will conduct a paired-sample t-test at the 0. 05 significance level to determine if there is a difference between the two methods. * adapted from Montgomery & Runger, Applied Statistics and Probability for Engineers. EGR 252 S 12 Ch 10 Lec 2 and 3 9 th edition rev 3 Slide 20

Sheer Strength Example Data Girder 1 2 3 4 5 6 7 8 9

Sheer Strength Example Data Girder 1 2 3 4 5 6 7 8 9 Karlsruhe Lehigh Difference Method (d) 1. 186 1. 061 0. 125 1. 151 0. 992 0. 159 1. 322 1. 063 0. 259 1. 339 1. 062 0. 277 1. 200 1. 065 0. 135 1. 402 1. 178 0. 224 1. 365 1. 037 0. 328 1. 537 1. 086 0. 451 1. 559 1. 052 0. 507 EGR 252 S 12 Ch 10 Lec 2 and 3 9 th edition rev 3 Slide 21

Sheer Strength Example Calculations Hypotheses: H 0: μ D = 0 H 1: μ

Sheer Strength Example Calculations Hypotheses: H 0: μ D = 0 H 1: μ D ≠ 0 t 0. 025, 8 = 2. 306 Why 8? Calculation of difference scores (d), mean and standard deviation, and tcalc … d = 0. 2739 sd = 0. 1351 tcalc = ( d – d 0 ) sd / sqrt(n) = (0. 2739 - 0) (1. 1351 / 3) EGR 252 S 12 Ch 10 Lec 2 and 3 9 th edition rev 3 = 6. 082 Slide 22

What does this mean? q Draw the graphic: q Decision: q Conclusion: EGR 252

What does this mean? q Draw the graphic: q Decision: q Conclusion: EGR 252 S 12 Ch 10 Lec 2 and 3 9 th edition rev 3 Slide 23

Goodness-of-Fit Tests q Procedures for confirming or refuting hypotheses about the distributions of random

Goodness-of-Fit Tests q Procedures for confirming or refuting hypotheses about the distributions of random variables. q Hypotheses: H 0: The population follows a particular distribution. H 1: The population does not follow the distribution. Examples: H 0: The data come from a normal distribution. H 1: The data do not come from a normal distribution. EGR 252 S 12 Ch 10 Lec 2 and 3 9 th edition rev 3 Slide 24

Goodness of Fit Tests: Basic Method q Test statistic is χ2 Ø Draw the

Goodness of Fit Tests: Basic Method q Test statistic is χ2 Ø Draw the picture Ø Determine the critical value χ2 with parameters α, ν = k – 1 q Calculate χ2 from the sample q Compare χ2 calc to χ2 crit q Make a decision about H 0 q State your conclusion EGR 252 S 12 Ch 10 Lec 2 and 3 9 th edition rev 3 Slide 25

Tests of Independence q Example: 500 employees were surveyed with respect to pension plan

Tests of Independence q Example: 500 employees were surveyed with respect to pension plan preferences. q Hypotheses H 0: Worker Type and Pension Plan are independent. H 1: Worker Type and Pension Plan are not independent. q Develop a Contingency Table showing the observed values for the 500 people surveyed. Pension Plan Worker Type #1 #2 #3 Salaried Hourly Total 160 40 200 140 60 200 40 60 100 EGR 252 S 12 Ch 10 Lec 2 and 3 9 th edition rev 3 Total 340 160 500 Slide 26

Calculation of Expected Values Worker Type Salaried Hourly Total Pension Plan #1 #2 160

Calculation of Expected Values Worker Type Salaried Hourly Total Pension Plan #1 #2 160 140 40 60 200 #3 40 60 100 Total 340 160 500 2. Calculate expected probabilities P(#1 ∩ S) = P(#1)*P(S) = (200/500)*(340/500)=0. 272 E(#1 ∩ S) = 0. 272 * 500 = 136 #1 #2 #3 S (exp. ) 136 ? 68 H (exp. ) ? 32 64 EGR 252 S 12 Ch 10 Lec 2 and 3 9 th edition rev 3 Slide 27

Calculate the Sample-based Statistic Calculation of the sample-based statistic = (160 -136)^2/(136) + (140

Calculate the Sample-based Statistic Calculation of the sample-based statistic = (160 -136)^2/(136) + (140 -136)^2/(136) + … (60 -32)^2/(32) = 49. 63 EGR 252 S 12 Ch 10 Lec 2 and 3 9 th edition rev 3 Slide 28

The Chi-Squared Test of Independence 5. Compare to the critical statistic, χ2α, r where

The Chi-Squared Test of Independence 5. Compare to the critical statistic, χ2α, r where r = (a – 1)(b – 1) For our example, suppose α = 0. 01 χ2 0. 01, 2 = ______ χ2 calc = ______ Decision: Conclusion: EGR 252 S 12 Ch 10 Lec 2 and 3 9 th edition rev 3 Slide 29

The Chi-Squared Test in Minitab 15 Chi-Square Test: pp 1, pp 2, pp 3

The Chi-Squared Test in Minitab 15 Chi-Square Test: pp 1, pp 2, pp 3 Expected counts are printed below observed counts Chi-Square contributions are printed below expected counts pp 1 pp 2 pp 3 Total 1 160 140 40 340 136. 00 68. 00 4. 235 0. 118 11. 529 2 40 64. 00 9. 000 60 60 64. 00 32. 00 0. 250 24. 500 160 Total 200 100 500 q Chi-Sq = 49. 632, DF = 2, P-Value = 0. 000 EGR 252 S 12 Ch 10 Lec 2 and 3 9 th edition rev 3 Slide 30