sociology 5811: t-tests for difference in means wes longhofer, pinch-hitting for evan schofer

24
Sociology 5811: T-Tests for Difference in Means Wes Longhofer, pinch- hitting for Evan Schofer

Upload: regan-bucey

Post on 01-Apr-2015

222 views

Category:

Documents


5 download

TRANSCRIPT

Page 1: Sociology 5811: T-Tests for Difference in Means Wes Longhofer, pinch-hitting for Evan Schofer

Sociology 5811:T-Tests for Difference in Means

Wes Longhofer, pinch-hitting for Evan Schofer

Page 2: Sociology 5811: T-Tests for Difference in Means Wes Longhofer, pinch-hitting for Evan Schofer

Strategy for Mean Difference

• We never know true population means• So, we never know true value of difference in means

• So, we don’t know if groups really differ

• If we can figure out the sampling distribution of the difference in means…

• We can guess the range in which it typically falls

• If it is improbable for the sampling distribution to overlap with zero, then the population means probably differ

• An extension of the Central Limit Theorem provides information necessary to do calculations!

Page 3: Sociology 5811: T-Tests for Difference in Means Wes Longhofer, pinch-hitting for Evan Schofer

Sampling Distribution for Difference in Means

• The mean (Y-bar) is a variable that changes depending on the particular sample we took

• Similarly, the differences in means for two groups varies, depending on which two samples we chose

• The distribution of all possible estimates of the difference in means is a sampling distribution!

• The “sampling distribution of differences in means”

• It reflects the full range of possible estimates of the difference in means.

Page 4: Sociology 5811: T-Tests for Difference in Means Wes Longhofer, pinch-hitting for Evan Schofer

Mean Differences for Small Samples

• Sample Size: rule of thumb

• Total N (of both groups) > 100 can safely be treated as “large” in most cases

• Total N (of both groups) < 100 is possibly problematic

• Total N (of both groups) < 60 is considered “small” in most cases

• If N is small, the sampling distribution of mean difference cannot be assumed to be normal

• Again, we turn to the T-distribution.

Page 5: Sociology 5811: T-Tests for Difference in Means Wes Longhofer, pinch-hitting for Evan Schofer

Mean Differences for Small Samples

• To use T-tests for small samples, the following criteria must be met:

• 1. Both samples are randomly drawn from normally distributed populations

• 2. Both samples have roughly the same variance (and thus same standard deviation)

• To the extent that these assumptions are violated, the T-test will become less accurate

• Check histogram to verify!

• But, in practice, T-tests are fairly robust.

Page 6: Sociology 5811: T-Tests for Difference in Means Wes Longhofer, pinch-hitting for Evan Schofer

Mean Differences for Small Samples

• For small samples, the estimator of the Standard Error is derived from the variance of both groups (i.e. it is “pooled”)

• Formulas:

2

))(1())(1(s

21

222

211

)Y-Y( 21

NN

sNsN

Page 7: Sociology 5811: T-Tests for Difference in Means Wes Longhofer, pinch-hitting for Evan Schofer

Probabilities for Mean Difference

• A T-value may be calculated:

21

212

1121

21

NNs

)YY(t

)YY(

)N(N

• Where (N1 + N2 – 2) refers to the number of degrees of freedom– Recall, t is a “family” of distributions– Look up t-dist for “N1 + N2 -2” degrees of freedom.

Page 8: Sociology 5811: T-Tests for Difference in Means Wes Longhofer, pinch-hitting for Evan Schofer

T-test for Mean Difference

• Back to the example: 20 boys & 20 girls

• Boys: Y-bar = 72.75, s = 8.80

• Girls: Y-bar = 78.20, s = 9.55

• Let’s do a hypothesis test to see if the means differ:

• Use -level of .05

• H0: Means are the same (boys = girls)

• H1: Means differ (boys ≠ girls).

Page 9: Sociology 5811: T-Tests for Difference in Means Wes Longhofer, pinch-hitting for Evan Schofer

T-test for Mean Difference

21

212

1121

21

NNs

)YY(t

)YY(

)N(N

201

201

45.5

21

38

)YY(

)(

s

)(t

• Calculate t-value:

Page 10: Sociology 5811: T-Tests for Difference in Means Wes Longhofer, pinch-hitting for Evan Schofer

T-Test for Mean Difference

• We need to calculate the Standard Error of the difference in means:

2

))(1())(1(s

21

222

211

)Y-Y( 21

NN

sNsN

38

)55.9)(19()80.8)(19(s

22

)Y-Y( 21

Page 11: Sociology 5811: T-Tests for Difference in Means Wes Longhofer, pinch-hitting for Evan Schofer

T-Test for Mean Difference

• We also need to calculate the Standard Error of the difference in means:

38

)85.1732()36.1471(s )Y-Y( 21

18.932.84s )Y-Y( 21

Page 12: Sociology 5811: T-Tests for Difference in Means Wes Longhofer, pinch-hitting for Evan Schofer

T-test for Mean Difference

21

212

1121

21

NNs

)YY(t

)YY(

)N(N

201

201

)18.9(

45.538

)(t )(

• Plugging in Values:

Page 13: Sociology 5811: T-Tests for Difference in Means Wes Longhofer, pinch-hitting for Evan Schofer

T-test for Mean Difference

)316)(.18.9(

45.538

)(t )(

88.1)90.2(

45.538

)(t )(

Page 14: Sociology 5811: T-Tests for Difference in Means Wes Longhofer, pinch-hitting for Evan Schofer

T-Test for Mean Difference

• Question: What is the critical value for =.05, two-tailed T-test, 38 degrees of freedom (df)?

• Answer: Critical Value = approx. 2.03

• Observed T-value = 1.88

• Can we reject the null hypothesis (H0)?

• Answer: No! Not quite!• We reject when t > critical value

Page 15: Sociology 5811: T-Tests for Difference in Means Wes Longhofer, pinch-hitting for Evan Schofer

T-Test for Mean Difference

• The two-tailed test hypotheses were:

GirlsBoys μμ :H1

GirlsBoys μμ :H0

• Question: What hypotheses would we use for the one-tailed test?

GirlsBoys μμ :H1

GirlsBoys μμ :H0

Page 16: Sociology 5811: T-Tests for Difference in Means Wes Longhofer, pinch-hitting for Evan Schofer

T-Test for Mean Difference

• Question: What is the critical value for =.05, one-tailed T-test, 38 degrees of freedom (df)?

• Answer: Around 1.684 (40 df)

• One-tailed test: T =1.88 > 1.684• We can reject the null hypothesis!!!

• Moral of the story:• If you have strong directional suspicions ahead of time, use

a one-tailed test. It increases your chances of rejecting H0.

• But, it wouldn’t have made a difference at =.01

Page 17: Sociology 5811: T-Tests for Difference in Means Wes Longhofer, pinch-hitting for Evan Schofer

Another Example• Question: Do the mean batting averages for American

League and National League teams differ?• Use a random sample of teams over time

• American League: Y-bar = .2677, s = .0068, N=14• National League: Y-bar = .2615, s = .0063, N=16• Let’s do a hypothesis test to see if the means differ:

• Use -level of .05

• H0: Means are the same (American = National)

• H1: Means differ (American ≠ National)

Page 18: Sociology 5811: T-Tests for Difference in Means Wes Longhofer, pinch-hitting for Evan Schofer

T-test for Mean Difference

21

212

1121

21

NNs

)YY(t

)YY(

)N(N

161

141

0062.

21

28

)YY(

)(

s

)(t

• Calculate t-value:

Page 19: Sociology 5811: T-Tests for Difference in Means Wes Longhofer, pinch-hitting for Evan Schofer

T-Test for Mean Difference

• We need to calculate the Standard Error of the difference in means:

2

))(1())(1(s

21

222

211

)Y-Y( 21

NN

sNsN

28

)0063)(.15()0068)(.13(s

22

)Y-Y( 21

Page 20: Sociology 5811: T-Tests for Difference in Means Wes Longhofer, pinch-hitting for Evan Schofer

T-Test for Mean Difference

• We also need to calculate the Standard Error of the difference in means:

28

)0006(.)0006(.s )Y-Y( 21

0065.s )Y-Y( 21

Page 21: Sociology 5811: T-Tests for Difference in Means Wes Longhofer, pinch-hitting for Evan Schofer

T-test for Mean Difference

21

212

1121

21

NNs

)YY(t

)YY(

)N(N

161

141

)0065(.

0062.)28(

)(t

• Plugging in Values:

Page 22: Sociology 5811: T-Tests for Difference in Means Wes Longhofer, pinch-hitting for Evan Schofer

T-test for Mean Difference

)366)(.0065(.

0062.28

)(t )(

58.2)0024(.

0062.28

)(t )(

Page 23: Sociology 5811: T-Tests for Difference in Means Wes Longhofer, pinch-hitting for Evan Schofer

T-Test for Mean Difference

• Question: What is the critical value for =.05, two-tailed T-test, 28 degrees of freedom (df)?

• Answer: Critical Value = approx. 2.05

• Observed T-value = 2.58

• Can we reject the null hypothesis (H0)?

• Answer: Yes• We reject when t > critical value

• What if we used an -level of .01?– Critical value=2.76

Page 24: Sociology 5811: T-Tests for Difference in Means Wes Longhofer, pinch-hitting for Evan Schofer

T-Test for Mean Difference• Question: What if you wanted to compare 3 or

more groups, instead of just two?• Example: Test scores for students in different educational

tracks: honors, regular, remedial

• Can you use T-tests for 3+ groups?• Answer: Sort of… You can do a T-test for every

combination of groups• e.g., honors & reg, honors & remedial, reg & remedial

• But, the possibility of a Type I error proliferates… 5% for each test

• With 5 groups, chance of error reaches 50%• Solution: ANOVA.