capture log close log using "SOCY699C-HW4-REGRESS-MARGINSPLOT.txt", text replace /* margins examples */ regress sexfrq age if year==2010 /* Estimate a model */ margins /* Use adjust to calculate mean */ margins, at(age=(20(5)85)) /* Calculate mean of predicted values */ marginsplot /* Margins in the multiple regression context */ regress sexfrq i.sex i.race c.age##c.age educ year i.marital attend1 reliten1 margins margins, at(age=(20(5)85)) vsquish marginsplot, recast(line) recastci(rarea) log close