model <- lm(mpg ~ disp + hp, data = mtcars)
k <- ols_step_all_possible(model)
k
# plot
plot(k)
# maximum subset
model <- lm(mpg ~ disp + hp + drat + wt + qsec, data = mtcars)
ols_step_all_possible(model, max_order = 3)
Run the code above in your browser using DataLab