, ,

Post-estimation use of interaction terms

Regularly, I need to figure out how to use estimated coefficients in post-estimation commands, such as coefplot by Ben Jann (e.g., to define variables that are kept or to adjust coefficient labels).

While it is quite straightforward to call estimation results of variables (e.g., by writing _b[var1] to retrieve the coefficient or _se[var1] for the standard errors), this is much more involved for interaction terms where it can also depend on the exact implementation of the interaction terms.

One extreme time-saver is the option coeflegend, i.e. you write

reg y var1##var2, coeflegend

And Stata produces the normal table but with all temporary variable names included.

Thanks to Sebastian for the hat tip!