Build regression model from a set of candidate predictor variables by removing predictors based on p values, in a stepwise manner until there is no variable left to remove any more.
step_backward(model, ...)
lm
step_backward
returns an object of class "step_backward"
.
An object of class "step_backward"
is a list containing the
following components:
# stepwise backward regression model <- lm(y ~ ., data = surgical) step_backward(model)#>#>#> Backward Elimination Method #> #> Candidate Terms: #> #> 1 . bcs #> 2 . pindex #> 3 . enzyme_test #> 4 . liver_test #> 5 . age #> 6 . gender #> 7 . alc_mod #> 8 . alc_heavy #> #> -------------------------------------------------------------------------- #> Elimination Summary #> -------------------------------------------------------------------------- #> Variable Adj. #> Step Removed R-Square R-Square C(p) AIC RMSE #> -------------------------------------------------------------------------- #> 1 alc_mod 0.782 0.749 7.0141 734.4068 199.2637 #> 2 gender 0.781 0.754 5.0870 732.4942 197.2921 #> 3 age 0.781 0.758 3.1925 730.6204 195.4544 #> --------------------------------------------------------------------------# stepwise backward regression plot model <- lm(y ~ ., data = surgical) k <- step_backward(model)#>#>plot(k)