# Analysis of Variance

When there are more than two groups, an analysis of variance is used rather than a two-group t-test. The null hypothesis of analysis of variance would be that there is no difference in the mean of the dependent variable between any of the groups. Suppose we wanted to know if there was a difference between the class of the students as to how they did on test 4. The following example would do an analysis of variance to see if there is a difference in means.

`MTB> ONEWAY 'TEST4','CLASS'`

When using the ONEWAY command, the first column specified should be the dependent variable and the second column should be the "treatment" variable, the variable that contains the groups.

`   ANALYSIS OF VARIANCE ON TEST4     SOURCE     DF        SS       MS        F        p   class       3       140       47     0.34    0.793   ERROR      16      2166       135   TOTAL      19      2306                                  INDIVIDUAL 95 PCT CI'S FOR MEAN                                  BASED ON POOLED STDEV LEVEL      N      MEAN     STDEV --------+---------+---------+--------     1      9     83.33     13.73              (-------*--------)     2      4     77.75      7.14    (------------*-----------)     3      3     77.00     11.27  (-------------*-------------)     4      4     81.50      9.15        (------------*-----------)                                  --------+---------+---------+--------POOLED STDEV =    11.63                  70        80        90`

The p value of the analysis of variance table is .793. If we desire a significance level of .05 , then we cannot conclude that there is any difference between the classes as to how they did on test 4. The confidence intervals provide a visual way of determining which groups are different, if any. If we had found significance in the analysis of variance, we then would have looked at the confidence intervals. We would conclude that two groups are different from each other if their confidence intervals did not overlap. More complicated tests to test differences in means are available.