STAT Question
# Use the KIELMC.dta (STATA) data set. # This is a pooled cross section, time series data set # for the two years 1978 and 1981 # See Example 13.3 in Wooldridge book, 5th edition # "Effect of A Garbage Incinerator's Location on Housing Prices" # located in the "Diff-in-Diff_Wooldridge.pdf" file on Canvas. # Read in the KIELMC.dta file using the import facility in R. # The KIELMC file is a STATA data file but R can import STATA # data files. View(KIELMC) # Part (a) y81nearinc <- KIELMC$y81*KIELMC$nearinc # The simple Diff-in-Diff regression without controls model1 <- lm(rprice ~ y81 + nearinc + y81nearinc, data=KIELMC) summary(model1) # Part (b) # Adding some controls model2 <- lm(rprice ~ y81 + nearinc + y81nearinc + age + agesq, data=KIELMC) summary(model2) # Part (c) # Adding some more controls model3 <- lm(rprice ~ y81 + nearinc + y81nearinc + age + agesq + intst + land + area + rooms + baths, data=KIELMC) summary(model3) # Part (d) # To look at the percent price change derived from the treatment # we can use the log of rprice as the dependent variable. model4 <- lm(lrprice ~ y81 + nearinc + y81nearinc + age + agesq + intst + land + area + rooms + baths, data=KIELMC) summary(model4)