I am hoping to compare two time trends in my data: (a) the raw trend in my outcome variable y over the years, and (2) the trends in y if I control for month and predict at a certain month. So I'm running:
Each of these margins commands produces a prediction over the same years, and marginsplot produces close to identical graphics for each. Yet combomarginsplot fails because of the at(monthint=6). The error I get is this: file 2 _u_at_vars don't match file 1.
I can reproduce this error in the auto data:
Again, I see no reason why these two graphics should NOT be shown overlaid (I've added individual marginsplot commands to illustrate that the two graphics are set up identically), but combomarginsplot will not allow it. Is there any way around this problem? Thanks!
Code:
svy: reg wasting2 i.year margins year, saving(f1, replace) svy: reg wasting2 i.year i.monthint margins year, at(monthint=6) saving(f2, replace) combomarginsplot f1 f2
I can reproduce this error in the auto data:
Code:
sysuse auto.dta, clear gen binmpg = round(mpg) reg price i.foreign margins foreign, saving(f1, replace) marginsplot reg price i.foreign i.binmpg margins foreign, at(binmpg=20) saving(f2, replace) marginsplot combomarginsplot f1 f2
Comment