*
* Dougherty, Introduction to Econometrics, 4th ed
* Example from Section 5.1
* Dummy variables
*
open data schools.xls
data(format=xls,org=columns) 1 74 cost n occ regular tech worker voc gen res
*
linreg cost
# constant n
*
linreg cost
# constant occ n
*
* This NA's out the cost data for the observations which don't fall into the
* category that we want.
*
set occcost = %if(occ,cost,%na)
set regcost = %if(regular,cost,%na)
*
scatter(footer="Figure 5.2 Cost functions for regular and occupational schools",$
key=upleft,klabels=||"Occupational schools","Regular schools"||,vlabel="Cost",$
lines=||%beta(1)+%beta(2),%beta(3)|%beta(1),%beta(3)||) 2
# n occcost
# n regcost