Because two-way ANOVA breaks the FIT part of the model into three parts, corresponding to the two main effects and the interaction, inference for two-way ANOVA includes an F statistic for each of these effects. As with one-way ANOVA, the calculations are organized in an ANOVA table.
The results of a two-way ANOVA are summarized in an ANOVA table based on splitting the total variation SST and the total degrees of freedom DFT among the two main effects, the interaction, and error. When the sample size is the same for all cells, both the sums of squares and the degrees of freedom add:
When the
For this chapter, we consider inference only for the equal-sample-size
case. When the
From each sum of squares and its degrees of freedom, we find the mean square in the usual way:
The significance of each of the main effects and the interaction is assessed by an F statistic that compares the variation due to the effect of interest with the within-group variation. Each F statistic is the mean square for the source of interest divided by MSE.
Here is the general form of the two-way ANOVA table:
Source | Degrees of freedom | Sum of squares | Mean square | F |
---|---|---|---|---|
A |
|
SSA | SSA/DFA | MSA/MSE |
B |
|
SSB | SSB/DFB | MSB/MSE |
AB |
|
SSAB | SSAB/DFAB | MSAB/MSE |
Error |
|
SSE | SSE/DFE | |
Total |
|
SST |
There are three null hypotheses in two-way ANOVA, with an
F test for each. We can test for significance of the main
effect of A, the main effect of B, and the AB interaction.
It is generally good practice to examine the test for interaction
first because the presence of a strong interaction may influence the
interpretation of the main effects. Be sure to plot the means as an aid to interpreting the results of
the significance tests.
Recall that these F tests and resulting P-values can be trusted only if the model conditions are approximately met. The two-way ANOVA model conditions are the same as those for the one-way ANOVA with IJ groups, so we use the same methods to check these conditions.
13.5 Haptic feedback and difficulty level. Example 13.2 (page 652) describes the setting for a two-way ANOVA design that compares different types of controllers and obstacle course difficulty levels. Give the degrees of freedom for each of the F statistics that are used to test the main effects and the interaction for this problem.
13.6 The effect of a limited-time offer. Exercise 13.3 (page 653) describes the setting for a two-way ANOVA design that tests the effect of the phrase “limited-time offer” in two types of consumers. Give the degrees of freedom for each of the F statistics that are used to test the main effects and the interaction for this problem.
The following example illustrates how to do a two-way ANOVA. As with the one-way ANOVA, we focus our attention on interpretation of software output.
A study of cardiovascular risk factors compared runners who averaged
at least 15 miles per week with a control group described as
“generally sedentary.” Both men and women were included in the
study.10
The design is a
Figure 13.5 Summary statistics for the heart-rate study, Example 13.8.
Figure 13.6 Two-way ANOVA output for the heart-rate study, Example 13.8.
We begin with the usual preliminary examination of model conditions.
From
Figure 13.5, we
see that the ratio of the largest to the smallest standard deviation
in the four cells
Figure 13.7 Normal quantile plot for the heart-rate study, Example 13.8.
The ANOVA table in the middle of the output in Figure 13.6 is, in effect, a one-way ANOVA with four groups: female control, female runner, male control, and male runner. In this analysis, Model has 3 degrees of freedom, and Error has 796 degrees of freedom. Because we will be relying on software to do all these calculations, it is a good idea to do some quick arithmetic checks like degrees of freedom to make sure things make sense. The F test and its associated P-value for this analysis refer to the hypothesis that all four groups have the same population mean. We are interested in the main effects and interaction, so we ignore this test here.
Two-way ANOVA splits the variation among the means (expressed by the Model sum of squares) into three parts that reflect the two-way layout. The sums of squares for the Sex and Group main effects and the Sex-by-Group interaction appear at the bottom of Figure 13.6, under the heading “Effect Tests.” These sum to the sum of squares for Model. Similarly, the degrees of freedom for these sums of squares sum to the degrees of freedom for Model.
Because the degrees of freedom are all 1 for the main effects and the
interaction, the mean squares (not shown in the JMP output) are the
same as the sums of squares. The F statistics for the three
effects appear in the column labeled “F Ratio,” and the
P-values are under the heading “
All three effects are statistically significant. The Group effect has the largest F, followed by the Sex effect and then the Sex-by-Group interaction. To interpret these results, we examine the interaction plot, with bars indicating the 95% confidence interval for each group mean, in Figure 13.8. Note that the confidence intervals are quite narrow because of the large sample sizes.
Figure 13.8 Interaction plot of heart-rate study with 95% confidence intervals for the means indicated, Example 13.8.
The significance of the main effect for Group is due to the fact that
the controls have higher average heart rates than the runners for both
sexes. We can describe this main effect using the marginal means for
Group presented in
Figure 13.5.
Their difference is
The significance of the main effect for Sex is due to the fact that the females have higher heart rates than the males in both groups. We can use the cell means in Figure 13.5 to describe this main effect. The difference in marginal means is
beats. This difference is smaller than that for Group, and this is reflected in the smaller value of the F statistic.
The analysis also indicates that a complete description of the average
heart rates requires consideration of the interaction in addition to
the main effects
As the plot suggests, the interaction is not large. The difference between the sexes in the control group is 18 beats per minute, and the difference between the sexes in the runners group is 12 beats per minute. The fact that these deviations from the main effect of 15 beats are so highly statistically significant is largely because there were 800 subjects in the study. Our estimate of the common group standard deviation is
meaning deviations of
Two-way ANOVA output for other software is similar to that given by JMP. Figure 13.9 gives the analysis of the heart rate data using Excel and Minitab.
Figure 13.9 Excel and Minitab analysis of variance outputs for the heart-rate study, Example 13.8.
Prior to inference, the two-way ANOVA model conditions should be assessed. These conditions are the same as those for the one-way ANOVA model. A comparison of standard deviations as well as a histogram or Normal quantile plot of the residuals can help in determining whether the conditions are approximately met.
The calculations for two-way ANOVA are organized into a two-way ANOVA table. The key difference from one-way ANOVA is that the group variation is separated into parts for the main effect of each factor and the interaction of the factors.
When the sample size is the same for all cells, both the sums of squares and the degrees of freedom add:
Here A and B refer to the main effects of the two factors, and AB refers to the interaction.
F statistics and P-values are used to test hypotheses about the main effects and the interaction. Under the null hypothesis, each F statistic has an F distribution with numerator degrees of freedom corresponding to the effect being tested and denominator degrees of freedom equal to DFE.
13.12 How large does the F statistic need to be? For each of the following situations, sketch the F distribution and indicate the region where you would reject at the 5% significance level.
The main effect for B in a
The interaction in a
The main effect for A in a
13.13 What’s wrong? For each of the following, explain what is wrong and why.
For a
You can perform a two-way ANOVA only when the sample sizes are the same in all cells.
In a two-way ANOVA, the error variation is separated in parts for each main effect and interaction.
In a
13.14 Outlining the ANOVA table. For each part in Exercise 13.3 (page 661), outline the ANOVA table, giving the sources of variation and the degrees of freedom.
13.15 Is there interaction?
A
Outline the two-way ANOVA table for this analysis, giving the sources of variation and the degrees of freedom.
Give the degrees of freedom for the F statistic that is used to test for interaction in this analysis and the entries from Table E that correspond to this distribution.
Sketch a picture of this distribution with the information from the table included.
The calculated value of this F statistic is 3.03. Report the P-value and state your conclusion.
Based on your answer to part (c), would you expect an interaction plot to have mean profiles that look parallel? Explain your answer.
13.16 What can you conclude, given the P-values? A study reported the following results for data analyzed using a two-way ANOVA at the 5% significance level:
Effect | F | P-value |
---|---|---|
A | 4.75 | 0.009 |
B | 14.26 | 0.001 |
AB | 5.14 | 0.007 |
What can you conclude from the information given?
What additional information would you need to write a summary of the results for this study?
13.17 What can you conclude, given the design and
F statistics?
Analysis of data for a
Effect | F |
---|---|
A | 3.28 |
B | 4.64 |
AB | 1.43 |
What can you conclude from the information given?
What additional information would you want in order to write a complete summary?
13.18 Ecological effects of pharmaceuticals on fish.
Drugs used to treat anxiety persist in wastewater effluent,
resulting in relatively high concentrations of these drugs in
our rivers and streams. To understand the impacts of these
anxiety drugs on fish, researchers commonly expose fish to
various levels of a drug in a laboratory setting and observe
their behavior.11
In one
The response is the number of movements in 10 minutes, which can only be a whole number. Should we be concerned about violating the assumption of Normality? Explain your answer.
Construct an interaction plot and comment on the main effects of exposure through diet and water and their interaction.
Analyze the count of swimming bouts using analysis of variance. Report the test statistics, degrees of freedom, and P-values.
Use the residuals to check the model assumptions. Are there any concerns? Explain your answer.
Based on parts (c) and (d), write a short paragraph summarizing your findings.
13.19 Study of resveratrol and dietary copper. Past studies have shown that cardiovascular alterations can be improved through long-term use of dietary copper and resveratrol. A study in rats was run to look at the interaction between resveratrol and two forms of copper. This experiment involved 36 rats, equally divided among four groups. The four groups were carbonate copper or nanoparticle copper, each with and without resveratrol. After eight weeks of supplementation, the rats were sacrificed, and various outcomes were measured.12 The partial output in the following ANOVA table summarizes the content of glucose in the blood at the time of sacrifice:
Source | Degrees of freedom | Sum of squares | Mean square | F |
---|---|---|---|---|
Copper | 7.13 | |||
Resveratrol | 22.75 | |||
Interaction | 29.81 | |||
Error | 6.71 | |||
Total |
Fill in the missing entries in the ANOVA table.
What is
What is the coefficient of determination
State
Using Table E (or software), give an approximate (exact) P-value for each test.
Write a brief conclusion of what you find.
13.20 Ecological effects of pharmaceuticals on fish (continued). Refer to Exercise 13.18.
Often with a count as the response, one considers taking the square root of the count and performing ANOVA on this transformed response. Explain why a transformation might be useful here.
Using the response SqrtCnt, repeat parts (b) through (e) of Exercise 13.18.
Which analysis do you prefer here? Explain your answer.
13.21 Study of resveratrol and dietary copper (continued). Refer to Exercise 13.19. The mean glucose level (mmol/L) for each group of rats is shown in the following table:
Group |
|
---|---|
Carbonate | 17.66 |
Carbonate + resveratrol | 17.89 |
Nanoparticle | 20.37 |
Nanoparticle + resveratrol | 16.96 |
Construct an interaction plot.
Combine the information in your interaction plot with the conclusions from Exercise 13.19 to better elaborate what this study found.
13.22 Hypotension and endurance exercise. In sedentary individuals, low blood pressure (hypotension) often occurs after a single bout of aerobic exercise and lasts nearly two hours. This can cause dizziness, light-headedness, and possibly fainting upon standing. It is thought that endurance exercise training can reduce the degree of postexercise hypotension. To test this, researchers studied 16 endurance-trained and 16 sedentary men and women.13 The following table summarizes the postexercise systolic arterial pressure (mm Hg) after 60 minutes of upright cycling:
Group | n |
|
SE |
---|---|---|---|
Women, sedentary | 8 | 100.7 | 3.4 |
Women, endurance | 8 | 105.3 | 3.6 |
Men, sedentary | 8 | 114.2 | 3.8 |
Men, endurance | 8 | 110.2 | 2.3 |
Make a plot similar to Figure 13.3 (page 660) with the systolic blood pressure on the y axis and training level on the x axis. Describe the pattern you see.
From the table, one can show that
The researchers also measured the before-exercise systolic blood pressure of the participants and looked at a model that incorporated both the pre- and postexercise values. Explain why it is likely to be beneficial to incorporate both measurements in the study.
13.23 Smart shopping carts.
Smart shopping carts are shopping carts equipped with scanners
that track the total price of the items in the cart (providing
real-time feedback). To help understand the smart shopping
cart’s influence on spending behavior, a group of researchers
designed a two-factor study. Each participant was randomly
assigned to either be on or not on a budget of $35. Also, each
participant’s cart was equipped with or not equipped with
real-time feedback. The total amount spent on a common grocery
list was the response.14
Construct a plot of the means and describe the main features of the plot.
Use diagnostic plots and numeric summaries to check ANOVA model conditions.
Analyze the data using a two-way ANOVA. Report the
F statistics, degrees of freedom, and
P-values. Because the
Write a short summary of your findings.