Presentation is loading. Please wait.

Presentation is loading. Please wait.

Analysis of Variance or ANOVA. In ANOVA, we are interested in comparing the means of different populations (usually more than 2 populations). Since this.

Similar presentations


Presentation on theme: "Analysis of Variance or ANOVA. In ANOVA, we are interested in comparing the means of different populations (usually more than 2 populations). Since this."— Presentation transcript:

1 Analysis of Variance or ANOVA

2 In ANOVA, we are interested in comparing the means of different populations (usually more than 2 populations). Since this technique has frequently been applied to medical research, samples from the different populations are referred to as different treatment groups.

3 Main Idea behind Analysis of Variance Measure the variability within the treatment groups and also the variability between the treatment groups. The “between” variability is due to both differences in treatment and the random error component. The “within” variability is due only to the random error component. So, if there are significant treatment differences, the “between” variability should be substantially larger than the “within” variability.

4 In ANOVA, the null hypothesis H 0 is always essentially “there are no differences in treatment” and the alternative hypothesis H 1 is always essentially “there is a difference in treatment.” If the problem says “test whether there are no treatment effects,” H 0 is “there are NO differences in treatment.” If the problem says “test whether there are treatment effects,” H 0 is “there are NO differences in treatment.”

5 We will begin with one-factor ANOVA. Suppose we’re looking at the effects of different types of heart medication on pulse rate. An individual’s pulse rate is the sum of different effects. If there is no difference in the effects of the various heart medications or treatments, then the middle effect above is zero. That is what we would like to test.

6 Example 1: A manager is comparing the output of 3 machines. He has recorded 5 randomly selected minutes of operation for machine 1, 10 minutes for machine 2, and 6 minutes for machine 3. The output is as shown below. Machine 1Machine 2Machine 3 Y1Y1 Y2Y2 Y3Y3 10611 678 8913 12410 66 12 5 6 8 6

7 In this example, we have n = # of observations = 21 and c = # of groups (or # of machines here) = 3 Machine 1Machine 2Machine 3 Y1Y1 Y2Y2 Y3Y3 10611 678 8913 12410 66 12 5 6 8 6

8 We compute the mean output per minute for each machine. The grand mean for all the machines combined is (42+67+64)/21 = 8.238. Machine 1Machine 2Machine 3 Y1Y1 Y2Y2 Y3Y3 10611 678 8913 12410 66 12 5 6 8 6 426764

9 We next look at the variation in output by computing sums of squared deviations. Machine 1Machine 2Machine 3 Y1Y1 Y2Y2 Y3Y3 102.5660.49110.1111 65.7670.0987.1111 80.1695.29135.4444 1212.9647.29100.4444 65.7660.49100.4444 1010.89121.7778 52.89 60.49 81.69 60.49 4227.26730.106415.33

10 The sum of squared variation within groups or SS within is the sum of the sums of squared deviations for the 3 groups = 27.2 + 30.10 + 15.33 = 72.63. Machine 1Machine 2Machine 3 Y1Y1 Y2Y2 Y3Y3 102.5660.49110.1111 65.7670.0987.1111 80.1695.29135.4444 1212.9647.29100.4444 65.7660.49100.4444 1010.89121.7778 52.89 60.49 81.69 60.49 4227.26730.106415.33

11 The mean squared variation within groups MS within = (SS Within) / (n – c). = 72.63/(21 – 3) = 72.63/18 = 4.035

12 The mean square variation between groups or MS Between is In our example, n 1 =5 n 2 =10 n 3 =6 c = 3 The sum of squared variation between groups or SS Between is

13 The sum of squares total or SS Total = SS Between + SS Within The mean squared total or MS Total = SS Total /( n – 1)

14 We compile our information in a table called an ANOVA table. Source of variation Degrees of freedom Sum of squares Mean square Between Groups c – 1 3 – 1 = 2 59.1829.59 Within Groups n – c 21 – 3 = 18 72.634.035 Total n – 1 21 – 1 = 20 131.816.591 Notice that the degrees of freedom column adds up to the total at the bottom, and the sum of squares column adds up to the total at the bottom, but the mean square column does NOT add up to the total at the bottom.

15 Remember that the purpose of all the work we have been doing is to test whether there is a “treatment effect,” that is a difference in the means of the various groups. The hypotheses are H 0 : there is no difference in the means, and H 1 : there is a difference in the means. In our current example, we want to know if there is a difference in the mean output level of the various machines.

16 The statistic we use here is the F-statistic: The subscripts are the degrees of freedom of the F-statistic and they are the degrees of freedom that are associated with the numerator and the denominator of the statistic.

17 F c-1, n-c f( F c-1, n-c ) acceptance region crit. reg. Like the  2, the F distribution is skewed to the right, and the critical region for the test is the right tail.

18 For our current example, we have: The F table shows that for 2 and 18 degrees of freedom, the 5% critical value is 3.55. Since our F has a value of 7.33, we reject the null hypothesis and conclude that there is a difference in the mean output levels of the 3 machines. f( F 2, 18 ) F 2, 18 acceptance region crit. reg. 0.05 3.55 7.33

19 Example 2: In order to compare the average tread life of 3 brands of tires, random samples of 6 tires of each brand are tested on a machine which simulates road conditions. The tread life for each tire is measured. Complete the analysis of variance table and test at the 1% level whether there is a difference in the average tread life of the 3 tire brands. Source of variation Sum of squares Degrees of freedom Mean square Between224.78 Within118.83 Total

20 First we can calculate SS Total by adding SS Between and SS Within. Source of variation Sum of squares Degrees of freedom Mean square Between224.78 Within118.83 Total343.61

21 The degrees of freedom for the SS Between is c – 1 = 3 – 1 = 2, since there are three groups (3 tire brands). Source of variation Sum of squares Degrees of freedom Mean square Between224.782 Within118.83 Total343.61

22 The degrees of freedom for the SS Within is n – c = 18 – 3 = 15, since there are 18 observations (6 of each of the 3 brands). Source of variation Sum of squares Degrees of freedom Mean square Between224.782 Within118.8315 Total343.61

23 The degrees of freedom for the SS total is n – 1 = 18 – 1 = 17. Source of variation Sum of squares Degrees of freedom Mean square Between224.782 Within118.8315 Total343.6117

24 The MS Between is (SS Between) / (dof Between) = 224.78 / 2 = 112.39 Source of variation Sum of squares Degrees of freedom Mean square Between224.782112.39 Within118.8315 Total343.6117

25 The MS Within is (SS Within) / (dof Within) = 118.83 / 15 = 7.922 Source of variation Sum of squares Degrees of freedom Mean square Between224.782112.39 Within118.83157.922 Total343.6117

26 The MS Total is (SS Total ) / (dof Total ) = 343.61 / 17 = 20.212 Source of variation Sum of squares Degrees of freedom Mean square Between224.782112.39 Within118.83157.922 Total343.611720.212

27 So, The F table shows that for 2 and 15 degrees of freedom, the 1% critical value is 6.36. Since our F has a value of 14.19, we reject the null hypothesis and conclude that there is a difference in the mean tread life of the 3 tire brands. f( F 2, 15 ) F 2, 15 acceptance region crit. reg. 0.01 6.36 14.19

28 Two-Factor ANOVA with Interaction Effects Now, we have two factors of interest, A and B, and the factors may interact to influence a particular variable Y with which we are concerned. For example, we may want to explore the effects of different teachers and different teaching methods on student performance. So,

29 We have 3 sets of hypotheses. H 0 : factor A has no effect on Y. H 1 : factor A has an effect on Y. H 0 : factor B has no effect on Y. H 1 : factor B has an effect on Y. H 0 : the interaction of factors A and B has no effect on Y. H 1 : the interaction of factors A and B has an effect on Y.

30 For each A and B possibility, we have r replications (or observations). For example, suppose we have a = 4 different teachers, b = 3 different methods, and r = 3 replications. There are 12 different teaching possibilities: You could have teacher A, B, C, or D, and that instructor could be using method 1, 2, or 3. For each one of these 12 situations, we have 3 replications, or 3 observations, or exam scores of 3 students.

31 Our ANOVA table now looks like this: Source of Variation Sum of Squares Degrees of Freedom Mean Square Factor ASSAa – 1MSA Factor BSSBb – 1MSB Interaction between A & B SSAB(a – 1)(b – 1)MSAB Random ErrorSSEab(r – 1 )MSE TotalSST n – 1 (or abr – 1) MST

32 Test Statistics for Two-Way ANOVA Testing for the effect of the interaction of A and B: Testing for the effect of factor A: Testing for the effect of factor B: Notice that in all three cases, the denominator is the same; it’s the Mean Squared Error.

33 Example 3: Consider the following ANOVA table relating student performance to 4 teachers, 3 teaching methods, and the interaction of those 2 factors, using 3 replications. Source of Variation Sum of Squares Degrees of Freedom Mean Square Teacher300 Method400 Interaction900 Error1200 Total

34 Complete the table and then test at the 5% level whether student performance depends on (1) the teacher, (2) the teaching method, and (3) the interaction of the teacher and the method. Source of Variation Sum of Squares Degrees of Freedom Mean Square Teacher300 Method400 Interaction900 Error1200 Total

35 First, we complete the table. Source of Variation Sum of Squares Degrees of Freedom Mean Square Teacher3004 – 1 = 3100 Method4003 – 1 = 2200 Interaction900(4 – 1)(3 – 1) = 6150 Error1200 ab(r – 1) = (4)(3)(3 – 1) = 24 50 Total2800 n – 1 = abr – 1 = 36 – 1 = 35 80

36 Now we test the hypotheses. We’ll begin with the teachers. Source of Variation SSdofMS Teacher3003100 Method4002200 Interaction9006150 Error12002450 Total28003580 f( F 3, 24 ) F 3, 24 acceptance region crit. reg. 0.05 3.01 2.00 From the F table, we find that the 5% critical value for 3 and 24 degrees of freedom is 3.01. Since our statistic, 2.00, is in the acceptance region, we accept H 0 that the teacher has no effect on student performance.

37 Next we look at the teaching methods. Source of Variation SSdofMS Teacher3003100 Method4002200 Interaction9006150 Error12002450 Total28003580 f( F 2, 24 ) F 2, 24 acceptance region crit. reg. 0.05 3.40 4.00 From the F table, we find that the 5% critical value for 2 and 24 degrees of freedom is 3.40. Since our statistic, 4.00, is in the critical region, we reject H 0 and accept H 1 that the method does affect student performance.

38 Last we look at the interaction of teachers and methods. Source of Variation SSdofMS Teacher3003100 Method4002200 Interaction9006150 Error12002450 Total28003580 f( F 6, 24 ) F 6, 24 acceptance region crit. reg. 0.05 2.51 3.00 From the F table, we find that the 5% critical value for 6 and 24 degrees of freedom is 2.51. Since 3 is in the critical region, we reject H 0 & accept H 1 : there is an interaction effect of teacher & method on student performance.


Download ppt "Analysis of Variance or ANOVA. In ANOVA, we are interested in comparing the means of different populations (usually more than 2 populations). Since this."

Similar presentations


Ads by Google