linear regression

Linear Regression

Data We are using the MASS library that contains the Boston dataset. These records measure the median house value for 506 neighborhoods around Boston. library(MASS) data <- MASS::Boston fix(Boston) names(Boston) ## [1] "crim" "zn" "indus" "chas" "nox" "rm" "age" ## [8] "dis" "rad" "tax" "ptratio" "black" "lstat" "medv" A simple Linear Regression We are using the lm() function to fit a simple linear regression model. The medv is a response variable and lstat the predictor variable.

Continue reading