Download Hypothesis Testing: Comparing Two Samples - Prof. Asatar P. Bair and more Exams Statistics in PDF only on Docsity! Econ 5 Introduction to Statistics Asatar Bair, Ph.D. Department of Economics City College of San Francisco abair@ccsf.edu Lectures on Chapter 10 Hypothesis Testing: Comparisons Hypotheses involving comparisons In this section, we’re continuing our discussion of hypothesis testing, with application to the topic of whether two samples come from a population that is the same or different Example: Greystone Dept Stores Greystone Departments stores operates two stores in Buffalo, NY. One is in the city and the other is in a suburban mall. Some products sell better in one store than the other. Is it due to differences in the population, perhaps a difference in the average age? Suppose we want an estimate of the difference in the mean age of customers at the two stores. Example: Greystone Dept Stores Define the average age of the city store as !1 and the average age of the suburban store as !2. We’re interested in !1 - !2. However, we don’t know these population parameters, so we must rely on estimators, x1 and x2. Since x1 and x2 are both random variables, a point estimate of the difference would be simply: (x1 - x2) Example: Greystone Dept Stores The problem with the point estimate is that, although very precise, it is not very accurate, i.e. it is unlikely to be correct. So we need an interval estimate, to control the probability of making an error. Sampling Distribution of x1 - x2 x!1 - !2 x- 1 2 Again, we’re interested in both the shape of the distribution and its spread. x x- 1 2 E( ) = If n1 and n2 ! 30, or if population ~ N, the sampling distribution will be normal. ! " x 1#x 2 = "1 2 n1 + " 2 2 n2 x 1 # x 2( ) ± Margin of error x 1 # x 2( ) ± z$ / 2 "1 2 n1 + " 2 2 n2 40 # 35( ) ±1.96 9 2 35 + 10 2 49 = 5 ± 4.06 = 0.94, 9.06 z calc = x 1 # x 2( ) #D0 "1 2 n1 + " 2 2 n2 = (82# 78) # 0 102 30 + 102 40 =1.66 unbiased Interval Estimate City store Suburban store n1 = 36 n2 = 49 x1 = 40 years old x2 = 35 years old ! " x 1#x 2 = "1 2 n1 + " 2 2 n2 x 1 # x 2( ) ± Margin of error x 1 # x 2( ) ± z$ / 2 "1 2 n1 + " 2 2 n2 40 # 35( ) ±1.96 9 2 36 + 10 2 49 = 5 ± 4.06 = 0.94, 9.06 z calc = x 1 # x 2( ) #D0 "1 2 n1 + " 2 2 n2 = (82# 78) # 0 102 30 + 102 40 =1.66 " = 0.05 Example: Test scores ! " x 1#x 2 = "1 2 n1 + " 2 2 n2 x 1 # x 2( ) ± Margin of error x 1 # x 2( ) ± z$ / 2 "1 2 n1 + " 2 2 n2 40 # 35( ) ±1.96 9 2 36 + 10 2 49 = 5 ± 4.06 = 0.94, 9.06 z calc = x 1 # x 2( ) #D0 "1 2 n1 + " 2 2 n2 = (82# 78) # 0 102 30 + 102 40 =1.66 Calculating our test statistic, we get: Critical value = z"/2 = 1.96 p-value = 2(0.0485) = 0.0970 We reject the null hypothesis Test scores Fail to reject H0 Reject H0Reject H0 x0 x- 1 2 -1.96 1.96 1.66 4 Example: Test scores Conclusion: evidence from our sample is sufficient to reject the null hypothesis that !1 - !2 = 0; the sample evidence suggests that there is a difference between the population means. What if we don’t know !1 and !2? Clearwater Bank Clearwater Bank wants to know the difference between average checking account balance at two branches: Cherry Grove Beechmont n1 = 28 n2 = 22 x1 = $1025 x2 = $910 s1 = 10 s2 = 10 In this case, we don’t have !1 and !2, so we use s1 and s2. Interval Estimate " = 0.05 ! x 1 " x 2( ) ± t# / 2 s 1 2 n 1 + s 2 2 n 2 df = s1 2 n1 + s2 2 n2 $ % & ' ( ) 2 1 n1 "1 s1 2 n1 $ % & ' ( ) 2 + 1 n2 "1 s2 2 n2 $ % & ' ( ) 2 = 150 2 28 + 125 2 22 $ % & ' ( ) 2 1 28"1 150 2 28 $ % & ' ( ) 2 + 1 22 "1 125 2 22 $ % & ' ( ) 2 = 47.8 * 47 1025" 910( ) ± 2.012 150 2 28 + 125 2 22 = 115 ± 78 = 37, 193 tcalc = x 1 " x 2( ) "D0 s 1 2 n1 + s 2 2 n2 = (325" 286) " 0 40 2 12 + 44 2 12 = 2.27