if (FALSE) {
# Load example data
data(mtcars)
# Run stepwise regression with multiple strategies
formula <- mpg ~ .
result <- stepwise(
formula = formula,
data = mtcars,
type = "linear",
strategy = c("forward", "bidirection", "subset"),
metric = c("AIC", "BIC", "SL")
)
# Generate default overview plot
plot(result)
# Generate detailed plot for forward selection
plot(result, strategy = "forward", process = "detail")
# Generate overview plot with 3 decimal places
plot(result, strategy = "bidirection", process = "overview", num_digits = 3)
}
Run the code above in your browser using DataLab