Using the Boston dataset:
medv
as the response and lstat
, zn
, nox
and ptratio
as the predictors and store it in lm.fit1
summary()
function to see which of the predictors are significant and which ones are not. Then remove the predictors that are not significant (p > 0.05) and store the model in lm.fit2
Assume that:
MASS
library has been loadedBoston
dataset has been loaded and attached