Stata tip #: Exploring model consequences by plotting different predictions

Maarten L. Buis

This Stata tip was written and submitted to the Stata Journal just before the release of Stata 12. It turned out that the new marginsplot command made most of the tricks discussed in this tip superfluous, so I withdrew that submission. I still keep it on my website for those who do not have access to Stata 12 (or higher) and because it is a nice illustration of the trick to use the factor variable notation for creating quadratic curves.


A useful trick for exploring the consequences of a model is that predict does not require the data to be the same as the data used during estimation. That way we can get predictions while fixing some of the explanatory variables at specific values. One area of application of this trick are situations in which something varies with two controls. In that case one can create a graph where one goes on the x axis and the other is presented by a set of example values. In this tip I will illustrate it using a linear regression model that includes an interaction between two variables where one of these was entered as a quadratic curve.

Full text

Supplementary material