capture log close set logtype text, log using hw2q1.txt, replace clear set memory 100m set more on use 401K, clear describe tabstat prate mrate reg prate mrate predict hprate,xb display 83.07546+3.5*5.861079 /*Confidence interval*/ reg prate mrate, level(98) corr hprate prate scatter prate mrate|| lfit prate mrate graph save graph1, replace gen tprate = prate*2 gen tmrate = mrate*3 reg tprate tmrate use wage2, clear describe tabstat wage IQ reg wage IQ exper educ display 8.303064*15 gen liq = log(IQ) reg lwage IQ predict uhat, residuals gen u2 = uhat^2 reg u2 liq scatter u2 liq||lfit u2 liq graph save graph2, replace reg lwage liq predict luhat, residuals gen lu2 = luhat^2 reg lu2 liq scatter lu2 liq||lfit lu2 liq graph save graph3, replace graph combine graph1.gph graph2.gph graph3.gph, rows(2) log close exit