clear set mem 100M set matsize 800 set more off cd "C:\Users\josh\Documents\My Dropbox\Classes\Econ 174\Assignments\Practice" log using practice.log use practice.dta, replace sysuse auto, replace gen cost = 0 replace cost = cost + 1.5*weight replace cost = cost + .25*weight if foreign==1 replace cost = cost+100 if rep78==5 replace cost = cost+50 if mpg>25 gen profit = price - cost sum profit xtile cost_quartile=price, nq(4) bysort cost_quartile: egen quartile_mpg = mean(mpg) reg price mpg pred pred_price twoway (scatter price mpg)(line pred_price mpg) twoway (scatter price mpg, msymbol(plus))(line pred_price mpg, clpattern(dash) clcolor(yellow)), title(Josh's plot. w00t.) twoway (scatter price mpg, msymbol(plus))(lfitci price mpg, clpattern(dash) clcolor(yellow)), title(Josh's plot. w00t.)