if (FALSE) {
# Load example data
data(mtcars)
# Run stepwise regression
formula <- mpg ~ .
result <- stepwise(
formula = formula,
data = mtcars,
type = "linear",
strategy = "forward",
metric = "AIC"
)
# Print final model statistics
result
}
Run the code above in your browser using DataLab