Two Way ANOVA

One Observation in Each Cell

In the prior discussion, we saw that there is a way of testing to see of all the means of several populations are not the same.  Often, there are two factors involved and we want to see if the means are different within each factor.  We will explain how this works with an example.

 

Example

Suppose we want to look at students GPA's based on the type of their major (science, humanities, other) and their class status (freshmen, sophomore, junior, senior).  We will use a level of significance of 0.05.  We question find the GPA's for one randomly selected student for each of the 12 possible combinations.  The results are shown in the table below.

Factor 1:  Major

Factor 2:  Class Status

Freshman Sophomore Junior Senior
Science 2.8 3.1 3.2 2.7
Humanities 3.3 3.5 3.6 3.1
Other 3.0 3.2 2.9 3.0

Since there are two factors given, major and class status, we will have two separate pairs of hypotheses.

        H0:  There is no difference in population mean GPA based on major.
        H1:  At least two majors have a different population mean GPA.

and

        H0:  There is no difference in population mean GPA based on class status.
        H1:  At least two class statuses have a different population mean GPA.

For the same reason we used the technique of ANOVA for a one-way table in the previous discussion, we will use ANOVA for this situation.  In order to proceed, we need to make the following assumptions:

  1. The measurements in each cell was selected randomly from a normal distribution.
     
  2. The distributions from the cells all have the same standard deviation.
     
  3. The values of each cell come from independent samples.
     
  4. There are the same number of measurements in each cell (in the above example there was only one measurement taken per cell).

The calculation of the F statistic is not that enlightening to the elementary statistics student, so we will assume that a computer will be used for this calculation.  The program (StatCrunch) that we have been using does not support 2-Way ANOVA; however there are free applets that do support 2-Way ANOVA.  One such applet can be found at http://home.ubalt.edu/ntsbarsh/Business-stat/otherapplets/ANOVATwo.htm. We can think of the first factor as what block the student is in and the second factor a treatment that that student is given.  This is the terminology that is given in the applet.

The input and results using the above site are show below.


 

Treatments
  1 2 3 4 5 6
A
B
C
D

 

Treatment Variation
 
Block Variation
 
Within Variation
 
Total Variation
 
Treatment Statistic
 
Its P-Value
Block Statistic
 
Its P-Value
Conclusion on Treatments Effects
Conclusion on Blocks Effects

We can interpret the conclusions by saying that there is statistically sufficient evidence (P = 0.01224) to suggest that there is a difference between GPA's based on major, while there is not sufficient evidence (P = 0.10314) to suggest that the GPA's are different based on class status.


Two-Way ANOVA With Replications

We have seen a method of testing for the difference between several means where three are two treatments.  On the other hand, the example given showed only one value per cell.  As we know, it is better to find a large sample, since the power of the test will be better.  We can do this, but we must make sure that each cell is represented an equal number of times.  This will only work if there is no interaction between the factors.  Hence we will first test to see if there is an interaction.  If there is an interaction, do not proceed.  If there is not evidence for an interaction, then we can proceed as before.  The next example illustrates this.

Example

A researcher is interested in whether either people's hair color or their taste in music is a factor in cholesterol.  Three people with each possible combination were tested for cholesterol.  The results are shown below.  Use a level of significance of 0 .05 to test researcher's hypothesis.

 

Factor 1:  Hair Color

Factor 2:  Music Preference

Classical Non-ClasicalMusic from

Over a Decade ago

Modern Music
Brunette or Black 170, 116, 221 200, 190, 213 187, 145, 198
Blonde 164, 192, 189 191, 207, 172 142, 173, 232
Red Head 210, 200, 140 188, 182, 190 191, 234, 160

 

Solution

We will use a computer program found at

http://home.ubalt.edu/ntsbarsh/Business-stat/otherapplets/ANOVA2Rep.htm

The results are shown below.

 

The First Replications
  1 2 3 4 5 6
A
B
C
D

The Second Replications
  1 2 3 4 5 6
A
B
C
D

 

The Third Replications
  1 2 3 4 5 6
A
B
C
D

 
The Fourth Replications
  1 2 3 4 5 6
A
B
C
D

 
Treatment Variation
 
Block Variation
 
Within Variation
 
Interaction Variation
 
Treatment F-Statistic
 
P-Value
Block F-Statistic
 
P-Value
Interaction F-Statistic
 
P-Value
Conclusion on Treatments Effects
Conclusion on Blocks Effects
Conclusion on Interactions Effects

We first notice that the P-Value for interactions is 0.89997 which is so large that we cannot reject the null hypothesis, that is we do not have evidence to conclude that there is an interaction between the two factors.  Next, the P-Values for hair color is 0.63259, hence we do not have evidence to suggest that there any particular hair color is more or less likely to predict a higher or lower cholesterol.  Finally, the music preference P-Value is 0.92041, hence there is also insufficient evidence to suggest that music preference is a predictor of cholesterol.
 

 


Back to the Regression and Nonparametric Home Page

Back to the Elementary Statistics (Math 201) Home Page

Back to the Math Department Home Page

e-mail Questions and Suggestions