stepwise | R Documentation |
Build a model according to the stepwise procedure (bidirectional) and the given criterion.
stepwise(data, crit = mbic, ...)
data |
an object of class |
crit |
a function defining the model selection criterion. You can use
your own function or one of these: |
... |
optional arguments to |
Type browseVignettes("bigstep")
for more details.
An object of class big
.
set.seed(1)
n <- 30
p <- 10
X <- matrix(rnorm(n * p), ncol = p)
y <- X[, 2] + 2*X[, 3] - X[, 6] + rnorm(n)
d <- prepare_data(y, X)
stepwise(d)
d %>%
fast_forward(crit = aic) %>%
stepwise(crit = bic)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.