production date 2/5/00

Two-way ANOVA

Table of Contents Objectives
Factors What are factors?
Why Not Multiple One-Way ANOVAS? Why Two-way is better than One-way
Degrees of Freedom Determining the degrees of freedom for each test.
F Statistics Formulas for each of the three F statistics.
Null Hypotheses The three null hypotheses are detailed.
A Statlets Problem Using Statlets to conduct a two-way ANOVA.
Vanished Error Variance Illustrating how two-way increases power.
Computer Problem 28 Using the Analyze/Multiple Samples/Two-way ANOVA procedure
Computer Problem 29 Using the Analyze/Multiple Samples/Two-way ANOVA procedure to produce an interaction plot
Computer Problem 30 Using the Analyze/Multiple Samples/Two-way ANOVA procedure with the Milgram data
Additional Information Discover John Tukey
Questions/Test Take the End of Chapter Test
Report Send a Chapter Report to your Instructor


This chapter is a brief introduction to two-way analysis of variance. Only an introduction is provided to this subject, as many introductory statistics texts do not teach two-way ANOVA. While the statistical formulas necessary for conducting a two-way ANOVA are only slightly more complicated than those required for one-way ANOVA calculations, this author believes that for beginning students they are best left for computer software to solve. For interested students, the Additional Information section offers several references to texts that cover the derivation of these calculation formulas. Therefore, two-way ANOVA hand calculations are not conducted in this chapter. Understanding the process and getting Statlets to solve a two-way ANOVA problem should present no difficulty to beginning students. Several computer problems are presented in the Chapter.

Two-way ANOVA compares the means of populations that are classified in two ways. If there are two important independent variables, and the researcher wants to know if these two independent variables change the dependent variable, use two-way ANOVA. Many of the key concepts are either identical or similar to those of one-way ANOVA. However, the presence of two independent variables also introduces some new ideas.


Factors

In experimental designs that incorporate two or more independent variables, the independent variables are called factors, and the designs are called factorial designs. Any particular factorial design is labeled according to how many independent variables are being investigated, and by how many different existing levels each factor contains.

For example, if you wanted to study the effect of Retilan dosage and psychopathological classification on children's out-of-seat behavior, and you investigated two different levels of Retilan dosage and included three different disorders, you would have a 2X3 ANOVA. The X separates the number of factors, and the numbers give the levels of each factor. A 2X3 ANOVA has six different groups.

As a second example, suppose a group of school administrators are concerned about firearms use or abuse by students. They decide to gather information on the attitudes of high school students toward firearms. Initially they believe that they will survey the attitudes of a random group of students. They soon realize that the attitudes of freshmen may differ from those of sophomores, juniors, and seniors. They also believe that the attitudes of boys may be different from those of girls. Eventually they collect information using a stratified random sampling approach, where random samples are taken from all eight groups (freshmen males, freshmen females, sophomore males, sophomore females, junior males, junior females, senior males, and senior females). This final design has two independent variables or factors (class and sex). The first factor class has four different levels or categories, and sex, the second factor, has two levels. When the data are collected and analyzed, a 4X2 ANOVA would be appropriate.

With a two factor design, the analysis yields three pieces of information. There is a test for the main effect of the first variable (class) often also called the A factor. There is a second test for the main effect of the B factor (sex). Finally, there is a test that determines if these two variables interact with one another. Interactions indicate the joint influence of the two independent variables on the dependent variable. If the variables interact, the effect of one variable depends on the level of the other variable.

There is no theoretical limit to the number of factors that can be present in an experimental design, but most often two or three factors (independent variables) are the practical limit. With more factors than two or three, the amount of information from the ANOVA output becomes overwhelming. As noted, if you have two factors there are three calculated significance tests. With an increasing number of factors, there are progressively more tests of interactions that are conducted. With two factors (A and B) there is a test for the effect of A, a test for the effect of B, and one for their interaction (AB). With three factors (A and B and C) there are seven tests. One for A, one for B, one for C, one for the interaction AB, one for the interaction AC, one for the interaction BC, and finally, one for the interaction ABC. With four factors, there are 15 statistical tests conducted.

The ability of a factorial design to determine the magnitude of the interaction effect is its distinguishing characteristic. Whenever the analysis of a factorial design indicates that there is a significant interaction between variables, it means that the dependent variable is jointly controlled by the independent variables.


Why Not Multiple One-Way ANOVAS?

There are essentially three good reasons for conducting a two-way ANOVA when it is appropriate rather than resulting to two separate one-way ANOVAs. These advantages are:
  1. With the two-way ANOVA, interactions can be investigated.
  2. Resources can be used more efficiently.
  3. Error variation is reduced by including a second factor, and estimating the interaction.


Interaction Investigation

It has already been noted that two-way ANOVA allows the investigation of interactions while multiple one-way ANOVAs would not. In the example above, the two-way ANOVA will allow the researcher to determine if the firearms attitudes are jointly influenced by the class of the student and the sex of the student. If two one-way ANOVAs were conducted, we would be able to tell if there was a difference in attitudes across class, and if there was a difference in attitudes between males and females, but we would not be able to tell if the differences in say the attitudes across class were different for males and females. This difference in differences is an interaction. Interactions and their interpretations are discussed more later in this chapter.

More Efficient Resource Use

Suppose a medical researcher was studying the effects of two different drug treatments for HIV infections. As is typical for such experiments, let's suppose that high, normal, and low dosage levels are given for each of these two drugs. This would produce a 3X3 ANOVA with 9 separate groups. Now further suppose that 9 people are assigned to each of the 9 groups. The researcher would need 81 people for this research. The costs involved in the experiment would be directly related to the support of these 81 patients. Each of the factors has 27 subjects assigned to each level as can be seen in the table below.


If the researcher decided to conduct two separate one-way ANOVAS, and assign 27 subjects to each level, they would actually need 162 subjects instead of the 81 in the two-way design. The resources required to conduct the study would double.

Error Variation is Reduced

In the HIV study above, if a one-way ANOVA was conducted for Drug A, all three levels of the Drug A would contain all three levels of Drug B. If a difference occurs because of Drug B, this variation would be assigned to the within groups sum of squares. In the two-way ANOVA, Drug B is included as a factor, and therefore the variation it accounts for is removed from the within groups sum of squares, thus reducing the mean square within groups, and increasing the F statistic for Drug A. When we have a second factor in our design, we increase the power of the statistical tests. This effect is detailed in the Statlets output later in this chapter.


Degrees of Freedom

For a two-way ANOVA, the formulas for calculating various degrees of freedom are given below.
dfTOT = nT - 1
dfBG = # of groups -1
dfWG = dfTOT - dfBG
dfA = # of levels of A -1
dfB = # of levels of B - 1
dfAB (interaction) = dfA * dfB


F Statistics

Note that all the formulas for the F statistics (shown in the figure below) have the mean square within groups as their denominator.



Null Hypotheses

In a two factor ANOVA there are three null hypotheses and three alternatives. These hypotheses require subscripts to keep them separate. Often these hypotheses are written without resorting to symbols. Here are the three null and alternative hypotheses for our two factor ANOVA.
Ho1: There is no main effect for factor A.
H11: There is a main effect for factor A.

Ho2: There is no main effect for factor B.
H12: There is a main effect for factor B.

Ho3: There is no interaction effect.
H13: There is an interaction effect.


A Statlets Problem

First read the user manual section for two-way ANOVA. Next, suppose a teacher wants to discover whether Retilan, Child Therapy, or both can change a group of hyperactive boys out-of-seat behavior in his class. He proceeds with appropriate consent from both parents and physicians to randomly assign these children to six different groups. There are three different levels of Retalin dosage, and two different types of Child Therapy. The collected data is shown below. The Data column indicates the number of out-of-seat behaviors recorded for each child over the week evaluation period. Out-of-seat behavior is the dependent variable. The Therapy column shows the type of therapy given to the child. The letter "B" indicates a behavioral therapy while the letter "C" indicates the child was exposed to a cognitive therapy. The Dosage column indicates whether the child was given a low, medium or high dose of Retilan.

Data Therapy Dosage
54 B low
56 B low
53 B low
57 B low
55 B low
51 B medium
56 B medium
53 B medium
55 B medium
55 B medium
53 B high
55 B high
56 B high
52 B high
54 B high
52 C low
50 C low
53 C low
51 C low
54 C low
54 C medium
57 C medium
58 C medium
56 C medium
53 C medium
58 C high
57 C high
55 C high
61 C high
59 C high

Enter this data into Statlets using the copy and paste procedure. Then select the Model/Analysis of Variance/Twoway ANOVA procedure using those menu choices. The Input tab should be completed as illustrated in the following figure.

Notice that the dependent variable that is entered in the Data box is also called Data in this example. Therapy and Dosage are the two factors.

To produce the ANOVA table, simply click the ANOVA tab. However, by default this analysis does not estimate interaction effects. So after initially clicking the ANOVA tab, click the Options button, and click in the Estimate interaction selection as shown in the figure below.

After clicking the OK button, the results that are also shown in the figure above, will be displayed. Notice that the interaction is statistically significant.

To illustrate this interaction, click the Interaction Plot tab. The plot shown directly below will be produced.



Vanished Error Variance

As noted earlier, one of the advantages of two-way ANOVA over one-way ANOVA, is that the inclusion of a second factor reduces the error variance, reducing the mean square error, and increasing the power of our tests. This effect will now be shown with Statlets output.

For this purpose, we have used the Statlets Problem data set directly above. However, instead of conducting a two-way ANOVA as was done in that demonstration, we are going to conduct a one-way ANOVA, with Data as the dependent variable, and Dosage as the single independent variable. Using the Model/Analysis of Variance/Oneway ANOVA procedure, the Input Tab was completed as follows.


Clicking the ANOVA tab produces the following output.

Notice that the Between groups Sum of Squares is 31.2667, with three levels for this variable and two degrees of freedom, producing a Mean Square of 15.63333. The Within groups Sum of Squares is 152.1., with 27 degrees of freedom a Mean Square Within group (Error) of 5.63333 is produced. Dividing the Mean Square Between groups by the Mean Square Within groups yields a F statistic of 2.78 which is nonsignificant.

Comparing the Dosage values with those produced above in the two-way ANOVA, notice that the Sum of Squares, Df, and Mean Square values for Dosage in both situations are identical. Indeed, the Total Sum of Squares for both situations is the same at 183.367.

The Within groups row has vanished in the two-way ANOVA results. It is an unfortunate circumstance in statistical analysis that the same thing can often have several different names. Error sum of squares in the one-way analysis is called Within group Sum of Squares, in two-way ANOVA, error sum of squares is labeled Residual Sum of Squares. In moving from the one-way ANOVA to the two-way ANOVA, error sum of squares has gone from 152.1 to the lower value of 83.2. Where has this variability gone? It has been accounted for by the Therapy Sum of Squares (5.6333), and the INTERACTION Sum of Squares (63.2667). Adding these two values together gives a difference of 68.9 sums of squares -- exactly the difference between the one-way Within group and the two-way RESIDUALS Sum of squares.

The degrees of freedom for the two-way RESIDUALS, as opposed to the one-way Within groups has decreased by three. Those three lost degrees of freedom can also be found by including the Df values for Therapy and INTERACTION. If the second factor and the interaction account for a larger sum of square per degree of freedom than the average sum of square per degree of freedom in the RESIDUAL row, then the two-way Mean Square RESIDUAL, will be less than the one-way Mean Square Within groups (as it is here), and the F statistic will be increased.

Compare the F statistic for Dosage in the two-way output of 4.51 (which is statistically significant), with the nonsignificant F value of 2.78 from the one-way analysis. The power to detect a difference due to Dosage was increased by including the second factor Therapy.


Assumptions

The assumptions for two-way ANOVA are virtually the same as for one-way ANOVA. We assume that the subjects are assigned to the groups randomly and independently, that the dependent variable is normally distributed, that the population variances are equal, and that the dependent variable is continuous. As before, the procedure is robust to violations of the first three assumptions.



Computer Problem 28   

A clinical psychologist is investigating the effect of a new drug combined with therapy on schizophrenic patients' behavior. The drug has three dosages given (absent, low, high) and the therapy has four types (behavior modification, BMod; psychodynamic Psycho; group counseling, Group; nondirective counseling, Nondir). This would be referred to as a 3X4 factorial design. Using the data below, conduct a two-way ANOVA. If your instructor requests, submit the project 28 report.

Dosage Therapy Behavior
absent BMod 25
absent BMod 22
absent BMod 23
absent BMod 25
absent BMod 24
absent Psycho 27
absent Psycho 25
absent Psycho 26
absent Psycho 24
absent Psycho 25
absent Group 20
absent Group 25
absent Group 19
absent Group 21
absent Group 18
absent Nondir 19
absent Nondir 22
absent Nondir 20
absent Nondir 17
absent Nondir 22
low BMod 25
low BMod 21
low BMod 20
low BMod 22
low BMod 21
low Psycho 25
low Psycho 23
low Psycho 19
low Psycho 24
low Psycho 20
low Group 22
low Group 21
low Group 25
low Group 26
low Group 22
low Nondir 23
low Nondir 27
low Nondir 23
low Nondir 26
low Nondir 28
high BMod 22
high BMod 30
high BMod 26
high BMod 28
high BMod 20
high Psycho 28
high Psycho 27
high Psycho 24
high Psycho 21
high Psycho 25
high Group 27
high Group 25
high Group 28
high Group 29
high Group 24
high Nondir 20
high Nondir 24
high Nondir 21
high Nondir 24
high Nondir 26




Computer Problem 29   

Using the same data and procedure as above, click the Interaction Plot tab to produce a plot of the interactions. If your instructor requests, submit the project 29 report.


Computer Problem 30   

In thinking about the Obedience to Authority study, many people have thought that women would react differently than men. However, their thoughts have given women the ability to shock less or more. Some have said that because women were more willing to obey others, they would shock at higher levels. Others have stated that because women as a group are so opposed to violence they would quit the experiment earlier than men. Still others have contended that there would be a major interaction between the situation in which the people were placed, and their sex. They believed that women in the Remote situation would break off the experiment early, they thought that they would shock at higher levels in the Voice and In_Room situations, but would again stop at lower shock levels when they had to touch the learner. A different pattern was predicted for men. Data like that collected in the Obedience study is reproduced below. Is there a significant interaction between Situation and Sex using Volts as the dependent variable? Situation Volts Designation Sex
Remote 300.000 Moderate M
Remote 300.000 Moderate F
Remote 315.000 Severe M
Remote 315.000 Severe F
Remote 330.000 Severe M
Remote 345.000 Severe F
Remote 375.000 Severe M
Remote 450.000 Danger F
Remote 450.000 Danger M
Remote 450.000 Danger F
Remote 450.000 Danger M
Remote 450.000 Danger F
Remote 450.000 Danger M
Remote 450.000 Danger F
Remote 450.000 Danger M
Remote 450.000 Danger F
Remote 450.000 Danger M
Remote 450.000 Danger F
Remote 450.000 Danger M
Remote 450.000 Danger F
Voice 135.000 Slight M
Voice 150.000 Slight F
Voice 150.000 Slight M
Voice 165.000 Slight F
Voice 285.000 Moderate M
Voice 315.000 Severe F
Voice 315.000 Severe M
Voice 360.000 Severe F
Voice 450.000 Danger M
Voice 450.000 Danger F
Voice 450.000 Danger M
Voice 450.000 Danger F
Voice 450.000 Danger M
Voice 450.000 Danger F
Voice 450.000 Danger M
Voice 450.000 Danger F
Voice 450.000 Danger M
Voice 450.000 Danger F
Voice 450.000 Danger M
Voice 450.000 Danger F
In_Room 105.000 Slight M
In_Room 150.000 Slight F
In_Room 150.000 Slight M
In_Room 150.000 Slight F
In_Room 150.000 Slight M
In_Room 150.000 Slight F
In_Room 180.000 Slight M
In_Room 270.000 Moderate F
In_Room 300.000 Moderate M
In_Room 300.000 Moderate F
In_Room 315.000 Severe M
In_Room 315.000 Severe F
In_Room 450.000 Danger M
In_Room 450.000 Danger F
In_Room 450.000 Danger M
In_Room 450.000 Danger F
In_Room 450.000 Danger M
In_Room 450.000 Danger F
In_Room 450.000 Danger M
In_Room 450.000 Danger F
Must_Touch 135.000 Slight M
Must_Touch 150.000 Slight F
Must_Touch 150.000 Slight M
Must_Touch 150.000 Slight F
Must_Touch 150.000 Slight M
Must_Touch 150.000 Slight F
Must_Touch 150.000 Slight M
Must_Touch 150.000 Slight F
Must_Touch 150.000 Slight M
Must_Touch 180.000 Slight F
Must_Touch 210.000 Moderate M
Must_Touch 255.000 Moderate F
Must_Touch 300.000 Moderate M
Must_Touch 315.000 Severe F
Must_Touch 450.000 Danger M
Must_Touch 450.000 Danger F
Must_Touch 450.000 Danger M
Must_Touch 450.000 Danger F
Must_Touch 450.000 Danger M
Must_Touch 450.000 Danger F

If your instructor requests, submit the project 30 report.



Additional Information   

For a detailed analysis of the two-way ANOVA calculations see Statistics for the Behavioral Sciences by Frederick J. Gravetter and Larry B. Wallnau, published by Wadsworth Publishing Company.

You may also want to look at some of the other statistics texts published by the Wadsworth.


Questions/Test    

This link allows you to take a computer scored end-of-chapter test. If your instructor requests to see the results of this examination, you can either copy and e-mail or print the feedback you will receive immediately after taking the test.

Report    

Please send a report indicating your understanding of this chapter to your instructor. You will need to know both your and your instructor's e-mail addresses.