Class 14 Testing Hypotheses about Means Paired samples 10.3 p 419-425.

15
Class 14 Testing Hypotheses about Means Paired samples 10.3 p 419- 425

Transcript of Class 14 Testing Hypotheses about Means Paired samples 10.3 p 419-425.

Page 1: Class 14 Testing Hypotheses about Means Paired samples 10.3 p 419-425.

Class 14

Testing Hypotheses about MeansPaired samples

10.3 p 419-425

Page 2: Class 14 Testing Hypotheses about Means Paired samples 10.3 p 419-425.

Weight (in pounds) of 72 anorexic patients before and after treatment

Weight Weight   Weight Weight   Weight Weightbefore after   before after   before after

80.7 80.2   72.3 88.2   80.2 82.689.4 81.0   89.0 78.8   87.8 100.491.8 86.4   80.5 82.2   83.3 85.274.0 86.3   84.9 85.6   79.7 83.678.1 76.1   81.5 81.4   84.5 84.688.3 78.1   82.6 81.9   80.8 86.287.3 75.1   79.9 76.4   87.4 86.775.1 86.7   88.7 103.6   83.6 95.280.6 73.5   94.9 98.4   83.3 94.378.4 84.6   76.3 93.4   86.0 91.577.6 77.4   81.0 73.4   82.5 91.988.7 79.5   80.5 82.1   86.7 100.381.3 89.6   85.0 96.7   79.6 76.778.1 81.4   89.2 95.3   76.9 76.870.5 81.8   81.3 82.4   94.2 101.677.3 77.3   76.5 72.5   73.4 94.985.2 84.2   70.0 90.9   80.5 75.286.0 75.4   80.4 71.3   81.6 77.381.4 79.5   83.3 85.4   82.1 95.579.7 73.0   83.0 81.6   77.6 90.785.5 88.3   87.7 89.1   83.5 92.584.4 84.7   84.2 83.9   89.9 93.879.0 81.4   86.4 82.7   86.0 91.777.5 81.2   76.5 75.7   87.3 98.0

Page 3: Class 14 Testing Hypotheses about Means Paired samples 10.3 p 419-425.

Data/Data Analysis/Descriptive Statistics/Summary Statistics and

Confidence Level for MeanBefore   After  

Mean 82.36 Mean 85.04Standard Error 0.61 Standard Error 0.93Median 81.85 Median 84.05Mode 86 Mode 81.4Standard Deviation 5.184 Standard Deviation 7.927Sample Variance 26.875 Sample Variance 62.838Kurtosis -0.007 Kurtosis -0.614Skewness -0.022 Skewness 0.408Range 24.9 Range 32.3Minimum 70 Minimum 71.3Maximum 94.9 Maximum 103.6Sum 5929.9 Sum 6122.8Count 72 Count 72Confidence Level(95.0%) 1.218 Confidence Level(95.0%) 1.863

s/n^.57.9/72^.5

82.36 +/- 1.218 is the 95% confidence interval for the mean.

Page 4: Class 14 Testing Hypotheses about Means Paired samples 10.3 p 419-425.

H0: μb = μa

Ha: μa > μb

Test Statistic

𝑠𝑝𝑜𝑜𝑙𝑒𝑑=√ (71 )26.875+(71 )62.838142

=6.6975

𝑡=85.04−82.36

6.6975×√ 172 +172

=2.40

P-value = t.dist.rt(2.40,142) = 0.0088

Page 5: Class 14 Testing Hypotheses about Means Paired samples 10.3 p 419-425.

H0: μb = μa

Ha: μa > μb

t-Test: Two-Sample Assuming Equal Variances

  After BeforeMean 85.039 82.360Variance 62.838 26.875Observations 72 72Pooled Variance 44.857Hypothesized Mean Difference 0.000df 142t Stat 2.400P(T<=t) one-tail 0.00884t Critical one-tail 1.656P(T<=t) two-tail 0.018t Critical two-tail 1.977 

Same as previous

slide!

Data must be in two

columns.

If this is all you want, =t.test()

is for you!

Page 6: Class 14 Testing Hypotheses about Means Paired samples 10.3 p 419-425.

The 2-sample t-test we just did is VALID.

But we can do better…..By taking advantage of our paired

data.

Page 7: Class 14 Testing Hypotheses about Means Paired samples 10.3 p 419-425.

Paired Data• n1 must equal n2• For each of the before values, there must be a corresponding after

value for the same element.– Here the data elements are the patients. And the paired nature of the

data is OBVIOUS.• Using a paired test when the data are paired USUALLY leads to a

valid and LOWER p-value.– Because s1 and s2 (the standard deviations of each group) do NOT enter

into the “equation”– Instead, we use the sample standard deviation of the n differences…

which is usually “pretty” small.• Instead of dealing with the variation in weights across the patients (s1 and s2),

we deal only with the variation in pounds gained.– 90 to 92 and 45 to 47 are both gains of 2.

Page 8: Class 14 Testing Hypotheses about Means Paired samples 10.3 p 419-425.

H0: μb = μa

Ha: μa > μb

Better than

before!

t-Test: Paired Two Sample for Means

  After BeforeMean 85.039 82.36Variance 62.838 26.875Observations 72 72Pearson Correlation 0.3498Hypothesized Mean Difference 0df 71t Stat 2.9116P(T<=t) one-tail 0.0024t Critical one-tail 1.6666P(T<=t) two-tail 0.0048t Critical two-tail 1.9939 

Page 9: Class 14 Testing Hypotheses about Means Paired samples 10.3 p 419-425.

H0: μb = μa

Ha: μa > μb

The = t.dist(array1,array2,1,1) takes you directly to the p-value

1 for 1-tail 1 for paired

If all you want is the p-value…..

Page 10: Class 14 Testing Hypotheses about Means Paired samples 10.3 p 419-425.

H0: μb = μa

Ha: μa > μb ID Group Before After Aft-Before1 1 80.7 80.2 -0.52 1 89.4 81 -8.43 1 91.8 86.4 -5.44 1 74 86.3 12.35 1 78.1 76.1 -26 1 88.3 78.1 -10.2

67 3 82.1 95.5 13.468 3 77.6 90.7 13.169 3 83.5 92.5 970 3 89.9 93.8 3.971 3 86 91.7 5.772 3 87.3 98 10.7

Average 2.679167count 72stdev 7.807796

standard error 0.920158t-stat 2.911639dof 71

p-value 0.002401

A paired two-sample t-test for means

Is equivalent to

A one-sample t-test ofH0: μA-B = 0.

2.68/.92

Page 11: Class 14 Testing Hypotheses about Means Paired samples 10.3 p 419-425.

Case: The Sophomore Jinx

Page 12: Class 14 Testing Hypotheses about Means Paired samples 10.3 p 419-425.
Page 13: Class 14 Testing Hypotheses about Means Paired samples 10.3 p 419-425.

The Data….Exhibit 1American League Rookie Award Data, Non Pitchers

Rookie Year Sophomore YearYearPlayer G AB BA SA G AB BA SA1949Roy Sievers 140 471 306 471 113 370 238 3951950Walter Dropo 136 559 322 583 99 360 239 3691951Gilbert McDougald 131 402 306 488 152 555 263 3691953Harvey Kuenn 155 679 308 386 155 656 306 390

1998Ben Grieve 155 583 288 458 148 486 265 4811999Carlos Beltran 156 663 293 454 98 372 247 3662001Ichiro Suzuki 157 692 350 457 157 647 321 4252002Eric Hinske 151 566 279 481 124 449 243 4372003Angel Berroa 158 567 287 451 134 512 262 385

Exhibit 2National League Non-Pitchers

Rookie Year Sophomore YearYear Player G AB BA SA G AB BA SA

1950Samuel Jethroe 141 582 273 442 148 572 280 4601951Willie Mays 121 464 274 472 34 127 236 4091953James Gilliam 151 605 278 415 146 607 282 4181954Wallace Moon 151 635 304 435 152 593 295 4591955William Virdon 144 534 281 433 157 580 319 445

1996Todd Hollandsworth 149 478 291 437 106 296 247 3681997Scott Rolen 156 561 283 469 160 601 290 5322000Rafael Furcal 131 455 295 382 79 324 275 3702001Albert Pujols 161 590 329 610 157 590 314 561

Page 14: Class 14 Testing Hypotheses about Means Paired samples 10.3 p 419-425.

H0:

Ha:

Test Statistic

P-value and Conclusion

Page 15: Class 14 Testing Hypotheses about Means Paired samples 10.3 p 419-425.

additional notes….