Class 4 Daniel B. Rowe, Ph.D. Department of Mathematics, Statistics, and Computer Science Copyright 013 by D.B. Rowe 1
Agenda: Recap Chapter 9. and 9.3 Lecture Chapter 10.1-10.3 Review Exam 6 Problem Solving Session
Recap Chapter 9.3 and 9.4 3
9: Inferences Involving One Population 9. Inference about the Binomial Probability of Success Hypothesis Testing Procedure We can perform hypothesis tests on the proportion H 0 : p p 0 vs. H a : p < p 0 H 0 : p p 0 vs. H a : p > p 0 H 0 : p = p 0 vs. H a : p p 0 Test Statistic for a Proportion p z* p' p0 p0(1 p0) with n p' x n (9.9) 4
9: Inferences Involving One Population 9. Inference about the Binomial Probability of Success Step 1: H 0 : p=.61 ( ) vs. H a : p >.61 Step : Step 3: Step 4: Step 5: Since.34>1.65, Reject H 0. p' p0 z* x p0(1 p0) p' n n 0.671 0.61 z*.34 0.61(1 0.61) 350 P( z z(0.05)) 1.65 35 p' 0.671 350 Figure from Johnson & Kuby, 01. 5
9: Inferences Involving One Population 9.3 Inference about the Variance and Standard Deviation We can perform hypothesis tests on the variance. H 0 : σ σ 0 vs. H a : σ < σ 0 H 0 : σ σ 0 vs. H a : σ > σ 0 H 0 : σ = σ 0 vs. H a : σ σ 0 1. χ is nonnegative. χ is not symmetric, skewed to right 3. χ is distributed to form a family each determined by df=n-1. For this hypothesis test, use the χ distribution ignore df df Figure from Johnson & Kuby, 01. 6
9: Inferences Involving One Population 9.3 Inference about the Variance and Standard Deviation Test Statistic for Variance (and Standard Deviation) * ( n1) s 0 Will also need critical values. P ( df, ) sample variance, with df=n-1. (9.10) hypothesized population variance Table 8 Appendix B Page 71 df=n-1 Figure from Johnson & Kuby, 01. 7
9: Inferences Involving One Pop. Example: Find χ (0,0.05). Table 8, Appendix B, Page 71. Figures from Johnson & Kuby, 01. 8
9: Inferences Involving One Population Example: A soft-drink bottling company wants to control variability by not allowing the variance to exceed 0.0004. A sample is taken, n=8, s =0.0007 and α=0.05. Step 1 H 0 : σ 0.0004 vs. H a : σ > 0.0004 Step Step 3 * df=n-1 Step 4 ( n1) s 0 0.005<p-value<0.01 Step 5 and σ 0 =0.0004 (8 1)(0.0007) * 47.5 0.0004 (7,.05) 40.1 Reject H 0 since p-value<.05 or because 47.5>40.1.. 9 40.1 α=0.05
Chapter 9: Inferences Involving One Population Questions? Homework: Chapter 9 # 9, 1, 3, 45, 55 75, 93, 95, 97, 119, 11, 19, 131, 135 10
Lecture Chapter 10 11
Chapter 10: Inference Involving Two Populations Daniel B. Rowe, Ph.D. Department of Mathematics, Statistics, and Computer Science 1
10: Inferences Involving Two Populations 10.1 Dependent and Independent Samples In this chapter we will have samples from two populations. The two populations can either be dependent or independent. Dependent Samples: If samples have related pairs. Random sample of married couples. Male Height vs. Female Height Independent Samples: If samples are unrelated. Random sample of males, Random Sample of females. Male Height vs. Female Height 13
10: Inferences Involving Two Populations 10. Inference Concerning the Mean Difference Using Two Dependent Samples When we have dependent samples, there is a commonality between the two items in the pair. Quite often before and after. Population 1: Population : 1 c before common mean c after common mean But we re interested in the difference in means: 1 ( c before ) ( c after ) before after common mean subtracts out 14
10: Inferences Involving Two Populations 10. Inference for Mean Difference Two Dependent Samples We form a paired difference from the data Paired Difference d x x 1 (10.1) This means that we are subtracting the sample value from population from the sample value from population 1. 15
10: Inferences Involving Two Populations 10. Inference for Mean Difference Two Dependent Samples Imagine that we have paired data ( x1,1, x,1),...,( x1, n, x, n), population j, observation i where j=1, i=1,,n. x ji, We form a paired difference from the data d1 x1,1 x,1, d x1, x,,..., dn x1, n x, n. d x x i 1, i, i When paired observations are randomly selected from normal populations, the paired difference, di x1, i x, i will be approximately normally distributed about a mean with a standard deviation. d d 16
10: Inferences Involving Two Populations 10. Inference for Mean Difference Two Dependent Samples So if the d i s are approximately normally distributed with a mean of and a standard deviation of, then d 1 n di n i 1 d is normally distributed (recall CLT) with a mean d d d, and standard deviation d. n d 17
10: Inferences Involving Two Populations 10. Inference for Mean Difference Two Dependent Samples This would allow us to form a z statistic for the mean of d d differences d, z with a standard normal distribution. / n d assuming known We can then look up probabilities in the table, find critical values z(α/), construct confidence intervals d d z( / ) d n 0d and test hypotheses using z*. / n d Figure from Johnson & Kuby, 01. 18
10: Inferences Involving Two Populations 10. Inference for Mean Difference Two Dependent Samples However, as in Inferences for One Population, we never know the true value of standard deviation s d. This changes to t d s d / d n d. So we estimate it with sample and the distribution from standard normal n 1 to Student t with df=n-1 where sd ( di d ). n 1 z d i1 d / d n 19
10: Inferences Involving Two Populations 10. Inference for Mean Difference Two Dependent Samples Confidence Interval Procedure With unknown, a 1-α confidence interval for is: d Confidence Interval for Mean Difference (Dependent Samples) d sd sd t( df, / ) to d t( df, / ) n n where df=n-1 d (10.) d 1 d (10.3) s d d (10.4) 1 n i n i 1 n d ( i ) n 1 i1 0
10: Inferences Involving Two Populations 10. Inference for Mean Difference Two Dependent Samples Example: Construct a 95% CI for mean difference in Brand B A tire wear. d 8, 1, 9, 1, 1, 9 1 n i s: d di n 6 df 5 n i 1 t( df, / ) n d 0.05 1 sd ( di d ) n 1 i1 sd sd d t( df, / ) n Figure from Johnson & Kuby, 01. 1
10: Inferences Involving Two Populations 10. Inference for Mean Difference Two Dependent Samples Hypothesis Testing Procedure We can test for differences in the population means: H 0 : μ 1 μ vs. H a : μ 1 <μ H 0 : μ 1 -μ 0 vs. H a : μ 1 -μ <0 H 0 : μ 1 μ vs. H a : μ 1 >μ H 0 : μ 1 -μ 0 vs. H a : μ 1 -μ >0 H 0 : μ 1 =μ vs. H a : μ 1 μ H 0 : μ 1 -μ =0 vs. H a : μ 1 -μ 0 μ d =μ 1 -μ H 0 : μ d 0 vs. H a : μ d <0 (μ d = μ before - μ after ) H 0 : μ d 0 vs. H a : μ d >0 H 0 : μ d =0 vs. H a : μ d 0 3
10: Inferences Involving Two Populations 10. Inference for Mean Difference Two Dependent Samples Hypothesis Testing Procedure With unknown, the test statistic for is: d d Test Statistic for Mean Difference (Dependent Samples) d t* s d / d 0 n where df=n-1 (10.5) Go through the same five hypothesis testing steps. 4
10: Inferences Involving Two Populations 10. Inference for Mean Difference Two Dependent Samples n 6 8, 1, 9, 1, 1, 9 Example: Test mean difference of Brand B minus Brand A is zero. Step 1 Step Step 5 Step 3 Step 4 Figures from Johnson & Kuby, 01. 5
10: Inferences Involving Two Populations 10.3 Inference for Mean Difference Two Independent Samples For Normal said that mean( x) and variance( x). n We are often interested in comparisons between means x x. There s a rule that says that if and have means and, then mean( x x ) 1 1 and variances and, 1 1 and variance x1 x x. 1 x n n n n if x 1 & x independent 1 1 x1 x 1 1 1 7
10: Inferences Involving Two Populations 10.3 Inference for Mean Difference Two Independent Samples Means Using Two Independent Samples If two populations are independent we can construct confidence intervals and test hypotheses for the difference in their means. If independent samples of sizes n 1 and n are drawn with means μ 1 and μ and variances 1 and, then the sampling distribution of x1 x has 1. mean x 1x 1 and 1. standard error x1 x n1 n If both pops. are normal, then x x is normal. (10.6) 1 Actually the CLT works here for x s. 8
10: Inferences Involving Two Populations 10.3 Inference for Mean Difference Two Independent Samples However, the true population variances are never truly known 1 so we estimate and by and and the s 1 s standard error by x x 1 s x x 1 1 n n 1 s 1 s n n 1. (10.6) (10.7) 9
10: Inferences Involving Two Populations 10.3 Inference for Mean Difference Two Independent Samples Confidence Interval Procedure With and unknown, a 1-α confidence interval for is: df Confidence Interval for Mean Difference (Independent Samples) s 1 s s 1 s ( x1 x) t( df, / ) to ( x1 x) t( df, / ) n1 n n1 n where df is either calculated or smaller of df 1, or df (10.8) 1 1 Actually, this is for σ 1 σ. Next larger number than s1 / n1 s / n s1 s n1 n n1 1 n 1 If using a computer program. If not using a computer program. 30
10: Inferences Involving Two Populations 10.3 Inference Mean Difference Confidence Interval Example: Interested in difference in mean heights between men and women. The heights of 0 females and 30 males is measured. Construct a 95% confidence interval for, & unknown s s m f ( xm x f) t( df, / ) n m n f n1 n m f x f x m m f s f s m 0.05 t(19,.05) Figure from Johnson & Kuby, 01. 31
10: Inferences Involving Two Populations 10.3 Inference for Mean Difference Two Independent Samples Hypothesis Testing Procedure We can test for differences in the population means: H 0 : μ 1 μ vs. H a : μ 1 <μ H 0 : μ 1 -μ 0 vs. H a : μ 1 -μ <0 H 0 : μ 1 μ vs. H a : μ 1 >μ H 0 : μ 1 -μ 0 vs. H a : μ 1 -μ >0 H 0 : μ 1 =μ vs. H a : μ 1 μ H 0 : μ 1 -μ =0 vs. H a : μ 1 -μ 0 33
10: Inferences Involving Two Populations 10.3 Inference for Mean Difference Two Independent Samples Hypothesis Testing Procedure With and unknown, the test statistic for is: 1 1 Test Statistic for Mean Difference (Independent Samples) t* ( x x ) ( ) 1 1 s 1 s n n 1 where df is either calculated or smaller of df 1, or df (10.9) Actually, this is for σ 1 σ. Go through the same five hypothesis testing steps. df Next larger number than s1 / n1 s / n s1 s n1 n n1 1 n 1 If using a computer program. If not using a computer program. 34
Weight 10: Inferences Involving Two Populations 10.3 Inference for Mean Difference Two Independent Samples Hypothesis Testing Procedure 0 00 180 160 140 10 100 Height vs. Weight 16 14 1 10 8 6 4 males and females 0 55 60 65 70 75 80 55 57 59 61 63 65 67 69 71 73 75 77 79 Height Height N=93 values TuTh 104 x 34
10: Inferences Involving Two Populations 10.3 Inference for Mean Difference Two Independent Samples Hypothesis Testing Procedure 93 values 16 TuTh 104 14 males and females xm 1 10 8 6 4 x x f 0 55 57 59 61 63 65 67 69 71 73 75 77 79 Height Is the height of males = height of females at α=.05? 36
10: Inferences Involving Two Populations 10.3 Inference for Mean Difference Two Independent Samples Hypothesis Testing Procedure 93 values Step 1 Step Step 3 n n x x s s m f m f m f 37 56 71.5 65.3 10.0 7.4 TuTh 104 x m x f Step 4 Step 5 37
Chapter 10: Inferences Involving Two Populations Questions? Homework: Chapter 10 # 13, 15, 3, 5, 9, 31, 35 41, 45, 53, 57, 58, 59, 63, 83, 85, 91, 98, 99, 101 111, 113, 115, 117, 119, 15 133 43
Review Chapter 8 44
8: Introduction to Statistical Inference 8.1 The Nature of Estimation Point estimate for a parameter: A single number, to estimate a parameter usually the.. sample statistic. i.e. x is a point estimate for μ Interval estimate: An interval bounded by two values and used to estimate the value of a population parameter.. i.e. x ( some amount) is an interval estimate for μ. point estimate some amount 45
8: Introduction to Statistical Inference 8.1 The Nature of Estimation Significance Level: Probability parameter outside interval, α. P( not in x some amount) = Level of Confidence 1-α: P( x some amount < < x some amount) = 1 Confidence Interval: point estimator some amount that depends on confidence level 46
8: Introduction to Statistical Inference 8. Estimation of Mean μ (σ Known) Thus, a (1-α) 100% confidence interval for μ is σ x ± z( / ) n which if α=0.05, a 95% confidence interval for μ is x±1.96 σ z(.05))=1.96. n Confidence Interval for Mean: σ x z( / ) σ to x z( / ) (8.1) n n 47
8: Introduction to Statistical Inference 8. Estimation of Mean μ (σ Known) Sample Size Determination Recall that our Confidence Interval was σ which was say x ± z( / ). n Maximum Error of Estimate then we can rewrite as Sample Size E = z( / ) n= x some amount σ n z( / ) σ E (8.) (8.3) 48
8: Introduction to Statistical Inference 8. Estimation of Mean μ (σ Known) n= z( / ) σ E In this, z(α/) is known with specification of α. We can set an E and set σ (or get it from previous data) to obtain a minimum sample size n to achieve E. Used a lot in Biological applications to determine how many subjects and most IRBs require an estimate of n. 49
8: Introduction to Statistical Inference 8.3 The Nature of Hypothesis Testing We call the proposed hypothesis the null hypothesis and the opposing hypothesis the alternative hypothesis. Null Hypothesis, H 0 : The hypothesis that we will test. Generally a statement that a parameter has a specific value. Alternative Hypothesis, H a : A statement about the same parameter that is used in the null hypothesis. parameter has a value different from the value in the null hypothesis. 50
8: Introduction to Statistical Inference 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. 51
8: Introduction to Statistical Inference 8.4 The Nature of Hypothesis Testing Example : 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. 5
8: Introduction to Statistical Inference 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-β) 53
8: Introduction to Statistical Inference 8.4 The Nature of Hypothesis Testing HYPOTHESIS TESTING PAIRS Figure from Johnson & Kuby, 01. 54
8: Introduction to Statistical Inference 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 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. 69 z* 1.74 n=15, x =67., 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 55
8: Introduction to Statistical Inference 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 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. 69 z* 1.74 n=15, x =67., 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 56
8: Introduction to Statistical Inference 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 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. 69 z* 1.74 n=15, x=67., 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 57
8: Introduction to Statistical Inference 8.5 Hypothesis Test of Mean (σ Known): Classical Approach Step 1 The Set-Up: Null (H 0 ) and alternative (H a ) hypotheses H 0 : μ = 69 vs. H a : μ 69 Step 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. 69 z* 1.74 n=15, x =67., 4 / n 4 / 15 normal Step 4 The Probability Distribution: α = 0.05, z(α/)=1.96 Step 5 The Results: z*=-1.74 z z( / ), reject H 0, z z( / ) fail to reject H 0 58
8: Introduction to Statistical Inference 8.5 Hypothesis Test of Mean (σ Known): Classical Approach Let s examine the hypothesis test H 0 : μ 69 vs. H a : μ > 69 with α=.05 for the heights of Math 1700 students. Generate random data values. 59
8: Introduction to Statistical Inference 8.5 Hypothesis Test of Mean (σ Known): Classical Approach 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 (μ=7 ) Type II Error (β) Correct Decision (1-β) 1-α 1-β Power of the test: 1 P( Reject H0 H0False) β α zs ' Discrimination ability. Ability to detect difference. z critical 60
Chapter 8: Introduction to Statistical Inference Questions? Homework: Chapter 8 # 5, 15,, 4, 35, 47, 57, 59, 81, 93, 97, 106, 109, 119, 145, 157 61