clear use "https://sscc.wisc.edu/~hemken/Stataworkshops/regress/2000_acs_cleaned" /* Warm up exercise: ================= Using the American Community Survey (2000) data, model personal income using age, education, sex, and Census race category. */ anova income c.age c.edu i.female i.race graph box income, over(edu) anova income c.age edu i.female i.race margins edu marginsplot regress regress income c.age i.edu i.female i.race estimates store linear predict pr_inc predict res, resid rvfplot rvfplot, yline(0) generate linc = log(inc) regress linc c.age i.edu i.female i.race estimates store loginc predict lres, resid rvfplot, yline(0) estimates restore linear * regress estat hettest estimates restore loginc * regress estat hettest qnorm res, name(qq1, replace) qnorm lres, name(qq2, replace) swilk res sfrancia res swilk lres sfrancia lres clear all sysuse auto regress price weight foreign##c.weight clear all sysuse auto regress price weight twoway (scatter price weight, mlabel(make)) (lfit price weight) dfbeta