### Two-Way (and Higher) Analysis of Variance in Minitab

Use Stat > ANOVA > Balanced ANOVA

This will only work for balanced designs (that is, equal sample sizes in each treatment combination), except for one-way ANOVA.

Data must be arranged so that there is one column for each factor. If your data are not already in this form, you can use the Code Data Values feature on the Manipulate Menu to get the desired columns. For example, in the battery data, there are four treatments:
1: alkaline, name brand
2: alkaline, store brand
3: heavy duty, name brand
4: heavy duty, store brand
The column Typebat lists treatments 1 - 4. To get a column for the factor A: Alkaline or heavy duty , enter Typebat in "Code data from columns:"and A into "Into columns:". In the first row of "Original values," enter 1 2, and in the first row of "New" enter 1. Enter 3 4 in the second row of "Original values" and 2 in the second row of "New". Clicking OK should create a new column, labeled A, with original treatments 1 and 2 coded as 1, and original treatments 3 and 4 coded as 2. Proceed similarly to get a column for the other factor.

Once the data are in the proper form, go to
Stat > ANOVA > Balanced ANOVA. Enter the response where requested. In the "Model" box, enter the model using the following shorthand:

A B designates the main effects model with two factors A and B (no interaction terms)
A B A*B designates the complete model with two factors A and B (including interaction terms). (Shorthand for this: A|B)

For later use:

A*B*C designates a three-way interaction term (Chapter 7)
A|B|C is shorthand for A B C A*B A*C B*C A*B*C

B(A) designates B nested within A (Chapter 18)
C(AB) designates C nested within both A and B (Chapter 18)
the box "Random Factors" will be used when we get to Chapter 17