In this post we’ll continue looking at factor variables, and in particular how they can interact with continuous variables. Interactions can be achieved using the # operator. Let’s load up the nlsw88 dataset and have a try:
sysuse nlsw88, clear
summarize c.wage#i.south
The interaction of the variables wage and south indicate that the average wage of non-southerners is approx $2 higher than that of southern residents.
It’s also possible to perform interactions between two indicator variables:
summarize i.collgrad#i.union
The result tells us that in this sample approx 16,67% of non-college grads are union workers whereas 7,88% of college grads belong to a union.