© 2004 Prentice-Hall, Inc.Chap 10-1 Basic Business Statistics (9 th Edition) Chapter 10 Two-Sample Tests with Numerical Data
© 2004 Prentice-Hall, Inc. Chap 10-2 Chapter Topics Comparing Two Independent Samples Z test for the difference in two means Pooled-variance t test for the difference in two means Separate-Variance t test for the differences in two means F Test for the Difference in Two Variances Comparing Two Related Samples Paired-sample Z test for the mean difference Paired-sample t test for the mean difference
© 2004 Prentice-Hall, Inc. Chap 10-3 Chapter Topics Wilcoxon Rank Sum Test Difference in two medians Wilcoxon Signed Ranks Test Median difference (continued)
© 2004 Prentice-Hall, Inc. Chap 10-4 Comparing Two Independent Samples Different Data Sources Unrelated Independent Sample selected from one population has no effect or bearing on the sample selected from the other population Use the Difference between 2 Sample Means Use Z Test, Pooled-Variance t Test or Separate-Variance t Test
© 2004 Prentice-Hall, Inc. Chap 10-5 Independent Sample Z Test (Variances Known) Assumptions Samples are randomly and independently drawn from normal distributions Population variances are known Test Statistic
© 2004 Prentice-Hall, Inc. Chap 10-6 Independent Sample (Two Sample) Z Test in Excel Independent Sample Z Test with Variances Known Tools | Data Analysis | Z test: Two Sample for Means
© 2004 Prentice-Hall, Inc. Chap 10-7 Pooled-Variance t Test (Variances Unknown) Assumptions Both populations are normally distributed Samples are randomly and independently drawn Population variances are unknown but assumed equal If both populations are not normal, need large sample sizes
© 2004 Prentice-Hall, Inc. Chap 10-8 Developing the Pooled-Variance t Test Setting Up the Hypotheses H 0 : 1 2 H 1 : 1 > 2 H 0 : 1 - 2 = 0 H 1 : 1 - 2 0 H 0 : 1 = 2 H 1 : 1 2 H 0 : 1 2 H 0 : 1 - 2 0 H 1 : 1 - 2 > 0 H 0 : 1 - 2 H 1 : 1 - 2 < 0 OR Left Tail Right Tail Two Tail H 1 : 1 < 2
© 2004 Prentice-Hall, Inc. Chap 10-9 Developing the Pooled-Variance t Test Calculate the Pooled Sample Variance ( ) as an Estimate of the Common Population Variance ( ) (continued)
© 2004 Prentice-Hall, Inc. Chap Developing the Pooled-Variance t Test Compute the Sample Statistic (continued) Hypothesized difference
© 2004 Prentice-Hall, Inc. Chap Pooled-Variance t Test: Example © T/Maker Co. You’re a financial analyst for Charles Schwab. Is there a difference in average dividend yield between stocks listed on the NYSE & NASDAQ? You collect the following data: NYSE NASDAQ Number Sample Mean Sample Std Dev Assuming equal variances, is there a difference in average yield ( = 0.05)?
© 2004 Prentice-Hall, Inc. Chap Calculating the Test Statistic
© 2004 Prentice-Hall, Inc. Chap Solution H 0 : 1 - 2 = 0 i.e. ( 1 = 2 ) H 1 : 1 - 2 0 i.e. ( 1 2 ) = 0.05 df = = 44 Critical Value(s): Test Statistic: Decision: Conclusion: Reject at = There is evidence of a difference in means. t Reject H
© 2004 Prentice-Hall, Inc. Chap p -Value Solution p-Value 2 (p-Value is between.02 and.05) ( = 0.05) Reject Z Reject is between.01 and.025 Test Statistic 2.03 is in the Reject Region Reject =.025
© 2004 Prentice-Hall, Inc. Chap Pooled-Variance t Test in PHStat and Excel If the Raw Data are Available: Tools | Data Analysis | t Test: Two-Sample Assuming Equal Variances If Only Summary Statistics are Available: PHStat | Two-Sample Tests | t Test for Differences in Two Means...
© 2004 Prentice-Hall, Inc. Chap Solution in Excel Excel Workbook that Performs the Pooled- Variance t Test
© 2004 Prentice-Hall, Inc. Chap Example © T/Maker Co. You’re a financial analyst for Charles Schwab. You collect the following data: NYSE NASDAQ Number Sample Mean Sample Std Dev You want to construct a 95% confidence interval for the difference in population average yields of the stocks listed on NYSE and NASDAQ.
© 2004 Prentice-Hall, Inc. Chap Example: Solution
© 2004 Prentice-Hall, Inc. Chap Solution in Excel An Excel Spreadsheet with the Solution:
© 2004 Prentice-Hall, Inc. Chap Separate-Variance t Test Assumptions Both populations are normally distributed Samples are randomly and independently drawn Population variances are unknown and cannot be assumed equal If both populations are not normal, need large sample sizes Computations are Complicated Microsoft Excel ®, Minitab ® or SPSS ® can be used
© 2004 Prentice-Hall, Inc. Chap F Test for Difference in Two Population Variances Test for the Difference in 2 Independent Populations Parametric Test Procedure Assumptions Both populations are normally distributed Test is not robust to this violation Samples are randomly and independently drawn
© 2004 Prentice-Hall, Inc. Chap The F Test Statistic = Variance of Sample 1 n = degrees of freedom n = degrees of freedom F0 = Variance of Sample 2
© 2004 Prentice-Hall, Inc. Chap Hypotheses H 0 : 1 2 = 2 2 H 1 : 1 2 2 2 Test Statistic F = S 1 2 /S 2 2 Two Sets of Degrees of Freedom df 1 = n 1 - 1; df 2 = n Critical Values: F L( ) and F U( ) F L = 1/F U * (*degrees of freedom switched) Developing the F Test Reject H 0 /2 Do Not Reject F 0 FLFL FUFU n 1 -1, n 2 -1
© 2004 Prentice-Hall, Inc. Chap F Test: An Example Assume 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 2125 Mean Std Dev Is there a difference in the variances between the NYSE & NASDAQ at the 0.05 level? © T/Maker Co.
© 2004 Prentice-Hall, Inc. Chap F Test: Example Solution Finding the Critical Values for =.05
© 2004 Prentice-Hall, Inc. Chap F Test: Example Solution H 0 : 1 2 = 2 2 H 1 : 1 2 2 2 .05 df 1 20 df 2 24 Critical Value(s): Test Statistic: Decision: Conclusion: Do not reject at = F Reject There is insufficient evidence to prove a difference in variances.
© 2004 Prentice-Hall, Inc. Chap F Test in PHStat PHStat | Two-Sample Tests | F Test for Differences in Two Variances Example in Excel Spreadsheet
© 2004 Prentice-Hall, Inc. Chap F Test: One-Tail H 0 : 1 2 2 2 H 1 : 1 2 2 2 H 0 : 1 2 2 2 H 1 : 1 2 > 2 2 Reject .05 F 0 F 0 Reject .05 =.05 or Degrees of freedom switched
© 2004 Prentice-Hall, Inc. Chap Comparing Two Related Samples Test the Means of Two Related Samples Paired or matched Repeated measures (before and after) Use difference between pairs Eliminates Variation between Subjects
© 2004 Prentice-Hall, Inc. Chap Z Test for Mean Difference (Variance Known) Assumptions Population of difference scores is normally distributed Observations are paired or matched Variance known Test Statistic
© 2004 Prentice-Hall, Inc. Chap t Test for Mean Difference (Variance Unknown) Assumptions Population of difference scores is normally distributed Observations are matched or paired Variance unknown If population not normal, need large samples Test Statistic
© 2004 Prentice-Hall, Inc. Chap Project Existing System (1) New Software (2) Difference D i Seconds 9.88 Seconds Paired-Sample t Test: Example Assume you work in the finance department. Is the new financial package faster ( =0.05 level)? You collect the following processing times:
© 2004 Prentice-Hall, Inc. Chap Paired-Sample t Test: Example Solution Is the new financial package faster (0.05 level)?.072D = H 0 : D H 1 : D Test Statistic Critical Value= df = n - 1 = 9 Reject Decision: Reject H 0 t statistic in the rejection zone. Conclusion: The new software package is faster. 3.66
© 2004 Prentice-Hall, Inc. Chap Paired-Sample t Test in Excel Tools | Data Analysis… | t test: Paired Two Sample for Means Example in Excel Spreadsheet
© 2004 Prentice-Hall, Inc. Chap Confidence Interval Estimate for of Two Related Samples Assumptions Population of difference scores is normally distributed Observations are matched or paired Variance is unknown Confidence Interval Estimate:
© 2004 Prentice-Hall, Inc. Chap Project Existing System (1) New Software (2) Difference D i Seconds 9.88 Seconds Example Assume you work in the finance department. You want to construct a 95% confidence interval for the mean difference in data entry time. You collect the following processing times:
© 2004 Prentice-Hall, Inc. Chap Solution:
© 2004 Prentice-Hall, Inc. Chap Wilcoxon Rank Sum Test for Differences in 2 Medians Test Two Independent Population Medians Populations Need Not be Normally Distributed Distribution Free Procedure Can be Used When Only Rank Data are Available Can Use Normal Approximation if n j >10 for at least One j
© 2004 Prentice-Hall, Inc. Chap Wilcoxon Rank Sum Test: Procedure Assign Ranks, R i, to the n 1 + n 2 Sample Observations If unequal sample sizes, let n 1 refer to smaller- sized sample Smallest value R i = 1 Assign average rank for ties Sum the Ranks, T j, for Each Sample Obtain Test Statistic, T 1 (Smallest Sample)
© 2004 Prentice-Hall, Inc. Chap Wilcoxon Rank Sum Test: Setting of Hypothesis 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 Two-Tail TestLeft-Tail TestRight-Tail Test M 1 = median of population 1 M 2 = median of population 2 Reject T 1L T 1U Reject Do Not Reject T 1L Do Not Reject T 1U Reject Do Not Reject
© 2004 Prentice-Hall, Inc. Chap Assume you’re a production planner. You want to see if the median operating rates for the 2 factories is the same. For factory 1, the rates (% of capacity) are 71, 82, 77, 92, 88. For factory 2, the rates are 85, 82, 94 & 97. Do the factories have the same median rates at the 0.10 significance level? Wilcoxon Rank Sum Test: Example
© 2004 Prentice-Hall, Inc. Chap Wilcoxon Rank Sum Test: Computation Table Factory 1Factory 2 RateRankRateRank Rank SumT 2 =19.5 T 1 =25.5 Tie
© 2004 Prentice-Hall, Inc. Chap Lower and Upper Critical Values T 1 of Wilcoxon Rank Sum Test n2n2 n1n1 One- Tailed Two- Tailed , 2819, , 2917, , 3016, , --15, 40 6
© 2004 Prentice-Hall, Inc. Chap Wilcoxon Rank Sum Test: Solution H 0 : M 1 = M 2 H 1 : M 1 M 2 =.10 n 1 = 4 n 2 = 5 Critical Value(s): Test Statistic: Decision: Conclusion: Do not reject at = 0.10 There is insufficient evidence to prove that the medians are not equal. Reject Do Not Reject 1228 T 1 = = 25.5 (Smallest Sample)
© 2004 Prentice-Hall, Inc. Chap Wilcoxon Rank Sum Test (Large Samples) For Large Samples, the Test Statistic T 1 is Approximately Normal with Mean and Standard Deviation Z Test Statistic
© 2004 Prentice-Hall, Inc. Chap Wilcoxon Signed Ranks Test Used for Testing Median Difference for Matched Items or Repeated Measurements When the t Test for the Mean Difference is NOT Appropriate Assumptions: Paired observations or repeated measurements of the same item Variable of interest is continuous Data are measured at interval or ratio level The distribution of the population of difference scores is approximately symmetric
© 2004 Prentice-Hall, Inc. Chap Wilcoxon Signed Ranks Test: Procedure 1.Obtain a difference score D i between two measurements for each of the n items 2.Obtain the n absolute difference |D i | 3.Drop any absolute difference score of zero to yield a set of n’ n 4.Assign ranks R i from 1 to n’ to each of the non-zero |D i |; assign average rank for ties 5.Obtain the signed ranks R i (+) or R i (-) depending on the sign of D i 6.Compute the test statistic: 7.If n’ 20, use Table E.9 to obtain the critical value(s) 8.If n’ > 20, W is approximated by a normal distribution with
© 2004 Prentice-Hall, Inc. Chap Wilcoxon Signed-ranks Test: Example Assume you work in the finance department. Is the new financial package faster ( =0.05 level)? You collect the following processing times: Project Existing System (1) New Software (2) Difference D i Seconds 9.88 Seconds
© 2004 Prentice-Hall, Inc. Chap Wilcoxon Signed-ranks Test: Computation Table
© 2004 Prentice-Hall, Inc. Chap Upper Critical Value of Wilcoxon Signed Ranks Test Upper critical value ( W U = 37 ) n ONE-TAIL = 0.05 TWO-TAIL = 0.10 = = 0.05 (Lower, Upper) 9 8,37 5, ,45 8, ,53 10,56
© 2004 Prentice-Hall, Inc. Chap Wilcoxon Signed-Ranks Test: Solution H 0 : M 1 M 2 H 1 : M 1 M 2 =.05 n’ = 9 Critical Value: Test Statistic: Decision: Conclusion: Reject at = 0.05 There is sufficient evidence to prove that the median difference is greater than 0. There is enough evidence to conclude that the new system is faster. W = 44 +Z 0.05 Reject
© 2004 Prentice-Hall, Inc. Chap Chapter Summary Compared Two Independent Samples Performed Z test for the differences in two means Performed pooled-variance t test for the differences in two means Discussed separate-variance t test for the differences in two means Addressed F Test for Difference in two Variances Compared Two Related Samples Performed paired sample Z test for the mean difference Performed paired sample t test for the mean difference
© 2004 Prentice-Hall, Inc. Chap Chapter Summary Addressed Wilcoxon Rank Sum Test Performed test on differences in two medians for small samples Performed test on differences in two medians for large samples Illustrated Wilcoxon Signed Ranks Test Performed test for median differences for paired observations or repeated measurements (continued)