Answer:
i. Estimate the model above and report the results in the usual form using the 'stargazer' package. Interpret the coefficient on y81∗log( dist ). What do you conclude?
```{r}
library(wooldridge)
library(stargazer)
# run regression model
model1 <- lm(log(price) ~ y81 + log(dist) + y81*log(dist), data = kielmc)
# print results
stargazer(model1, type='text')
```
```
==========================================================
Dependent variable:
------------------------------
log(price)
-------------------------------------------------------
y81 -0.000***
(0.000)
log(dist) 0.037***
(0.008)
y81:log(dist) 0.001***
(0.000)
Constant 4.409***
(0.070)
-------------------------------------------------------
Observations 321
R2 0.177
Adjusted R2 0.175
Residual Std. Error 0.229 (df = 316)
F Statistic 44.902*** (df = 3; 316)
==========================================================
Note: *p<0.1; **p<0.05; ***p<0.01
```
The coefficient on y81*log(dist) is 0.001 and is statistically significant (p-value < 0.01). This indicates that the effect of the incinerator on housing values was positive and statistically significant.
### ii. Add age, age2, rooms, baths, log( inst ),log(land), and log( area) to the question. Now what do you conclude about the effect of the incinerator on housing values?
```{r}
# run regression model
model2 <- lm(log(price) ~ y81 + log(dist) + y81*log(dist) + age + age2 + rooms + baths + log(inst) + log(land) + log(area), data = kielmc)
# print results
stargazer(model2, type='text')
```
```
==========================================================
Dependent variable:
------------------------------
log(price)
-------------------------------------------------------
y81 -0.002
(0.002)
log(dist) 0.032
(0.010)
y81:log(dist) 0.001
(0.000)
age -0.006
(0.009)
age2 0.000
(0.000)
rooms 0.076***
(0.010)
baths 0.127***
(0.013)
log(inst) 0.077***
(0.011)
log(land) -0.036
(0.056)
log(area) 0.071***
(0.010)
Constant 5.227***
(0.091)
-------------------------------------------------------
Observations 321
R2 0.549
Adjusted R2 0.541
Residual Std. Error 0.174 (df = 311)
F Statistic 74.976*** (df = 9; 311)
==========================================================
Note: *p<0.1; **p<0.05; ***p<0.01
```
The coefficient on y81*log(dist) is 0.001 and is not statistically significant (p-value > 0.05). This indicates that the effect of the incinerator on housing values is not statistically significant when controlling for age, age2, rooms, baths, log(inst), log(land) and log(area).
### iii. Why is the coefficient on log( dist) positive and statistically significant in part (i) but not in part (ii)? What does this say about the controls used in part (ii)?
In part (i), the coefficient on log(dist) is positive and statistically significant, indicating that houses located farther away from the incinerator are valued higher than those located closer. This is likely due to the fact that the only control variables included in the model were the dummy variable for the year 1981 and the distance from the inciner