LESSN 20: YPTESIS TESTING utlie ypothesis testig Tests for the mea Tests for the proportio 1 YPTESIS TESTING TE CNTEXT Example 1: supervisor of a productio lie wats to determie if the productio time of a critical part is the same as its desig time, say 100 secods. radom sample of parts is take ad their productio times are measured. Does the sample iformatio provide eough evidece that the productio time of the part is 100 secods? f course, both of the followig are importat The productio times sampled ad The size of the sample I the above cotext, hypothesis testig provides a techique to coclude if the productio time of the part is 100 secods. 2 1
YPTESIS TESTING TE CNTEXT Example 2: Suppose that a maager wats to produce a ew product if more tha 10% potetial customers buy the product. radom sample of potetial customers is asked whether they would buy the product. Does the sample iformatio provide eough evidece that more tha 10% potetial customers will buy the ew product? f course, both of the followig are importat The yes/o aswers provided by the respodets ad The size of the sample I the above cotext, hypothesis testig provides a techique to coclude if more tha 10% potetial customers will buy the ew product. 3 YPTESIS TESTING TE CNTEXT Example 3: Suppose that a quality cotrol ispector wats to determie if less tha 2% items are defective. radom sample of items are checked ad ispected. Does the sample iformatio provide eough evidece that less tha 2% items are defective? f course, both of the followig are importat The proportio defectives observed i the sample ad The size of the sample I the above cotext, hypothesis testig provides a techique to coclude if less tha 2% items are defective. 4 2
YPTESIS TESTING SME TERMS Null ypothesis, The ull hypothesis always specifies a sigle value. For example, suppose that it is required to determie if the populatio mea is 10. The, the ull hypothesis is : µ =100 Note that sice the ull hypothesis always specifies a sigle value, oe of the below may be a ull hypothesis : µ < 100 : µ 100 : µ > 100 : 80 < µ < 120 5 YPTESIS TESTING SME TERMS lterative ypothesis, The alterative hypothesis is very importat because the coclusio of the hypothesis testig is stated i terms of alterative hypothesis ypothesis testig provides a techique to determie if there is eough statistical evidece that the alterative hypothesis is true. There are three forms of alterative hypothesis: Two-tail test : µ = 100 : µ 100 e-tail (right-tail) test : p = 0.10 : p > 0.10 e-tail (left-tail) test : p = 0.02 : p < 0.02 Example 1 Example 2 Example 3 6 3
YPTESIS TESTING SME TERMS lterative ypothesis, (e- ad Two-Tail Tests) It is very importat to choose the right form of the alterative hypothesis. The form depeds o the cotext. I Example I, the supervisor wats to kow if the mea is 100 or differet from 100. Both the too large ad too small values are equally udesirable. It is appropriate to reject the claim if the sample mea is much differet from 100. So, the most appropriate test is the two-tail test. I Examples 2 ad 3 too small ad too large observatios do ot lead to the same actio. Whe this happes, a oe-tail test is used. 7 YPTESIS TESTING SME TERMS lterative ypothesis, (Left- ad Right-Tail Tests) Choose betwee the left- ad right-tail tests carefully. I Example 2 the maager wats to kow if the proportio is more tha 0.10. So, : p > 0.10 ad the most appropriate test is a right-tail test. I Example 3 the ispector wats to kow if the proportio is less tha 0.02. So, : p < 0.02 ad the most appropriate test is a left-tail test. 8 4
YPTESIS TESTING SME TERMS Test Statistic ad Rejectio Regio The test statistic is computed from the sample data. The test statistic is differet for differet tests. For example, the test statistic for the z-test of mea is X µ z = / The test statistic is the same for both oe-tail ad twotail tests. The rejectio regios for oe-tail ad two-tail tests are differet. If the test statistic lies i the rejectio regio, the ull hypothesis is rejected, else the ull hypothesis is ot rejected (Beware: ot rejected accepted) 9 YPTESIS TESTING SME TERMS Rejectio Regio ad Level of Sigificace, a Coclusio draw from sample measuremets are usually expected to cotai some errors Type I error To reject the ull hypothesis whe it s actually true! Type II error To accept the ull hypothesis whe it s actually false! Level of sigificace, α specifies a limit o the probability of committig Type I error Rejectio regio is differet for a differet value of α 10 5
YPTESIS TESTING SME TERMS Rejectio Regio If the test statistic lies i the rejectio regio, the ull hypothesis is rejected, else the ull hypothesis is ot rejected (ot rejected accepted) The rejectio regios for z-test are show below: Two-tail test: reject the ull hypothesis if Right-tail test: reject the ull hypothesis if Left-tail test: reject the ull hypothesis if z > z α/ 2 z > z α z < z Where z is the test statistic, α is the level of sigificace. Recall that z a is that value of z for which area o the right is a. α 11 YPTESIS TESTING SME TERMS Rejectio Regio for two-tail z-test of mea f(x) Two -tail rejectio regio = x α 2 α 2 z α/2 µ z α / 2 12 6
YPTESIS TESTING SME TERMS Rejectio Regio for oe-tail z-test of mea f(x) Left -tail rejectio regio = x f(x) Right -tail rejectio regio = x α α z α µ µ zα 13 YPTESIS TESTING SME TERMS Type I Error Example: Suppose that a maufacturer of packaged cereals produces cereal boxes. Each box is expected to have a et weight of 100 gm. Periodically, samples are collected ad the average weight of the sample is measured. It is possible that although the system is producig cereal boxes as usual, just because of some radom variatio, a sample may cotai all boxes with weights less tha 100 gm. The, the maufacturer may be tempted to assume some problem with the system, stop the productio ad search for the problem. I this case, the sample data provides a false alarm ad a Type I error is committed. 14 7
YPTESIS TESTING SME TERMS Type II Error Not to reject the ull hypothesis whe the ull hypothesis is false! (the opposite of the Type I error). The probability of committig a Type II error is deoted by β. Example: cosider the maufacturer of the packaged cereal agai. Each cereal box is expected to have a et weight of 100 gm. But, due to some problems i the productio system, the average weight is shifted to 98 gm. Type II error is committed if a sample is collected with average weight early 100 gm. Notice that i such a case, the problem with the productio system will ot be detected by the sample! 15 TESTING TE PPULTIN MEN WEN TE PPULTIN VRINCE IS KNWN z-test is used i the followig cotext: The measuremets are ormally distributed The populatio stadard deviatio is kow, It is desirable to kow if the populatio mea is differet from a give value (two-tail test) less tha a give value (left-tail test) more tha a give value (right-tail test) 16 8
TESTING TE PPULTIN MEN WEN TE PPULTIN VRINCE IS KNWN The test statistic ad rejectio regio for the z-test are: Test statistic: X µ z = / Where, X is the sample mea, µ is the populatio mea stated i the ull hypothesis, is the populatio stadard deviatio ad is the sample size. Rejectio regio: Two-tail test: reject the ull hypothesis if Right-tail test: reject the ull hypothesis if Left-tail test: reject the ull hypothesis if where, α is the level of sigificace. z z > z α z < z > z α/ 2 α 17 TESTING TE PPULTIN MEN WEN TE PPULTIN VRINCE IS KNWN ( N < 10) For small populatio, ad the test statistic for the z-test is: X µ z = N N 1 N N 1 For sigle-decisio procedure the rejectio regios are stated i terms of z-statistic. owever, for recurrig-decisio procedure, the rejectio regios are stated i terms of the actual measuremets, e.g., X, p X = 18 9
TESTING TE PPULTIN MEN WEN TE PPULTIN VRINCE IS KNWN Example 4: machie that produces ball bearigs is set so that the average diameter is 0.60 ich. I a sample of 49 ball bearigs, the mea diameter was foud to be 0.61 ich. ssume that the stadard deviatio is 0.035. Does this statistic provide sufficiet evidece at the 5% sigificace level to ifer that the mea diameter is ot 0.60 ich? : : Test statistic: Rejectio regio: Coclusio: f(x) µ = x 19 YPTESIS TESTING INTERPRETTIN If the ull hypothesis is rejected Coclude that there is eough statistical evidece to ifer that the alterative hypothesis is true If the ull hypothesis is ot rejected Coclude that there is ot eough statistical evidece to ifer that the alterative hypothesis is true 20 10
TESTING TE PPULTIN MEN WEN TE PPULTIN VRINCE IS KNWN Example 5: radom sample of 100 observatios from a ormal populatio whose stadard deviatio is 50 produced a mea of 145. Does this statistic provide sufficiet evidece at the 5% sigificace level to ifer that populatio mea is more tha 140? : : Test statistic: Rejectio regio: Coclusio: f(x) µ = x 21 TESTING TE PPULTIN MEN WEN TE PPULTIN VRINCE IS KNWN Example 6: radom sample of 100 observatios from a ormal populatio whose stadard deviatio is 50 produced a mea of 145. Does this statistic provide sufficiet evidece at the 5% sigificace level to ifer that populatio mea is less tha 150? : : Test statistic: Rejectio regio: Coclusio: f(x) µ = x 22 11
TESTING TE PPULTIN MEN WEN TE PPULTIN VRINCE IS KNWN Example 7: The followig hypotheses are to be tested, with µ 0 = 110 : : µ = µ : µ > µ ssume s = 25 ad = 100. The followig decisio rule applies: ccept Reject 0 0 if X 114 if X > 114 0 0 f(x) = x Compute Type I error probability whe µ=110 ad Type II error probability whe µ=115. µ 23 INFERENCE BUT PPULTIN MEN WEN TE PPULTIN VRINCE IS UNKNWN If the populatio variace, is ot kow, we caot compute the z-statistic. owever, we may compute a similar statistic, the t-statistic, that uses the sample stadard deviatio s i place of the populatio stadard deviatio : t = X µ s / t a is that value of t for which the area to its right uder the Studet t-curve equals a. t a,df is that value of t for which the area to its right uder the Studet t-curve for degrees of freedom=dfequals a. The value t a df is obtaied from Table G, ppedix, p. 24 541. 12
INFERENCE BUT PPULTIN MEN WEN TE PPULTIN VRINCE IS UNKNWN Test of ypothesis about a populatio mea whe the populatio variace is ukow: X µ Test statistic: t = or s / Rejectio regio: Two-tail test: t > tα/ 2, 1 t = X µ s N N 1 for small N Right-tail test: t > tα, 1 Left-tail test: t < tα, 1 25 INFERENCE BUT PPULTIN MEN WEN TE PPULTIN VRINCE IS UNKNWN Example 8: Let = 100, N = 500, = 160 : µ = 5,000 : µ > 5,000 Suppose that X will serve as test statistic. (a) ssumig that a sigificace level of a=0.01 is desired, fid the critical value for the sample mea ad determie the decisio rule. (b) Should 0 be accepted or rejected if the computed sample mea turs out to be X = 5,050? 26 13
INFERENCE BUT PPULTIN MEN WEN TE PPULTIN VRINCE IS UNKNWN Example 9: radom sample of 9 observatios were draw from a large populatio. These are: 11,9,5,7,1,2,10,6,3. Test to determie if we ca ifer at the 5% sigificace level that the populatio mea is less tha 10. : : Test statistic: Rejectio regio: Coclusio: swer: 27 INFERENCE BUT PPULTIN PRPRTIN Let p = the populatio proportio p = the sample proportio = the sample size The, The expected umber of successes = p Stadard deviatio of successes = p 1 p The expected sample proportio ( ) p ( ) E p = Stadard deviatio of the sample proportio p( 1 p) = p 28 14
INFERENCE BUT PPULTIN PRPRTIN Test of ypothesis about a populatio proportio: Test statistic: z = π p π ( 1 π )/ Rejectio regio: Two-tail test: Right-tail test: Left-tail test: z > z α / 2 z > z α z < z α 29 Example 10: Test the followig hypothesis: : π = 0.40 : π 0.40 Test statistic: INFERENCE BUT PPULTIN PRPRTIN α = 0.05, = 100, p = 0.35 Rejectio regio: Coclusio: 30 15
INFERENCE BUT PPULTIN PRPRTIN Example 11: I a televisio commercial, the maufacturer of a toothpaste claims that more tha seve out of 10 detists recommed the igrediets i his product. To test the claim, a cosumer protectio group radomly samples 400 detists ad asks each oe whether he or she recommed a toothpaste that cotaied the igrediets. total of 290 detists aswered Yes. t the 5% sigificace level, ca the cosumer group ifer that the claim is true? 31 : : Test statistic: Rejectio regio: Coclusio: swer: 32 16
Example 12: Test the followig hypothesis: : π : π = 0.20 < 0.20 Test statistic: INFERENCE BUT PPULTIN PRPRTIN α = 0.10, = 900, p = 0.18 Rejectio regio: Coclusio: 33 REDING ND EXERCISES Lesso 20 Readig: Sectio 11-1 to 11-3, pp. 344-389 Exercises: 11-4, 11-12, 11-14, 11-23, 11-31 34 17