| Statistics Toolbox | Search  Help Desk |
| anova2 | Examples |
Two-way Analysis of Variance (ANOVA).
Syntax
p = anova2(X,reps)
Description
anova2(X,reps) performs a balanced two-way ANOVA for comparing the means of two or more columns and two or more rows of the sample in X. The data in different columns represent changes in one factor. The data in different rows represent changes in the other factor. If there is more than one observation per row-column pair, then the argument, reps, indicates the number of observations per "cell." The matrix below shows the format for a set-up where the column factor has two levels, the row factor has three levels, and there are two replications. The subscripts indicate row, column and replicate, respectively.
Examples
The data below comes from a study of popcorn brands and popper type (Hogg 1987). The columns of the matrix popcorn are brands (Gourmet, National, and Generic). The rows are popper type (Oil and Air.) The study popped a batch of each brand three times with each popper. The values are the yield in cups of popped popcorn.load popcorn
popcorn
popcorn =
5.5000 4.5000 3.5000
5.5000 4.5000 4.0000
6.0000 4.0000 3.0000
6.5000 5.0000 4.0000
7.0000 5.5000 5.0000
7.0000 5.0000 4.5000
p = anova2(popcorn,3)
p =
0.0000 0.0001 0.7462
The vector, p, shows the p-values for the three brands of popcorn 0.0000, the two popper types 0.0001, and the interaction between brand and popper type 0.7462. These values indicate that both popcorn brand and popper type affect the yield of popcorn, but there is no evidence of a synergistic (interaction) effect of the two.
The conclusion is that you can get the greatest yield using the Gourmet brand and an Air popper (the three values located in popcorn(4:6,1)).
Reference
Hogg, R. V. and J. Ledolter. Engineering Statistics. MacMillan Publishing Company, 1987.