12-1 Chapter Twelve McGraw- © 2005 The McGraw-Hill Companies, Inc., All 12-2 Chapter Twelve Analysis of Variance GOALS When you have completed this chapter, you will be able to: ONE List the characteristics of the F distribution TWO Conduct a test of hypothesis to determine whether the variances of two populations are equal THREE Discuss the general idea of analysis of variance FOUR Organize data into a one-way and a two-way ANOVA table Goals Chapter Twelve 12-3 continued Analysis of Variance GOALS When you have completed this chapter, you will be able to: FIVE Define and understand the terms treatments and blocks SIX Conduct a test of hypothesis among three or more treatment means SEVEN Develop confidence intervals for the difference between treatment means EIGHT Conduct a test of hypothesis to determine if there is a difference among block means Goals 12-4 Characteristics of the F-Distribution There is a “family” of F Distributions Each member of the family is determined by two parameters: the numerator degrees of freedom and the denominator degrees of freedom Its values range from to As F the F cannot be curve approaches the XThe F negative, and axis but never touches it distribution is it is a positively continuous skewed Characteristics of Fdistribution Distribution Test for Equal Variances of Two Populations For the two tail test, the test statistic is given by F 12-5 s1 s2 The degrees of freedom are n1-1 for the numerator and n21 for the denominator s 12 and s 22 are the sample variances for the two samples The larger s is placed in the denominator The null hypothesis is rejected if the computed value of the test statistic is greater than the critical value Test for Equal Variances of Two Populations 12-6 Colin, a stockbroker at Critical Securities, reported that the mean rate of return on a sample of 10 internet stocks was 12.6 percent with a standard deviation of 3.9 percent The mean rate of return on a sample of utility stocks was 10.9 percent with a standard deviation of 3.5 percent At the 05 significance level, can Colin conclude that there is more variation in the software stocks? Example 12-7 Step 1: The hypotheses are H0 : I H : I2 U U2 Step 2: The significance level is 05 Step 3: The test statistic is the F distribution Example continued 12-8 Step 4: H0 is rejected if F>3.68 or if p < 05 The degrees of freedom are n1-1 or in the numerator and n1-1 or in the denominator Step 5: The value of F is computed as follows F (3.9) (3.5) 1.2416 The p(F>1.2416) is 3965 H0 is not rejected There is insufficient evidence to show more variation in the internet stocks Example continued The ANOVA Test of Means The F distribution is also used for testing whether two or more sample means came from the same or equal populations 12-9 This technique is called analysis of variance or ANOVA The null and alternate hypotheses for four sample means is given as: Ho: 1 = 2 = 3 = 4 H1: 1 = 2 = 3 = 4 The ANOVA Test of Means 12-10 ANOVA requires the following conditions The sampled populations follow the normal distribution The samples are independent The populations have equal standard deviations Underlying assumptions for ANOVA 12-26 1 X1 X t MSE n n t is obtained from the t table with degrees of freedom (n - k) MSE = [SSE/(n - k)] If the confidence interval around the difference in treatment means includes zero, there is not a difference between the treatment means Confidence Interval for the Difference Between Two Means 12-27 95% confidence interval for the difference in the mean number of meat loaf dinners sold in Lander and Aynor Can Katy conclude that there is a difference between the two restaurants? 1 (17 12.75) 2.228 975 5 4.25 148 (2.77,5.73) EXAMPLE 12-28 Because zero is not in the interval, we conclude that this pair of means differs The mean number of meals sold in Aynor is different from Lander Example 3continued 12-29 Sometimes there are other causes of variation For the twofactor ANOVA we test whether there is a significant difference between the treatment effect and whether there is a difference in the blocking effect (a second treatment variable) SSB = r (Xb – XG)2 where r is the number of blocks Xb is the sample mean of block b XG is the overall or grand mean In the following ANOVA table, all sums of squares are computed as before, with the addition of the SSB Two-Factor ANOVA 12-30 ANOVA Table Source of Variation Sum of Squares Degrees of Freedom Mean Square Treatments (k) SST k-1 SST/(k-1) =MST Blocks (b) SSB Error SSE (TSS – SST –SSB) (k-1)(b-1) Total TSS n-1 b-1 SSB/(b-1) =MSB SSE/(n-k) =MSE F MST MSE MSB MSE Two factor ANOVA table The Bieber Manufacturing Co operates 24 hours a day, five days a week The workers rotate shifts each week Todd Bieber, the owner, is interested in whether there is a difference in the number of units produced when the employees work on various shifts A sample of five workers is selected and their output recorded on each shift 12-31 At the 05 significance level, can we conclude there is a difference in the mean production by shift and in the mean production by employee? Example 12-32 Employee McCartney Day Output 31 Evening Output 25 Night Output 35 Neary 33 26 33 Schoen 28 24 30 Thompson 30 29 28 Wagner 28 26 27 Example continued Treatment Effect 12-33 Step 1: State the null hypothesis and the alternate hypothesis Step 2: Select the level of H : significance Given as 05 H1: Not all means are equal Step 4: Formulate the decision rule Ho is rejected if F > 4.46, the degrees of freedom are and 8, or if p < 05 Step 5: Perform the calculations Example continued and make a decision Step 3: Determine the test statistic The test statistic follows the F distribution 12-34 Block Effect Step 1: State the null hypothesis and the alternate hypothesis Step 2: Select the H : level of significance Given as = 05 H1: Not all means are equal Step 4: Formulate the Step 3: Determine the decision rule test statistic The test H0 is rejected if F>3.84, df statistic follows the F =(4,8) or if p < 05 distribution Step 5: Perform the calculations and make a decision Example continued Note: xG = 28.87 Block Sums of Squares Effects of time of day and worker on productivity Day Evening Night Employee x 12-35 SSB McCartney 31 25 35 30.33 3(30.33-28.87)2 = 6.42 Neary 33 26 33 30.67 3(30.67-28.87)2 = 9.68 Schoen 28 24 30 27.33 3(27.33-28.87)2 7.08 Thompson 30 29 28 29.00 3(29.00-28.87)2 09 Wagner 28 26 27 27.00 3(27.00-28.87)2 10.49 SSB = 6.42 + 9.68 + 7.08 + 05 + 10.49= 33.73 12-36 Compute the remaining sums of squares as before: TSS = 139.73 SST = 62.53 SSE = 43.47 (139.73-62.53-33.73) df(block) = (b-1) df(treatment) = (k-1) df(error)=8 (k-1)(b-1) Example continued 12-37 ANOVA Table Source of Variation Sum of Squares Degrees of Freedom Mean Square F Treatments (k) 62.53 62.53/2 =31.275 31.27/5.43 = 5.75 Blocks (b) 33.73 33.73/4 =8.43 8.43/5.43 =1.55 Error 43.47 43.47/8 =5.43 Total 139.73 14 Example continued Treatment Effect Since the computed F of 5.75 > the critical F of 4.10, the p of 03 < of 05, H0 is rejected There is a difference in the mean number of units produced for the different time periods 12-38 Block Effect Since the computed F of 1.55 < the critical F of 3.84, the p of 28> of 05, H0 is not rejected since there is no significant difference in the average number of units produced for the different employees Example continued 12-39 Minitab output Two-way ANOVA: Units versus Worker, Shift Analysis of Variance for Units Source DF SS MS Worker 33.73 8.43 Shift 62.53 31.27 Error 43.47 5.43 Total 14 139.73 F 1.55 5.75 P 0.276 0.028 Example continued 12-40 Anova: Two-Factor Without Replication SUMMARY Day Evening Night McCartney Neary Schoen Thompson Wagner Count 5 Sum Average Variance 150 30.0 4.5 130 26.0 3.5 153 30.6 11.3 3 3 91 92 82 87 81 30.33 30.67 27.33 29.00 27.00 MS 31.27 8.43 5.43 25.33 16.33 9.33 1 ANOVA Output Using EXCEL Source of Variation Rows Columns Error SS 62.53 33.73 43.47 Total 139.73 df F P-value 5.75 0.03 1.55 0.28 F crit 4.46 3.84 14 Example continued ... not rejected There is insufficient evidence to show more variation in the internet stocks Example continued The ANOVA Test of Means The F distribution is also used for testing whether two or more... the F distribution Example continued 12-8 Step 4: H0 is rejected if F>3.68 or if p < 05 The degrees of freedom are n1-1 or in the numerator and n1-1 or in the denominator Step 5: The value of F... Restaurants specialize in meals for families Katy Polsby, President, recently developed a new meat loaf dinner Before making it a part of the regular menu she decides to test it in several of her