1
$\begingroup$

I have been trying to reproduce the results for "Hedonic Housing Prices and the Demand for Clean Air" but to no avail thus far. In table 7 there are three regressions mentioned using the Boston data set, this is found here and in the MASS R package.

I have tested the means and stand deviations reported against those in the data, and have had accurate results (although some variables such as lstat, nox and medv needed some mapping). I could not accurately show that the mean and standard deviation of black, given his mapping of the variable as (x - 0.63)^2, in the data set this is multiplied by 1000.

What is more, I could not reproduce the results of the regression. Using both rlm and lm in R, the coefficients were consistently off.

This is a pretty major paper, and a data set which has been used pretty widely, so would be surprised if the error wasn't my own. But would be nice to see if anyone else has managed to reproduce this in R or elsewhere.

Please find my R code below:

# Load MASS for rlm and Boston
library(MASS)

# Sort into the correct order
data <- Boston[,c("medv","rm","age","black","lstat","crim","zn","indus","tax", "ptratio", "dis","rad","nox")]

# Creating a copy of table 5
rbind(sapply(data, mean),sapply(data, sd))

# Creating a copy of table 6
cov(data)

# Attempt to reverse engineer black variable
mean(-sqrt(Boston$black/1000)+0.63)

# Setting out the structural form
form <- formula(I(log(medv*1000)) ~ I(rm^2) + age + log(dis) + log(rad) + tax + ptratio + I(black/1000) + I((lstat/100)) + crim + zn + indus + chas + I((nox*10)^2))

# Regressing using rlm
rlm(form, data = Boston)

# Regressing using lm
lm(form, data = Boston)

# Comparing to referenced data set to check that 
alternate <- read.table("https://archive.ics.uci.edu/ml/machine-learning-databases/housing/housing.data")
as.matrix(Boston) - as.matrix(alternate)
$\endgroup$
  • $\begingroup$ Interesting analysis but what's the question? $\endgroup$ – BKay Sep 29 '16 at 16:12
  • $\begingroup$ Trying to see if anyone else can arrive at the results given in the paper using the given data set. $\endgroup$ – Glen Moutrie Sep 29 '16 at 16:52
  • $\begingroup$ This should be integrated into the question, not just in a comment. $\endgroup$ – BKay Sep 29 '16 at 18:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.