Created
October 22, 2011 23:44
-
-
Save smc77/1306640 to your computer and use it in GitHub Desktop.
Multivariate Regression
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# details about dataset available http://archive.ics.uci.edu/ml/datasets/Housing | |
housing <- read.table("http://archive.ics.uci.edu/ml/machine-learning-databases/housing/housing.data") | |
names(housing) <- c("CRIM", "ZN", "INDUS", "CHAS", "NOX", "RM", "AGE", "DIS", "RAD", "TAX", "PTRATIO", "B", "LSTAT", "MEDV") | |
# Subset the data for our model | |
housing <- housing[, c("CRIM", "RM", "PTRATIO", "LSTAT", "MEDV")] | |
plot(housing) | |
# Look at the linear model | |
housing.lm = lm(MEDV ~ CRIM + RM + PTRATIO + LSTAT, data=housing) | |
summary(housing.lm) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment