Hi all,
I am looking to create a scatter plot of change in mental health, on a house price shock.
What I would like to do is reg D_mental_v2 i.year, plot the residuals and do a binned scatter plot where the bins are defined over equal intervals of the HP shock and the size of the circle is the number of obs in each bin. Then put reg lines for the residual of the change in mental health regressed on the shock, weighted by the number of observations, estimated separately for the positive and negative shocks.
I struggle quite a lot with graphing in STATA and I am no where near being able to produce it, nor am I sure how to approach it. I understand the regressions that need to be run but I do not know how to create the bins and thus circle sizes, nor am I sure how to do it seperately for positive and negative values on the same plot.
If anyone has any insights I would greatly appreciate them.
I am looking to create a scatter plot of change in mental health, on a house price shock.
What I would like to do is reg D_mental_v2 i.year, plot the residuals and do a binned scatter plot where the bins are defined over equal intervals of the HP shock and the size of the circle is the number of obs in each bin. Then put reg lines for the residual of the change in mental health regressed on the shock, weighted by the number of observations, estimated separately for the positive and negative shocks.
I struggle quite a lot with graphing in STATA and I am no where near being able to produce it, nor am I sure how to approach it. I understand the regressions that need to be run but I do not know how to create the bins and thus circle sizes, nor am I sure how to do it seperately for positive and negative values on the same plot.
If anyone has any insights I would greatly appreciate them.