version 12.1 use https://www3.nd.edu/~rwilliam/statafiles/blwh.dta, clear reg income educ jobexp est store baseline reg income educ jobexp i.black est store intonly test 1.black testparm i.black ftest intonly baseline lrtest intonly baseline est restore intonly quietly margins black, at (jobexp = (1(1)21)) atmeans marginsplot, noci scheme(sj) name(intonly_jobexp) quietly margins black, at (educ = (2(1)21)) atmeans marginsplot, noci ylabel(#10) scheme(sj) name(intonly_educ) reg income educ jobexp i.black i.black#c.jobexp est store intjob ftest intonly intjob test 1.black#c.jobexp testparm i.black#c.jobexp lrtest intonly intjob quietly margins black, at (jobexp = (1(1)21)) atmeans marginsplot, noci scheme(sj) name(intjob_jobexp) reg income educ jobexp i.black i.black#c.educ i.black#c.jobexp est store intedjob ftest baseline intedjob test 1.black 1.black#c.educ 1.black#c.jobexp testparm i.black i.black#c.educ i.black#c.jobexp lrtest baseline intedjob test 1.black#c.educ 1.black#c.jobexp testparm i.black#c.educ i.black#c.jobexp ftest intonly intedjob lrtest intonly intedjob quietly margins black, at (jobexp = (1(1)21)) atmeans marginsplot, noci scheme(sj) name(intedjob_jobexp) quietly margins black, at (educ = (2(1)21)) atmeans marginsplot, noci ylabel(#10) scheme(sj) name(intedjob_educ)