Statistics for Managers using Microsoft Excel 3 rd

  • Slides: 41
Download presentation
Statistics for Managers using Microsoft Excel 3 rd Edition Chapter 8 Two Sample Tests

Statistics for Managers using Microsoft Excel 3 rd Edition Chapter 8 Two Sample Tests with Numerical Data © 2002 Prentice-Hall, Inc. Chap 8 -1

Chapter Topics n Comparing two independent samples n n Independent samples Z test for

Chapter Topics n Comparing two independent samples n n Independent samples Z test for the difference in two means Pooled variance t test for the difference in two means n F test for the difference in two variances n Comparing two related samples n Paired sample z test for the mean difference n Paired sample t test for the mean difference © 2002 Prentice-Hall, Inc. 2

Chapter Topics n (continued) Wilcoxon rank-sum test n Difference in two medians © 2002

Chapter Topics n (continued) Wilcoxon rank-sum test n Difference in two medians © 2002 Prentice-Hall, Inc. 3

Comparing Two Independent Samples n Different data sources n Unrelated n Independent n Sample

Comparing Two Independent Samples n Different data sources n Unrelated n Independent n Sample selected from one population has no effect or bearing on the sample selected from the other population n Use the difference between 2 sample means n Use Z test or pooled variance t test © 2002 Prentice-Hall, Inc. 4

Independent Sample Z Test (Variances Known) n Assumptions n n n Samples are randomly

Independent Sample Z Test (Variances Known) n Assumptions n n n Samples are randomly and independently drawn from normal distributions Population variances are known Test statistic n © 2002 Prentice-Hall, Inc. 5

Independent Sample Z Test (Large Samples) n n Assumptions n Samples are randomly and

Independent Sample Z Test (Large Samples) n n Assumptions n Samples are randomly and independently drawn n Population variances either known or unknown n Both sample sizes are at least 30 Test statistic © 2002 Prentice-Hall, Inc. 6

Independent Sample (Two Sample) Z Test in EXCEL n Independent sample Z test with

Independent Sample (Two Sample) Z Test in EXCEL n Independent sample Z test with variances known n n Tools | data analysis | z-test: two sample for means Independent sample Z test with large sample n n Tools | data analysis | z-test: two sample for means If the population variances are unknown, use sample variances © 2002 Prentice-Hall, Inc. 7

Pooled Variance t Test (Variances Unknown) n Assumptions n Both populations are normally distributed

Pooled Variance t Test (Variances Unknown) n Assumptions n Both populations are normally distributed n Samples are randomly and independently drawn n n Population variances are unknown but assumed equal If both populations are not normal, need large sample sizes © 2002 Prentice-Hall, Inc. 8

Developing the Pooled Variance t Test n Setting up the hypotheses H 0: m

Developing the Pooled Variance t Test n Setting up the hypotheses H 0: m 1 = m 2 H 1: m 1 ¹ m 2 H 0: m 1 £ m 2 H 1: m 1 > m 2 H 0: m 1 ³ m 2 H 1: m 1 < m 2 © 2002 Prentice-Hall, Inc. OR H 0: m 1 -m 2 = 0 H 1: m 1 - m 2 ¹ 0 Two Tail OR H 0: m 1 - m 2 £ 0 H 1: m 1 - m 2 > 0 Right Tail H 0: m 1 - m 2 ³ 0 H 1: m 1 - m 2 < 0 Left Tail OR 9

Developing the Pooled Variance t Test (continued) n Calculate the pooled sample variances as

Developing the Pooled Variance t Test (continued) n Calculate the pooled sample variances as an estimate of the common population variance © 2002 Prentice-Hall, Inc. 10

Developing the Pooled Variance t Test (continued) n Compute the sample statistic Hypothesized difference

Developing the Pooled Variance t Test (continued) n Compute the sample statistic Hypothesized difference © 2002 Prentice-Hall, Inc. 11

Pooled Variance t Test: Example You’re a financial analyst for Charles Schwab. Is there

Pooled Variance t Test: Example You’re a financial analyst for Charles Schwab. Is there a difference in dividend yield between stocks listed on the NYSE & NASDAQ? You collect the following data: NYSE NASDAQ Number 21 25 Sample mean 3. 27 2. 53 Sample std dev 1. 30 1. 16 Assuming equal variances, is there a difference in average yield (a = 0. 05)? © 2002 Prentice-Hall, Inc. © 1984 -1994 T/Maker Co. 12

Calculating the Test Statistic © 2002 Prentice-Hall, Inc. 13

Calculating the Test Statistic © 2002 Prentice-Hall, Inc. 13

Solution H 0: m 1 - m 2 = 0 i. e. (m 1

Solution H 0: m 1 - m 2 = 0 i. e. (m 1 = m 2) H 1: m 1 - m 2 ¹ 0 i. e. (m 1 ¹ m 2) a = 0. 05 df = 21 + 25 - 2 = 44 Critical Value(s): Reject H 0 . 025 -2. 0154 0 2. 0154 © 2002 Prentice-Hall, Inc. 2. 03 t Test Statistic: Decision: Reject at a = 0. 05 Conclusion: There is evidence of a difference in means. 14

p -Value Solution (p Value is between. 02 and. 05) < (a = 0.

p -Value Solution (p Value is between. 02 and. 05) < (a = 0. 05). Reject. p Value is between. 01 and. 025 2 Reject a 2 -2. 0154 0 2. 0154 =. 025 2. 03 Z Test Statistic 2. 03 is in the Reject Region © 2002 Prentice-Hall, Inc. 15

Pooled Variance t Test in PHStat and Excel n If the raw data is

Pooled Variance t Test in PHStat and Excel n If the raw data is available n n Tools | data analysis | t-test: two sample assuming equal variances If only summary statistics are available n PHStat | two-sample tests | t test for differences in two means. . . © 2002 Prentice-Hall, Inc. 16

Solution in EXCEL n Excel workbook that performs the pooled variance t test ©

Solution in EXCEL n Excel workbook that performs the pooled variance t test © 2002 Prentice-Hall, Inc. 17

F Test for Difference in Two Population Variances n Test for the difference in

F Test for Difference in Two Population Variances n Test for the difference in two independent populations n Parametric test procedure n Assumptions n Both populations are normally distributed n n Test is not robust to this violation Samples are randomly and independently drawn © 2002 Prentice-Hall, Inc. 18

The F Test Statistic = Variance of Sample 1 n 1 - 1 =

The F Test Statistic = Variance of Sample 1 n 1 - 1 = degrees of freedom = Variance of Sample 2 n 2 - 1 = degrees of freedom 0 © 2002 Prentice-Hall, Inc. F 19

Developing the F Test n n Hypotheses n H 0: s 12 = s

Developing the F Test n n Hypotheses n H 0: s 12 = s 22 n H 1: s 12 ¹ s 22 Test Statistic n F = S 12 /S 22 n Reject H 0 a/2 0 Do Not Reject FL a/2 FU F Two Sets of Degrees of Freedom n df 1 = n 1 - 1; df 2 = n 2 - 1 n Critical Values: FL( n 1 -1, n 2 -1 ) and FU( n 1 -1 , n 2 -1) FL = 1/FU* © 2002 Prentice-Hall, Inc. (*degrees of freedom switched) 20

F Test: An Example You are a financial analyst for Charles Schwab. You want

F Test: An Example You are a financial analyst for Charles Schwab. You want to compare dividend yields between stocks listed on the NYSE & NASDAQ. You collect the following data: NYSE NASDAQ Number 21 25 Mean 3. 27 2. 53 Std dev 1. 30 1. 16 Is there a difference in the NYSE 0. 05 level? © 2002 Prentice-Hall, Inc. variances between & NASDAQ at the a = © 1984 -1994 T/Maker Co. 21

F Test: Example Solution n Finding the critical values for a =. 05 n

F Test: Example Solution n Finding the critical values for a =. 05 n n © 2002 Prentice-Hall, Inc. 22

F Test: Example Solution H 0: s 12 = s 22 H 1: s

F Test: Example Solution H 0: s 12 = s 22 H 1: s 12 ¹ s 22 A =. 05 Df 1 = 20 df 2 = 24 Critical value(s): Reject. 025 0 0. 415 © 2002 Prentice-Hall, Inc. 2. 33 1. 25 Test Statistic: Decision: Do not reject at a = 0. 05 Conclusion: There is no evidence of a F difference in variances. 23

F Test in PHStat n n PHStat | two-sample tests | F test for

F Test in PHStat n n PHStat | two-sample tests | F test for differences in two variances Example in excel spreadsheet © 2002 Prentice-Hall, Inc. 24

F Test: One-Tail H 0: s 12 ³ s 22 H 1: s 12

F Test: One-Tail H 0: s 12 ³ s 22 H 1: s 12 < s 22 or a =. 05 H 0: s 12 £ s 22 H 1: s 12 > s 22 Degrees of freedom switched Reject a =. 05 0 © 2002 Prentice-Hall, Inc. F 0 F 25

Comparing Two Related Samples n Test the means of two related samples n n

Comparing Two Related Samples n Test the means of two related samples n n Paired or matched Repeated measures (before and after) Use difference between pairs Eliminates variation between subjects © 2002 Prentice-Hall, Inc. 26

Z Test for Mean Difference (Variance Known) n Assumptions n n Both populations are

Z Test for Mean Difference (Variance Known) n Assumptions n n Both populations are normally distributed Observations are paired or matched Variance known Test statistic n © 2002 Prentice-Hall, Inc. 27

t Test for Mean Difference (Variance Unknown) n Assumptions n n n Both populations

t Test for Mean Difference (Variance Unknown) n Assumptions n n n Both populations are normally distributed Observations are matched or paired Variance unknown If population not normal, need large samples Test statistic © 2002 Prentice-Hall, Inc. 28

Paired Sample t Test: Example You work in the finance department. Is the new

Paired Sample t Test: Example You work in the finance department. Is the new financial package faster (a=0. 05 level)? You collect the following data entry times: User Current Leader (1) C. B. 9. 98 Seconds T. F. 9. 88 M. H. 9. 84 R. K. 9. 99 M. O. 9. 94 D. S. 9. 84 S. S. 9. 86 C. T. 10. 12 K. T. 9. 90 S. Z. 9. 91 © 2002 Prentice-Hall, Inc. New Software (2) 9. 88 Seconds 9. 86 9. 75 9. 80 9. 87 9. 84 9. 87 9. 86 9. 83 9. 86 Difference Di. 10. 02. 09. 19. 07. 00 -. 01. 26. 07. 05 29

Paired Sample t Test: Example Solution Is the new financial package faster (0. 05

Paired Sample t Test: Example Solution Is the new financial package faster (0. 05 level)? H 0: m D £ 0 H 1: m D > 0 a =. 05 D =. 084 Critical Value=1. 8331 df = n - 1 = 9 Test Statistic © 2002 Prentice-Hall, Inc. Reject a =. 05 1. 8331 3. 15 Decision: Reject H 0 t Stat. in the rejection zone. Conclusion: The new software package is faster. 30

Paired Sample t Test in EXCEL n n Tools | data analysis… | t-test:

Paired Sample t Test in EXCEL n n Tools | data analysis… | t-test: paired two sample for means Example in excel spreadsheet © 2002 Prentice-Hall, Inc. 31

Wilcoxon Rank-Sum Test for Differences in 2 Medians n Test two independent population medians

Wilcoxon Rank-Sum Test for Differences in 2 Medians n Test two independent population medians n Populations need not be normally distributed n Distribution free procedure n Used when only rank data is available n Can use normal approximation if nj >10 © 2002 Prentice-Hall, Inc. 32

Wilcoxon Rank-Sum Test: Procedure n Assign ranks, Ri , to the n 1 +

Wilcoxon Rank-Sum Test: Procedure n Assign ranks, Ri , to the n 1 + n 2 sample observations n n n If unequal sample sizes, let n 1 refer to smallersized sample Smallest value Ri = 1 Assign average rank for ties n Sum the ranks, Tj , for each sample n Obtain test statistic, T 1 (smallest sample) © 2002 Prentice-Hall, Inc. 33

Wilcoxon Rank-Sum Test: Setting of Hypothesis Two -Tail Test H 0: M 1 =

Wilcoxon Rank-Sum Test: Setting of Hypothesis Two -Tail Test H 0: M 1 = M 2 H 1: M 1 ¹ M 2 Reject Do Not Reject T 1 L T 1 U Left-Tail Test Right -Tail Test H 0: M 1 ³ M 2 H 1: M 1 < M 2 H 0: M 1 £ M 2 H 1: M 1 > M 2 Reject Do Not Reject T 1 L T 1 U M 1 = median of population 1 M 2 = median of population 2 © 2002 Prentice-Hall, Inc. 34

Wilcoxon Rank-Sum Test: Example You’re a production planner. You want to see if the

Wilcoxon Rank-Sum Test: Example You’re a production planner. You want to see if the median operating rates for the two factories are the same. For factory number one, the rates (% of capacity) are 71, 82, 77, 92, 88. For factory number two, the rates are 85, 82, 94 & 97. Do the factories have the same median rates at the 0. 10 significance level? © 2002 Prentice-Hall, Inc. 35

Wilcoxon Rank-Sum Test: Computation Table Factory 1 Rate Rank 71 1 Tie 3 3.

Wilcoxon Rank-Sum Test: Computation Table Factory 1 Rate Rank 71 1 Tie 3 3. 5 82 77 2 92 7 88 6 Rank Sum T 2=19. 5 © 2002 Prentice-Hall, Inc. Factory 2 Rate Rank 85 5 Tie 4 3. 5 82 94 8 97 9. . . T 1=25. 5 36

Lower and Upper Critical Values T 1 of Wilcoxon Rank-Sum Test a n 2

Lower and Upper Critical Values T 1 of Wilcoxon Rank-Sum Test a n 2 n 1 One. Tailed Two. Tailed 4 5 . 05 . 10 12, 28 19, 36 . 025 . 05 11, 29 17, 38 . 01 . 02 10, 30 16, 39 . 005 . 01 --, -- 15, 40 4 5 6 © 2002 Prentice-Hall, Inc. 37

Wilcoxon Rank-Sum Test: Solution n n H 0: M 1 = M 2 H

Wilcoxon Rank-Sum Test: Solution n n H 0: M 1 = M 2 H 1: M 1 ¹ M 2 a =. 10 n 1 = 4 n 2 = 5 Critical Value(s): Reject Do Not Reject 12 © 2002 Prentice-Hall, Inc. Test Statistic: T 1 = 5 + 3. 5 + 8+ 9 = 25. 5 (Smallest Sample) Decision: Do not reject at a = 0. 10 Conclusion: There is no evidence medians are not equal. 28 38

Wilcoxon Rank-Sum Test (Large Sample) n For large sample, the test statistic T 1

Wilcoxon Rank-Sum Test (Large Sample) n For large sample, the test statistic T 1 is approximately normal with mean and standard deviation n Z test statistic n © 2002 Prentice-Hall, Inc. 39

Chapter Summary n Compared two independent samples n n Performed Z test for the

Chapter Summary n Compared two independent samples n n Performed Z test for the differences in two means Performed t test for the differences in two means Addressed F test for difference in two variances Compared two related samples n n Performed paired sample Z tests for the mean difference Performed paired sample t tests for the mean difference © 2002 Prentice-Hall, Inc. 40

Chapter Summary n (continued) Addressed Wilcoxon rank-sum test n n Performed tests on differences

Chapter Summary n (continued) Addressed Wilcoxon rank-sum test n n Performed tests on differences in two medians for small samples Performed tests on differences in two medians for large samples © 2002 Prentice-Hall, Inc. 41