library(AER)
library(MASS)
data(Boston)
# run a regression of medv on all remaining variables in the Boston data set
# obtain a robust summary of the coefficients
# what is the R^2 of the model?
# run a regression of medv on all remaining variables in the Boston data set
full_mod <- lm(medv ~., data = Boston)
# obtain a robust summary of the coefficients
coeftest(full_mod, vcov. = vcovHC, type = "HC1")
# what is the R^2 of the model?
summary(full_mod)$adj.r.squared
test_object("full_mod")
test_function("coeftest", args="x")
test_student_typed("vcov. = vcovHC")
success_msg("Right. Notice that the smallest p-value is associated with the coefficient on ptratio, the pupil-teacher ratio by town. It is conceivable that quality of the schooling district is an important location factor. According to the adj. R^2 , the full model does better than
the model dealt with in exercises 2 and 3 which uses a smaller subset of the variables as regressors.")