Build regression model from a set of candidate predictor variables by entering predictors based on Akaike Information Criteria, in a stepwise manner until there is no variable left to enter any more.

stepaic_forward(model, ...)

Arguments

model
an object of class lm
...
other arguments

Value

stepaic_forward returns an object of class "stepaic_forward". An object of class "stepaic_forward" is a list containing the following components:

Examples

# stepwise forward regression model <- lm(y ~ ., data = surgical) stepaic_forward(model)
#> --------------------------------------------------------------------------- #> Variable AIC Sum Sq RSS R-Sq Adj. R-Sq #> --------------------------------------------------------------------------- #> liver_test 771.8753 3804272.477 4565248.06 0.455 0.444 #> alc_heavy 761.4394 4743349.776 3626170.761 0.567 0.55 #> enzyme_test 750.5089 5515514.136 2854006.401 0.659 0.639 #> pindex 735.7146 6278360.06 2091160.477 0.75 0.73 #> bcs 730.6204 6535804.09 1833716.447 0.781 0.758 #> ---------------------------------------------------------------------------
# stepwise forward regression plot model <- lm(y ~ ., data = surgical) k <- stepaic_forward(model) plot(k)