data(matchdata)yearlnlandlnbldgroomsbedroomsbathroomscentairfireplacebrickgarage1garage2dcbdrryrbuiltcarealatitudelongitudelnpricehedonic$carea <- as.factor(hedonic$cname) m.out <- matchit(y~lnland + lnbldg + rooms + bedrooms + bathrooms + centair + fireplace + brick + garage1 + garage2 + dcbd + elstop + lake + rr + yrbuilt + carea + latitude + longitude, data=hedonic,method="nearest",discard="both") mdata <- match.data(m.out) attach(mdata) matchdata <- data.frame(year, lnland, lnbldg, rooms, bedrooms, bathrooms, centair, fireplace, brick, garage1, garage2, dcbd, rr, yrbuilt, carea, latitude, longitude, lnprice)
The elstop and lake variables, which are not included here, indicate whether a home is within .25 miles of and EL stop and within .5 miles of Lake Michigan.
Ho, D., Imai, K., King, G, Stuart, E., "Matching as Nonparametric Preprocessing for Reducing Model Dependence in Parametric Causal Inference," Political Analysis 15 (2007), 199-236.
Ho, D., Imai, K., King, G, Stuart, E., "MatchIt: Nonparametric preprocessing for parametric causal inference," Journal of Statistical Software 42 (2011), 1-28..
McMillen, Daniel P., "Repeat Sales as a Matching Estimator," Real Estate Economics 40 (2012), 743-771.
data(matchdata)
matchdata$year05 <- matchdata$year==2005
matchdata$age <- matchdata$year - matchdata$yrbuilt
fit <- lm(lnprice~lnland+lnbldg+rooms+bedrooms+bathrooms+centair+fireplace+brick+
garage1+garage2+dcbd+rr+age+year05+factor(carea), data=matchdata)
summary(fit)
Run the code above in your browser using DataLab