Hello Experts,
I am doing a difference-in-difference analysis using Stata 15.1 (using the following code), the outreg2 works but when I try to do a margins command to get a marginsplot, I get an error code:
Can someone please explain why I am getting these errors and how I can get the margins & marginsplot commands to work?
Thank you
Deepali
I am doing a difference-in-difference analysis using Stata 15.1 (using the following code), the outreg2 works but when I try to do a margins command to get a marginsplot, I get an error code:
Code:
xi:diff married [pweight=wt] if agegr3==1, t(cat) p(survey) cluster(hv021) margins , pred(pr) at (cat=(0 1)) over(survey) vsquish post variable __000002 not found r(111); xi:diff married [pweight=wt] if agegr3==1, t(cat) p(survey) cov (i.agegr3 i.hv104) cluster(hv021) kernel rcs est store z1 outreg2 using table_diff, ctitle(`r(Currently married)') addstat(Mean control t(0), r(mean_c0), Mean treated t(0), r(mean_t0), Diff t(0), r(diff0), Mean control t(1), r(mean_c1), Mean treated t(1), r(mean_t1), Diff t(1), r(diff1)) label excel nocons est restore z1 margins , pred(pr) at (cat=(0 1)) over(survey) vsquish post variable __00000C not found r(111); xi:diff married [pweight=wt] if agegr3==1, t(cat) p(survey) cov (i.hv025 i.hv104 i.agegr3 i.hhsize i.foreign i.eduhead) cluster(hv021) kernel rcs est store z2 outreg2 using table_diff, ctitle(`r(Currently married)') addstat(Mean control t(0), r(mean_c0), Mean treated t(0), r(mean_t0), Diff t(0), r(diff0), Mean control t(1), r(mean_c1), Mean treated t(1), r(mean_t1), Diff t(1), r(diff1)) label excel nocons est restore z2 margins , pred(pr) at (cat=(0 1)) over(survey) vsquish post variable __00000C not found r(111);
Can someone please explain why I am getting these errors and how I can get the margins & marginsplot commands to work?
Thank you
Deepali
Comment