Using gret l for Principles of Econometrics, 4th Edition
Regression with an Indicator Variable
An indicator variable is a variable that can be equal to one of two possible values. Commonly, this an indicator variable can be a 1 or a 0. So for instance, if a house is located in the University Town subdivision the variable is given the value of 1 and if not it is equal to 0.
The regression model becomes
price = ві + e2utown + e (2.12)
As pointed out in POE4, taking the expected value of a regression is very useful when it contains an indicator variable. This will reveal how to interpret its coefficient. In this model
So, estimating the model using the utown. gdt data yields
price = 215.732 + 61.5091 utown
(1.3181) (1.8296)
T = 1000 R[5] [6] [7] [8] [9] = 0.5306 F(1, 998) = 1130.2 a = 28.907
(standard errors in parentheses)
This implies that the average home price (in $1000) in University Town is 215.7325 + 61.5091 = 277.2416 and the average price elsewhere is 215.7325.
The script that produces the same result is straightforward: