Doing analysis of variance (often refered to as ANOVA) in Stata is easy. Let’s begin by finding a suitable dependent variable which should be continuous and an independent categorical type variable.
Let’s load up the nlsw88 data set and see if the mean of wage is the same across race. This is achieved by using a one-way ANOVA of wage against race. Adding the tabulate option will provide some additional information:
oneway wage race, tabulate
In the bottom table we can see the result of the ANOVA calculation and with a p-value of 0.000 we can safely reject the null hypothesis of equal means across the categories at test. Let’s try another example:
oneway wage industry, tabulate
Again we can see that wages do not seem to be equal across industries either: