Description Usage Arguments Value Examples
Conduct forward or backward selection for linear regression models
1 | StepSelect(full, direction, k = 2, trace = FALSE)
|
full |
the full model for backward selection to start and the upper limit for forward selection |
direction |
should be either "backward" or "forward" |
k |
numeric, the penalty per parameter to be used in AIC; the default k = 2 is the classical AIC. |
trace |
to determine if the process of selection will be shown or not |
the final linear regression result after selection
1 2 3 4 | full_lm = lm(mpg ~ ., data = mtcars)
n = dim(mtcars)[1]
StepSelect(full_lm, direction = "forward", k = log(n))
StepSelect(full_lm, direction = "backward", trace = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.