Code used in my Stata Conference presentation