*
* Dougherty, Introduction to Econometrics, 4th ed
* Example from Section 4.3
* Interaction effects
*
open data eaef21c.xls
data(format=xls,org=columns) 1 540 id female male ethblack ethhisp ethwhite age s educprof educphd educmast $
educba educaa educhsd educdo single married divorced faithn faithp faithc faithj faitho asvab01 asvab02 $
asvab03 asvab04 asvab05 asvab06 asvabc height weight85 weight02 sm sf siblings library pov78 earnings $
hours tenure exper collbarg catgov catpri catse urban regne regnc regw regs
*
set lgearn = log(earnings)
*
smpl(series=male)
*
linreg lgearn
# constant s exper
*
set sexp = s*exper
*
linreg lgearn
# constant s exper sexp
*
* DIFF(CENTER) produces one series by removing the mean from another. Note that
* the mean is computed using the entire range of the data, not just the males.
* This is what is being done in the text as well.
*
diff(center) s / s1
diff(center) exper / exp1
set sexp1 = s1*exp1
*
linreg lgearn
# constant s1 exp1
disp "Hourly wage at the mean" exp(%beta(1))
linreg lgearn
# constant s1 exp1 sexp1