use "http://wps.aw.com/wps/media/objects/3254/3332253/datasets2e/datasets/CollegeDistance.dta", clear reg ed dist female bytest tuition black hispanic incomehi ownhome dadcoll momcoll cue80 stwmfg80 margins, dydx(dist) gen ln_ed = ln(ed) reg ln_ed dist female bytest tuition black hispanic incomehi ownhome dadcoll momcoll cue80 stwmfg80 predict ln_yb gen yb=exp(ln_yb) margins, dydx(dist) reg ed dist c.dist#c.dist female bytest tuition black hispanic incomehi ownhome dadcoll momcoll cue80 stwmfg80 margins, dydx(dist) at((means) _all dist=(2 6)) set obs 3807 replace female = 1 in 3797/3807 replace black = 0 in 3797/3807 replace hispanic = 1 in 3797/3807 replace bytest = 58 in 3797/3807 replace dadcoll = 1 in 3797/3807 replace momcoll = 1 in 3797/3807 replace ownhome = 0 in 3797/3807 replace cue80 = 7.1 in 3797/3807 replace incomehi = 0 in 3797/3807 replace stwmfg80 = 10.06 in 3797/3807 replace tuition = .950 in 3797/3807 replace dist = 0 in 3797 replace dist = 1 in 3798 replace dist = 2 in 3799 replace dist = 3 in 3800 replace dist = 4 in 3801 replace dist = 5 in 3802 replace dist = 6 in 3803 replace dist = 7 in 3804 replace dist = 8 in 3805 replace dist = 9 in 3806 replace dist = 10 in 3807 qui reg ed dist c.dist#c.dist female bytest tuition black hispanic incomehi ownhome dadcoll momcoll cue80 stwmfg80 predict yc qui reg ed dist female bytest tuition black hispanic incomehi ownhome dadcoll momcoll cue80 stwmfg80 predict ya qui twoway (line ya dist in 3798/3807), name(one, replace) qui twoway (line yc dist in 3798/3807), name(two, replace) graph combine one two, name(all, replace) reg ed dist c.dist#c.dist female bytest tuition black hispanic incomehi ownhome dadcoll momcoll cue80 stwmfg80 1.dadcoll#1.momcoll di "Jane vs Mary " lincom _b[dadcoll] di "Alexis vs Mary " lincom _b[momcoll] di "Bonnie vs Mary" lincom _b[momcoll]+_b[dadcoll]+_b[1.dadcoll#1.momcoll]