Hi Folks, I am trying to figure out how to incorporate the information from one equation into another equation via the margins command. I am estimating the model below. Using my approach, I am able to see how y is impacted by age via distance. But, ultimately, I would like a marginsplot of y vs age. Is there a way to do this? Thanks!
Code:
clear all use http://www.stata-press.com/data/r13/margex reg3 (y=distance) (distance = age i.sex) margins, at(age=(20(5)40)) predict(equation(distance)) margins, at(distance=(53.14669(1)58.64088)) predict(equation(y))
Comment