Statistics Toolbox
  Go to function:
    Search    Help Desk 
anova2    Examples

Two-way Analysis of Variance (ANOVA).

Syntax

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.


anova2 returns the p-values for the null hypotheses that the means of the columns and the means of the rows of X are equal. If any p-value is near zero, this casts doubt on the null hypothesis and suggests that the means of the source of variability associated with that p-value are, in fact, different.

The choice of a limit for the p-value to determine whether the result is "statistically significant" is left to the researcher. It is common to declare a result significant if the p-value is less than 0.05 or 0.01.

anova2 also displays a figure showing the standard ANOVA table, which divides the variability of the data in X into three or four parts depending on the value of reps:

The ANOVA table has five columns:

The p-value is a function (fcdf) of F. As F increases the p-value decreases.

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.

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.



[ Previous | Help Desk | Next ]