1 Hypothesis Testing One-sample tests –One-sample tests for the mean –One-sample tests for...

20
1 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

Transcript of 1 Hypothesis Testing One-sample tests –One-sample tests for the mean –One-sample tests for...

Page 1: 1 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

• One-sample tests

– One-sample tests for the mean

– One-sample tests for proportions

• Two-sample tests

– Two-sample tests for the mean

Page 2: 1 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.

2

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

Page 3: 1 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.

3

• Suppose we are interested in mean annual precipitation across the western US. A sample of 23 weather stations has = 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.

x

Page 4: 1 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.

4

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?

Page 5: 1 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.

5

One-Sample Tests for Proportions

• A proportion, rather than a mean

• Can we use z statistic?

Page 6: 1 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.

6

Sampling distribution of a proportion

• Binomial distribution

• Large values of n and values of p0 around 0.5 normal distribution

Source: http://www.ruf.rice.edu/%7Elane/stat_sim/binom_demo.html

Page 7: 1 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.

7

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?

Page 8: 1 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.

8

Page 9: 1 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.

9

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?

Page 10: 1 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

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

Page 11: 1 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.

11

Two-Sample t-tests

ttest =| x1 - x2 |

(1 / n1) + (1 / n2)Sp

sp(n1 - 1)s1

2 + (n2 - 1)s22

n1 + n2 - 2=

•Variances are equal (homoscedasticity)

Pooled estimate of the standard deviation:

df = n1 + n2 - 2

Page 12: 1 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.

12

ttest =| x1 - x2 |

(s12 / n1) + (s2

2 / n2)

df = min[(n1 - 1),(n2 - 1)]

Two-Sample t-tests

• Variances are unequal

Page 13: 1 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.

13

Two-Sample t-tests

• F-test

22

21

s

sF

df1 = n1 – 1 df2 = n2 – 1

Page 14: 1 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.

14

F-test

Table A.5 on pp. 218-220 gives F-dists. for 3 levels (0.10, 0.05, and 0.01). E.g. selecting = 0.05, given samples n1 = 11, n2 = 15 we would use df1 = 10, df2 = 14

Page 15: 1 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.

15Source: http://pics.bothner.com/2002/BristleconePines/BristeconePines02info.html

Page 16: 1 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.

16

557.01 x

0773.01 s

4775.02 x

0711.02 s

n1 = 10

n2 = 12

Soil Moisture DataN S

0.53 0.4

0.63 0.35

0.49 0.51

0.52 0.55

0.65 0.49

0.54 0.47

0.6 0.51

0.67 0.44

0.43 0.49

0.51 0.54

0.59

0.39

Is the north-facing slope wetter than the south-facing slope?

Page 17: 1 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.

17

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

Page 18: 1 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.

18

Project (Optional)

• Course website– http://www.unc.edu/courses/2006spring/geog/090/001/www

• Due: 27 April 2006 (Thursday)

Page 19: 1 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.

19

Lab 2

• Hypothesis Testing & Geographic Problems     

• Data: soilmoisure.xls          

• Due: 03/31/2006 (Friday)

• Electronic copy is preferred.          

Page 20: 1 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.

20

Exam II

• R (Mar 30)

• Not cumulative

• Review?