# stepwise backward regression
model <- lm(y ~ ., data = surgical)
ols_step_backward_aic(model)
# stepwise backward regression plot
model <- lm(y ~ ., data = surgical)
k <- ols_step_backward_aic(model)
plot(k)
# final model
k$model
Run the code above in your browser using DataLab