Hypothesis Testing • One-sample tests – One-sample tests for the mean – One-sample tests for proportions • Two-sample tests – Two-sample tests for the mean 1 Hypothesis Testing 1. State the null hypothesis, H0 2. State the alternative hypothesis, HA 3. Choose α, our significance level 4. Select a statistical test, and find the observed test statistic 5. Find the critical value of the test statistic 6. Compare the observed test statistic with the critical value, and decide to accept or reject H0 2 • Suppose we are interested in mean annual precipitation across the western US. A sample of 23 weather stations has x = 550.47mm, s = 389.44mm. Use these values to test whether or not the mean annual precipitation across the western US is different from 500mm. 3 Data: Acidity data has been collected for a population of ~6000 lakes in Ontario, with a mean pH of μ = 6.69, and σ = 0.83. A group of 27 lakes in a particular region of Ontario with acidic conditions is sampled and is found to have a mean pH of x = 6.16, and a s = 0.60. Research question: Are the lakes in that particular region more acidic than the lakes throughout Ontario? 4 One-Sample Tests for Proportions • A proportion, rather than a mean • Can we use z statistic? 5 Sampling distribution of a proportion • Binomial distribution Source: http://www.ruf.rice.edu/%7Elane/stat_sim/binom_demo.html • Large values of n and values of p0 around 0.5 normal distribution 6 One-Sample Tests for Proportions • Data: A citywide survey finds that the proportion of households that own cars is p0 = 0.2. We survey 50 households and find that 16 of them own a car (p = 16/50 = 0.32) • Research question: Is the proportion of households in our survey that has a car different from the proportion found in the citywide survey? 7 8 In 2004, the proportion of rainy days at Chapel Hill is 0.22. I randomly selected 40 days, and found that 13 of them were rainy days. Is the proportion of rainy days in the sample significantly higher than the proportion throughout the year? 9 Hypothesis Testing • One-sample tests – One-sample tests for the mean – One-sample tests for proportions • Two-sample tests – Two-sample tests for the mean 10 Two-Sample t-tests •Variances are equal (homoscedasticity) ttest = | x1 - x 2 | Sp (1 / n1) + (1 / n2) Pooled estimate of the standard deviation: sp = (n1 - 1)s12 + (n2 - 1)s22 n1 + n2 - 2 df = n1 + n2 - 2 11 Two-Sample t-tests • Variances are unequal ttest = | x1 - x 2 | (s12 / n1) + (s22 / n2) df = min[(n1 - 1),(n2 - 1)] 12 Two-Sample t-tests • F-test 2 1 2 2 s F s df1 = n1 – 1 df2 = n2 – 1 13 F-test Table A.5 on pp. 218-220 gives F-dists. for 3 a levels (0.10, 0.05, and 0.01). E.g. selecting a = 0.05, given samples n1 = 11, n2 = 15 we would use df1 = 10, df2 = 14 14 Source: http://pics.bothner.com/2002/BristleconePines/BristeconePines02info.html 15 Is the north-facing slope wetter than the south-facing slope? Soil Moisture Data N S 0.53 0.4 0.63 0.35 0.49 0.51 n1 = 10 0.52 0.55 0.65 0.49 x1 0.557 0.54 0.47 0.6 0.51 0.67 0.44 0.43 0.49 0.51 0.54 x2 0.4775 0.59 s2 0.0711 s1 0.0773 n2 = 12 0.39 16 Assignment #4 Confidence Intervals & Hypothesis Testing • Textbook: • Page 40: #7 • Pages 62-64: #1, #2, #4, #5, #7 • Due: 5pm, Mar 24, 2006 (Friday) • Hardcopy preferred 17 Project (Optional) • Course website – http://www.unc.edu/courses/2006spring/geog/090/001/www • Due: 27 April 2006 (Thursday) 18 Lab 2 • Hypothesis Testing & Geographic Problems • Data: soilmoisure.xls • Due: 03/31/2006 (Friday) • Electronic copy is preferred. 19 Exam II • R (Mar 30) • Not cumulative • Review? 20