Class 23 Daiel B. Rowe, Ph.D. Departmet of Mathematics, Statistics, ad Computer Sciece Copyright 2017 by D.B. Rowe 1
Ageda: Recap Chapter 9.1 Lecture Chapter 9.2 Review Exam 6 Problem Solvig Sessio. 2
Recap Chapter 9.1 3
9: Ifereces Ivolvig Oe Populatio 9.1 Iferece about the Mea μ (σ Ukow) Usig the t-distributio Table Fidig critical value from a Studet t-distributio, df=-1 t(df,α), t value with α area larger tha it with df degrees of freedom Table 6 Appedix B Page 719. Figure from Johso & Kuby, 2012. 4
9: Ifereces Ivolvig Oe Populatio 9.1 Iferece about the Mea μ (σ Ukow) Example: Fid the value of t(10,0.05), df=10, α=0.05. Table 6 Appedix B Page 719. Go to 0.05 Oe Tail colum ad dow to 10 df row. Figures from Johso & Kuby, 2012. 5
9: Ifereces Ivolvig Oe Populatio 9.1 Iferece about the Mea μ (σ Ukow) Cofidece Iterval Procedure Discussed a cofidece iterval for the μ whe σ was kow, Cofidece Iterval for Mea: x z( / 2) σ to x z( / 2) σ (8.1) ow, with sigma ukow, the CI for the mea is Cofidece Iterval for Mea: x t( df, / 2) s to x t( df, / 2) s (9.1) 6
9: Ifereces Ivolvig Oe Populatio 9.1 Iferece about the Mea μ (σ Ukow) Recap 9.1: Essetially have ew critical value, t(df,α) to look up i a table whe σ is ukow. Used same way as before. σ assumed kow σ assumed ukow x z( / 2) σ x t( df, / 2) s x x 0 0 z* t* / s/ 7
Lecture Chapter 9.2 8
9: Ifereces Ivolvig Oe Populatio 9.2 Iferece about the Biomial Probability of Success Chapter 5 We talked about a Biomial experimet with two outcomes. Each performace of the experimet is called a trial. Each trial is idepedet. 1,2,3,...! x x 0 p 1 P( x) p (1 p) x!( x)! x 0,1..., = umber of trials or times we repeat the experimet. x = the umber of successes out of trials. p = the probability of success o a idividual trial. 9
9: Ifereces Ivolvig Oe Populatio 9.2 Iferece about the Biomial Probability of Success Whe we perform a biomial experimet we ca estimate the probability of heads as Sample Biomial Probability x p'. where x is the umber of successes i trials. This is a poit estimate. Recall the rule for a CI is poit estimate some amout i.e. umber of H out of flips (9.3) 10
9: Ifereces Ivolvig Oe Populatio 9.2 Iferece about the Biomial Probability of Success Backgroud I Statistics, if we have a radom variable x with mea( x) ad 2 variace( x) the the mea ad variace of cx where c is a costat is mea( cx) c 2 2 ad variace( cx) c. If x has a biomial distributio the This is a rule. mea( cx) cp 2 ad variace( cx) c p(1 p). 11
9: Ifereces Ivolvig Oe Populatio 9.2 Iferece about the Biomial Probability of Success x 1 With p', the costat is c, ad x 1 1 mea mea( x) p p x so the variace of p' is variace 2 x p p 2 2 x p(1 p) stadard error of p' is p ' 2. (1 ) 12
9: Ifereces Ivolvig Oe Populatio 9.2 Iferece about the Biomial Probability of Success That is where 1. ad 2. i the gree box below come from If a radom sample of size is selected from a large populatio with p= P(success), the the samplig distributio of p' has: 1. A mea equal to p p' p' 2. A stadard error equal to p(1 p) 3. A approximately ormal distributio if is sufficietly large. 13
6: Normal Probability Distributios 6.5 Normal Approximatio of the Biomial Distributio If we flip the coi a large umber of times! x P( x) p (1 p) x!( x)! x = # of heads whe we flip a coi times Recall It gets tedious to fid the =14 probabilities! x =14 p=1/2 x 0,..., Figure from Johso & Kuby, 2012. 14
Recall 6: Normal Probability Distributios 6.5 Normal Approximatio of the Biomial Distributio It gets tedious to fid the =14 probabilities! =14 p=1/2 So what we ca do is use a histogram represetatio, Figures from Johso & Kuby, 2012. 15
Recall 6: Normal Probability Distributios 6.5 Normal Approximatio of the Biomial Distributio So what we ca do is use a histogram represetatio, =14 p=1/2 The approximate biomial probabilities with ormal areas. Figures from Johso & Kuby, 2012. 16
Recall 6: Normal Probability Distributios 6.5 Normal Approximatio of the Biomial Distributio Approximate biomial probabilities with ormal areas. 2 Use a ormal with p, p(1 p) =14 p=1/2 (14)(.5) 7 2 (14)(.5)(1.5) 3.5 Figures from Johso & Kuby, 2012. 17
Recall 6: Normal Probability Distributios 6.5 Normal Approximatio of the Biomial Distributio =14, p=1/2 We the approximate biomial probabilities with ormal areas. Px ( 4) from the biomial formula is approximately P(3.5 x4.5) from the ormal with 2 7, 3.5 the ±.5 is called a cotiuity correctio Figures from Johso & Kuby, 2012. 18
9: Ifereces Ivolvig Oe Populatio 9.2 Iferece about the Biomial Probability of Success I practice, usig these guidelies will esure ormality of x: 1. The sample size is greater tha 20. page 435 2. The product p ad (1-p) are both greater tha 5. 3. The sample cosists of less tha 10% of the populatio. 1. 20, 2. p 5 ad (1 p) 5, 3..10. N 19
9: Ifereces Ivolvig Oe Populatio 9.2 Iferece about the Biomial Probability of Success x But we re ot usig x, we re scalig it ad usig p'. x It turs out that p' also has a approx. ormal distributio. 0.25 0.2 p x 2 x p(1 p) 0.25 0.2 p ' p 2 p ' p(1 p) 0.15 0.15 0.1 0.1 0.05 0.05 0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 x 0 0 0.2 0.4 0.6 0.8 1 20 p'
9: Ifereces Ivolvig Oe Populatio 9.2 Iferece about the Biomial Probability of Success Now we ca determie probabilities with ormal areas. P(3.5 x 4.5) 0.0594 divide by =14 2 7, 3.5 P(3.5 / 14 p' 4.5 / 14) 0.0594 p' =14, p=1/2 2 p' p' x 0.5, 0.018 Need to covert to z s. Figure left from ad right modified Johso & Kuby, 2012. 21
9: Ifereces Ivolvig Oe Populatio 9.2 Iferece about the Biomial Probability of Success Now we ca determie probabilities with ormal areas. For x For p' =14, p=1/2 p' x P(3.5 x4.5) P(3.5 7 x p 4.5 7) 3.5 7 x p 4.5 7 P 3.5 p(1 p) 3.5 Now we ca look up areas. z P(.25 p'.32) P(.25.5 p' p.32.5).25.5 p' p.32.5 P.5(1.5) p(1 p).5(1.5) 14 14 z 22
9: Ifereces Ivolvig Oe Populatio 9.2 Iferece about the Biomial Probability of Success For a cofidece iterval, we would use Cofidece Iterval for a Proportio p' pq ' ' z( / 2) to p' z( / 2) x where p' ad q' (1 p'). pq ' ' Sice we did t kow the true value for p, we estimate it by p'. This is of the form poit estimate some amout. (9.6) 23
9: Ifereces Ivolvig Oe Populatio 9.2 Iferece about the Biomial Probability of Success Example: Daa radomly selected =200 cars ad foud x=17 covertibles. Fid the 90% CI for the proportio of cars that are covertibles. x 17 p' 200 = 0.1 z( / 2)= z( 0.1 / 2)= 1.65 p' z( / 2) pq ' ' 17 (17 200)(1-17 200) 1.65 200 200 0.052 to 0.118 24
9: Ifereces Ivolvig Oe Populatio 9.2 Iferece about the Biomial Probability of Success Determiig the Sample Size Usig the error part of the CI, we determie the sample size. Maximum Error of Estimate for a Proportio E z( / 2) p'(1 p') Sample Size for 1- α Cofidece Iterval of p (9.7) 2 [ z( / 2)] p *(1 p*) From prior data, experiece, 2 gut feeligs, séace. Or use 1/2. (9.8) E where p* ad q* are provisioal values used for plaig. 25
9: Ifereces Ivolvig Oe Populatio 9.2 Iferece about the Biomial Probability of Success Determiig the Sample Size Example: A supplier claims bolts are approx. 5% defective. Determie the sample size if we wat our estimate withi ±0.02 with 90% cofidece. 2 [ z( / 2)] p *(1 p*) E 2 1 0.90 E 0.02 z(0.1/ 2) 1.65 p* 0.05 2 [1.65] (0.05)(1 0.05) 0.12931875 2 323.4 324 (0.02) 0.0004 26
Chapter 9: Ifereces Ivolvig Oe Populatio Questios? Homework: Chapter 9 # 9, 21, 23, 45, 55 75, 93, 95, 97, 119, 121, 129, 131, 135 27
Review Chapter 8 28
8: Itroductio to Statistical Iferece 8.1 The Nature of Estimatio Poit estimate for a parameter: A sigle umber, to estimate a parameter usually the.. sample statistic. i.e. x is a poit estimate for μ Iterval estimate: A iterval bouded by two values ad used to estimate the value of a populatio parameter.. i.e. x ( some amout) is a iterval estimate for μ. poit estimate some amout 29
8: Itroductio to Statistical Iferece 8.1 The Nature of Estimatio Sigificace Level: Probability parameter outside iterval, α. P( ot i x some amout) = Level of Cofidece 1-α: P( x some amout < < x some amout) = 1 Cofidece Iterval: poit estimator some amout that depeds o cofidece level 30
8: Itroductio to Statistical Iferece 8.2 Estimatio of Mea μ (σ Kow) Thus, a (1-α) 100% cofidece iterval for μ is σ x ± z( / 2) which if α=0.05, a 95% cofidece iterval for μ is x±1.96 σ z(.025))=1.96. Cofidece Iterval for Mea: σ x z( / 2) σ to x z( / 2) (8.1) 31
8: Itroductio to Statistical Iferece 8.2 Estimatio of Mea μ (σ Kow) Sample Size Determiatio Recall that our Cofidece Iterval was σ which was say x ± z( / 2). Maximum Error of Estimate the we ca rewrite as Sample Size E = z( / 2) = x some amout σ z( / 2) σ E 2 (8.2) (8.3) 32
8: Itroductio to Statistical Iferece 8.2 Estimatio of Mea μ (σ Kow) = z( / 2) σ E 2 I this, z(α/2) is kow with specificatio of α. We ca set a E ad set σ (or get it from previous data) to obtai a miimum sample size to achieve E. Used a lot i Biological applicatios to determie how may subjects ad most IRBs require a estimate of. 33
8: Itroductio to Statistical Iferece 8.3 The Nature of Hypothesis Testig We call the proposed hypothesis the ull hypothesis ad the opposig hypothesis the alterative hypothesis. Null Hypothesis, H 0 : The hypothesis that we will test. Geerally a statemet that a parameter has a specific value. Alterative Hypothesis, H a : A statemet about the same parameter that is used i the ull hypothesis. parameter has a value differet from the value i the ull hypothesis. 34
8: Itroductio to Statistical Iferece 8.4 The Nature of Hypothesis Testig Example 1: Fried 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 Decisio Party a dud. Type II Error If do ot go to party ad it s great, we made a error i judgmet. We do ot go. Type I Error Correct Decisio If go to party ad it s a dud, we made i error i judgmet. 35
8: Itroductio to Statistical Iferece 8.4 The Nature of Hypothesis Testig 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 Decisio Type II Error If we reject H 0 ad it is true, we made i error i judgmet. Reject H 0. Type I Error Correct Decisio If we do ot reject H 0 ad it is false, we have made a error i judgmet. 36
8: Itroductio to Statistical Iferece 8.4 The Nature of Hypothesis Testig Type I Error: true ull hypothesis H 0 is rejected. Level of Sigificace (α): The probability of committig a type I error. (Sometimes α is called the false positive rate.) Type II Error: favor ull hypothesis that is actually false. Type II Probability (β): The probability of committig a type II error. Do Not Reject H 0 Reject H 0 H 0 True Type A Correct Decisio (1-α) Type I Error (α) H 0 False Type II Error (β) Type B Correct Decisio (1-β) 37
8: Itroductio to Statistical Iferece 8.4 The Nature of Hypothesis Testig HYPOTHESIS TESTING PAIRS Figure from Johso & Kuby, 2012. 38
8: Itroductio to Statistical Iferece 8.5 Hypothesis Test of Mea (σ Kow): Probability Approach Step 1 The Set-Up: Null (H 0 ) ad alterative (H a ) hypotheses H 0 : μ 69 vs. H a : μ < 69 Step 2 The Hypothesis Test Criteria: Test statistic. x 0 z* σ kow, is large so by CLT x is ormal / z* is ormal Step 3 The Sample Evidece: Calculate test statistic. x 0 67.2 69 z* 1.74 =15, x =67.2, 4 / 4 / 15 ormal Step 4 The Probability Distributio: 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 39
8: Itroductio to Statistical Iferece 8.5 Hypothesis Test of Mea (σ Kow): Probability Approach Step 1 The Set-Up: Null (H 0 ) ad alterative (H a ) hypotheses H 0 : μ 69 vs. H a : μ > 69 Step 2 The Hypothesis Test Criteria: Test statistic. x 0 z* σ kow, is large so by CLT x is ormal / z* is ormal Step 3 The Sample Evidece: Calculate test statistic. x 0 67.2 69 z* 1.74 =15, x =67.2, 4 / 4 / 15 ormal 0.9591 Step 4 The Probability Distributio: 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 40
8: Itroductio to Statistical Iferece 8.5 Hypothesis Test of Mea (σ Kow): Probability Approach Step 1 The Set-Up: Null (H 0 ) ad alterative (H a ) hypotheses H 0 : μ = 69 vs. H a : μ 69 Step 2 The Hypothesis Test Criteria: Test statistic. x 0 z* σ kow, is large so by CLT x is ormal / z* is ormal Step 3 The Sample Evidece: Calculate test statistic. x 0 67.2 69 z* 1.74 =15, x=67.2, 4 / 4 / 15 ormal Step 4 The Probability Distributio: 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 41
8: Itroductio to Statistical Iferece 8.5 Hypothesis Test of Mea (σ Kow): Classical Approach Step 1 The Set-Up: Null (H 0 ) ad alterative (H a ) hypotheses H 0 : μ = 69 vs. H a : μ 69 Step 2 The Hypothesis Test Criteria: Test statistic. x 0 z* σ kow, is large so by CLT x is ormal / z* is ormal Step 3 The Sample Evidece: Calculate test statistic. x 0 67.2 69 z* 1.74 =15, x =67.2, 4 / 4 / 15 ormal Step 4 The Probability Distributio: α = 0.05, z(α/2)=1.96 Step 5 The Results: z*=-1.74 z z( / 2), reject H 0, z z( / 2) fail to reject H 0 42
8: Itroductio to Statistical Iferece 8.5 Hypothesis Test of Mea (σ Kow): Classical Approach Let s examie the hypothesis test H 0 : μ 69 vs. H a : μ > 69 with α=.05 for the heights of Math 1700 studets. Geerate radom data values. 43
8: Itroductio to Statistical Iferece 8.5 Hypothesis Test of Mea (σ Kow): Classical Approach H 0 : μ μ 0 vs. H a : μ > μ 0 =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 Decisio (1-α) Type I Error (α) H 0 False (μ=72 ) Type II Error (β) Correct Decisio (1-β) 1-α 1-β Power of the test: 1 P( Reject H0 H0 False) β α zs ' Discrimiatio ability. Ability to detect differece. z critical 44
Chapter 8: Itroductio to Statistical Iferece Questios? Homework: Chapter 8 # 5, 15, 22, 24, 35, 47, 57, 59, 81, 93, 97, 106, 109, 119, 145, 157 45
Problem Solvig Sessio 46