Two- and N-Way Analysis of Variance by using Stata

One-way ANOVA examines how the means of measurement variable y vary across categories of one other variable x. N-way ANOVA generalizes this approach to deal with two or more categorical x variables. For example, we might consider how drinking behavior varies not only by fraternity or sorority membership, but also by gender. We start by examining a two-way table of means:

It appears that in this sample, males drink more than females and fraternity/sorority members drink more than nonmembers. The Greek/non-Greek difference appears similar among males and females. anova, Stata’s N-way ANOVA command, can test for significant differences among these means attributable to belonging to a fraternity or sorority, gender, or the interaction of Greek membership and gender (written greek#gender).

. anova drink greek gender greek#gender

In this example of two-way factorial ANOVA, the output shows significant main effects for greek (p = .0000) and gender (p = .0008), but their interaction contributes little to the model (p = .7448). Because this interaction cannot be distinguished from zero, we might prefer to fit a simpler model without the interaction term.

To include any interaction term with anova, specify the variable names joined by # (or ## for a factorial interaction). Unless the number of observations with each combination of x values is the same (a condition called balanced data), it can be hard to interpret the main effects in a model that also includes interactions. This does not mean that the main effects in such models are unimportant, however. Regression analysis might help to make sense of complicated ANOVA results, as seen in the following section.

Source: Hamilton Lawrence C. (2012), Statistics with STATA: Version 12, Cengage Learning; 8th edition.

Leave a Reply

Your email address will not be published. Required fields are marked *