Sacramento State



Two-Way ANOVA

Introduction

It is not uncommon to investigate the effects of two or more factors on a single independent variable. We'll restrict ourselves to two factor analysis of variance, known as two-way ANOVA. A complication that often arises when two or more factors are considered is the possibility that the factors may affect the response variable jointly. This occurs if certain combinations of levels from different factors appear to be especially significant. This adds to the complexity of the model we must consider. (Note: such "interactions" can occur in regression as well, but they are particularly common in multi- factor ANOVA.)

To make life simpler, we'll only consider the situation where all sample sizes (for each combination of levels) are equal. This is called a balanced design. To demonstrate the models and the concepts, we'll look at two examples based on yet more iterations of the Apple Juice data in the first Analysis of Variance notes. (Some numbers have been tweaked to make the computations easier to follow.)

Before we begin analyzing the data, however, we need to discuss the vocabulary and notation used in two-way analysis of variance.

• Factor A, or the Row Factor, is the first of the two factors considered. The levels of factor A will be indexed by the letter i, where [pic].

• Factor B, or the Column Factor, is the second of the two factors considered. The levels of factor B will be indexed by the letter j, where [pic].

• Treatment: In one-way ANOVA, treatment and level were used interchangeably. In two-way ANOVA, a treatment refers to a particular combination of the factors A and B. In a complete design, there will be [pic]treatments. (We only consider complete designs in this class.)

Two-Way ANOVA Without Interactions

If interactions aren't significant, then the model and interpretations are simpler, so we'll begin by considering models where interactions between the factors A and B don't occur. In such a model we are able to focus on the effects of factors A and B separately. Such a model is said to be "additive" because the effects of the factors sum.

Factor Effects Model (Without Interactions) - The Main Effects Model: [pic], where

• [pic] is the kth observation on ijth treatment, where [pic], and [pic] is the size of the sample drawn from each treatment (remember, this is a balanced design so all [pic] treatment samples are of size[pic]).

• [pic] is the differential effect of the ith level of factor A on the mean response (the mean of the dependent variable). Note: [pic].

• [pic] is the differential effect of the jth level of factor B on the mean response (the mean of the dependent variable). Note: [pic].

• [pic] is the error, assumed to be iid [pic] as always.

The [pic] and [pic] are called the "main effects" of factors A and B, respectively, to distinguish them from interactions.

Note: The Main Effects model is also called the Additive model because the effects of the levels of Factors A and B on the mean response simply add, which will not be the case when interactions are judged to be significant.

Let's look at our first example.

Example: A new apple juice product was entering the marketplace. It had three distinct advantages relative to existing apple juices. First, it was not a concentrate and was therefore considered to be of higher “quality” than many similar products. Second, as one of the first juices packaged in cartons, it was cheaper than competing products. Third, partly because of the packaging, it was more convenient. The director of marketing for the company would like to know which advantage should be emphasized in advertisements. The director would also like to know whether local television or newspapers are better for sales.

Consequently, six cities with similar demographics are chosen, and a different combination of Media and Marketing Strategy is tried in each. The unit sales of apple juice for the ten weeks immediately following the start of the ad campaigns are recorded for each city in the file Apple Juice Tweaked. The two-way table below describes the city assignments for the six possible combinations (treatments) of levels for the two factors.

| |Convenience |Quality |Price |

|Local Television |City 1 |City 3 |City 5 |

|Newspaper |City 2 |City 4 |City 6 |

For this particular example, it was shown that interactions between the factors Media and Marketing Strategy are not significant and can be ignored (we'll take up the problem of interactions later). Table I below lays out the assignments of Media used (factor A) to the row factor, and the Marketing Strategy employed (factor B) to the column factor. For convenience, I've included the data as well ([pic]10 observations per treatment).

|Factor Levels ( i , j ) |Convenience ( j = 1 ) |Quality ( j = 2 ) |Price ( j = 3 ) |

|Local Television ( i = 1 ) |492, 712, 559, 447, 480, |676, 626, 589, 631, 682, |577, 616, 708, 486, 480, 652, 585, 538, |

| |624, 547, 444, 583, 672 |759, 689, 547, 578, 643 |581, 797 |

|Newspaper ( i = 2 ) |464, 559, 759, 558, 528, |690, 650, 705, 653, 577, |805, 585, 527, 499, 815, 566, 710, 547, |

| |670, 534, 657, 557, 474 |837, 629, 799, 498, 842 |618, 588 |

Table II displays the sample means for the rows (the Media means), the columns (the Marketing Strategy means). The notation is (hopefully) self-explanatory.

|Factor Levels ( i , j ) |Convenience ( j = 1 ) |Quality ( j = 2 ) |Price ( j = 3 ) |Media Means |

|Local Television ( i = 1 ) | | | |[pic] 600 |

|Newspaper ( i = 2 ) | | | |[pic] 630 |

|Marketing Strategy Means |[pic] 566 |[pic] 665 |[pic] 614 |[pic] 615 |

Table III provides the estimated main effects for both levels of the Media factor and the three levels of the Marketing Strategy factor. Note: [pic], and [pic] as mentioned previously. Similarly, [pic].

|Factor Levels ( i , j ) |Convenience ( j = 1 ) |Quality ( j = 2 ) |Price ( j = 3 ) |Media Effects |

|Local Television ( i = 1 ) | | | |[pic] |

|Newspaper ( i = 2 ) | | | |[pic] |

|Marketing Strategy Effects |[pic] |[pic] |[pic] |[pic] |

Finally, below is the relevant output from StatGraphics found in the ANOVA and Table of Means Windows.

Analysis of Variance for Sales - Type III Sums of Squares

|Source |Sum of Squares |Df |Mean Square |F-Ratio |P-Value |

|MAIN EFFECTS | | | | | |

| A:Media |13500.0 |1 |13500.0 |1.50 |0.2258 |

| B:Strategy |98040.0 |2 |49020.0 |5.45 |0.0069 |

|RESIDUAL |503958. |56 |8999.25 | | |

|TOTAL (CORRECTED) |615498. |59 | | | |

Note: Only Marketing Strategy is significant in this model.

Table of Least Squares Means for Sales with 95.0% Confidence Intervals

| | | |Stnd. |Lower |Upper |

|Level |Count |Mean |Error |Limit |Limit |

|GRAND MEAN |60 |615.0 | | | |

|Media | | | | | |

|newspaper |30 |630.0 |17.3198 |595.304 |664.696 |

|tv |30 |600.0 |17.3198 |565.304 |634.696 |

|Strategy | | | | | |

|convenience |20 |566.0 |21.2123 |523.507 |608.493 |

|price |20 |614.0 |21.2123 |571.507 |656.493 |

|quality |20 |665.0 |21.2123 |622.507 |707.493 |

Note: The means in the table above correspond to those displayed in the margins on Table II.

On the theory that one can never have too many graphs, the means plots for both factors are reproduced below.

Notice that the means plot for the Media factor supports the conclusion that the factor isn't significant to Sales. Only the difference in mean sales when emphasizing quality versus emphasizing convenience is statistically significant at the 5% level of significance. (This can also be confirmed by looking at the Multiple Range Tests window in StatGraphics and selecting the Marketing Strategy factor with Pane Options.)

[pic]

The ANOVA Table in Two-Way ANOVA Without Interactions

Although we won't prove it here, the sums of squares and degrees of freedom in the ANOVA table decompose in the usual very nice way. The following summarizes the notation and results for two-way ANOVA without interaction.

ANOVA Table (Without Interactions):

|Source of Variation |Sum of Squares |Degrees of Freedom |Mean Square |F-Ratio |

|Factor A |[pic] |[pic] |[pic] |[pic] |

|Factor B |[pic] |[pic] |[pic] |[pic] |

|Error |[pic] |[pic] |[pic] | |

|Total |[pic] |[pic] | | |

o [pic] is the ijkth residual in the additive (Main Effects, or non-interaction) model, [pic].

o SSE: The error sum of squares, [pic].

o SSA + SSB = SSR , i.e., SSA and SSB partition the old SSR from one-way ANOVA. Thus in the additive model, the two "Main Effects" sum of squares account for all of the variation in the mean response attributable to the different levels of factors A and B.

o SST = SSE + SSA + SSB. This is a direct result of the discussion in the previous bullet and the relation SST = SSE + SSR in one-way ANOVA.

o [pic]

You should take a moment to verify the sums of squares and degrees of freedom in the ANOVA table for this example reproduced below (with [pic], [pic], and [pic]).

|Source |Sum of Squares |Df |Mean Square |F-Ratio |P-Value |

|MAIN EFFECTS | | | | | |

| A:Media |13500.0 |1 |13500.0 |1.50 |0.2258 |

| B:Strategy |98040.0 |2 |49020.0 |5.45 |0.0069 |

|RESIDUAL |503958. |56 |8999.25 | | |

|TOTAL (CORRECTED) |615498. |59 | | | |

Two-Way ANOVA With Interactions

If interactions are significant, then their interpretation takes precedent over the interpretation of factor effects.

Factor Effects Model (With Interactions) - The Interactions Model: [pic], where

• [pic]is the differential effect of the ijth treatment on the mean response.

The file Apple Juice Interactions is another take on the marketing study in the previous example, but with the sales data rearranged to make interactions significant. The (revised) data appears in Table IV below.

|Factor Levels ( i , j ) |Convenience ( j = 1 ) |Quality ( j = 2 ) |Price ( j = 3 ) |

|Local Television ( i = 1 ) |492, 712, 559, 447, 480, |464, 559, 759, 558, 528, |678, 628, 591, 633, 684, |

| |624, 547, 444, 583, 672 |670, 534, 657, 557, 474 |761, 691, 549, 580, 645 |

|Newspaper ( i = 2 ) |690, 650, 705, 653, 577, |577, 616, 708, 486, 480, |803, 583, 525, 497, 813, 564, 708, 545, |

| |837, 629, 799, 498, 842 |652, 585, 538, 581, 797 |616, 586 |

Hypotheses for Interaction:

❖ H0: All [pic] equal zero, i.e., the factors Media and Marketing Strategy do not interact.

❖ HA: Some [pic]are not zero, and the factors Media and Marketing Strategy do interact

The following ANOVA table in StatGraphics suggests that interactions "AB" are significant at the 5% level.

Analysis of Variance for Sales - Type III Sums of Squares

|Source |Sum of Squares |Df |Mean Square |F-Ratio |P-Value |

|MAIN EFFECTS | | | | | |

| A:Media |31740.0 |1 |31740.0 |3.41 |0.0701 |

| B:Strategy |21720.0 |2 |10860.0 |1.17 |0.3187 |

|INTERACTIONS | | | | | |

| AB |60760.0 |2 |30380.0 |3.27 |0.0457 |

|RESIDUAL |501998. |54 |9296.26 | | |

|TOTAL (CORRECTED) |616218. |59 | | | |

.

Table V displays the sample means for the rows (the Media means), the columns (the Marketing Strategy means), and the cells (the Treatment means).

|Factor Levels ( i , j ) |Convenience ( j = 1 ) |Quality ( j = 2 ) |Price ( j = 3 ) |Media Means |

|Local Television ( i = 1 ) |[pic] |[pic] |[pic] |[pic] 592 |

|Newspaper ( i = 2 ) |[pic] |[pic] |[pic] |[pic] 638 |

|Marketing Strategy Means |[pic] 622 |[pic] 589 |[pic] 634 |[pic] 615 |

Table VI provides the estimated main effects for both levels of the Media factor and the three levels of the Marketing Strategy factor, plus the estimated Treatment effects. (The notation for the treatment effects is given below the table.)

|Factor Levels ( i , j ) |Convenience ( j = 1 ) |Quality ( j = 2 ) |Price ( j = 3 ) |Media Effects |

|Local Television ( i = 1 ) |[pic] |[pic] |[pic] |[pic] |

|Newspaper ( i = 2 ) |[pic] |[pic] |[pic] |[pic] |

|Marketing Strategy Effects |[pic] |[pic] |[pic] |[pic] |

• [pic] estimates [pic]. Note: [pic], and [pic].

The ANOVA Table in Two-Way ANOVA With Interactions

The following summarizes the notation and results for two-way ANOVA with interaction. Notice that SSAB and [pic] come out of SSE and [pic], respectively. In particular, neither the sums of squares for the main effects, nor their degrees of freedom, are changed by introducing interactions into the model! You should verify all of this for the ANOVA tables for the Apple Juice Interactions data reproduced on the next page.

ANOVA Table (With Interactions):

|Source of Variation |Sum of Squares |Degrees of Freedom |Mean Square |F-Ratio |

|Factor A |[pic] |[pic] |[pic] |[pic] |

|Factor B |[pic] |[pic] |[pic] |[pic] |

|Interactions AB |[pic] |[pic] |[pic] |[pic] |

|Error |[pic] |[pic] |[pic] | |

|Total |[pic] |[pic] | | |

• [pic] is the kth residual for the ijth treatment in the Interaction (non-additive) model, [pic]

|Analysis of Variance for Sales - Interactions Removed |Analysis of Variance for Sales - Interactions Included |

|Source |Source |

|Sum of Squares |Sum of Squares |

|Df |Df |

|Mean Square |Mean Square |

|F-Ratio |F-Ratio |

|P-Value |P-Value |

| | |

|MAIN EFFECTS |MAIN EFFECTS |

| | |

| | |

| | |

| | |

| | |

| | |

|A:Media |A:Media |

|31740.0 |31740.0 |

|1 |1 |

|31740.0 |31740.0 |

|3.16 |3.41 |

|0.0810 |0.0701 |

| | |

|B:Strategy |B:Strategy |

|21720.0 |21720.0 |

|2 |2 |

|10860.0 |10860.0 |

|1.08 |1.17 |

|0.3463 |0.3187 |

| | |

|RESIDUAL |INTERACTIONS |

|562758. | |

|56 | |

|10049.3 | |

| | |

| | |

| | |

|TOTAL (CORRECTED) |AB |

|616218. |60760.0 |

|59 |2 |

| |30380.0 |

| |3.27 |

| |0.0457 |

| | |

| |RESIDUAL |

| |501998. |

| |54 |

| |9296.26 |

| | |

| | |

| | |

| |TOTAL (CORRECTED) |

| |616218. |

| |59 |

| | |

| | |

| | |

| | |

Below I've included an interaction plot. It shows that emphasizing convenience lead to both the lowest and highest mean sales, depending upon whether local television or newspapers were used. Thus, it wouldn’t make sense to talk about the effect of emphasizing convenience without consideration of the media used, i.e., we should only interpret levels of the two factors taken together (the treatments). Therefore, we will not investigate the means plots for the main effects due to the factors Media and Marketing Strategy. From the interaction plot, it appears that the most effective campaign would emphasize convenience in newspapers. The least effective combination is to emphasize convenience on local television.

[pic]

Download and print the file ANOVA Table Comparison, which is intended to summarize pertinent information about two-way ANOVA in a form reminiscent of our discussion of regression in earlier notes.

[pic]

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download