powered by
Remove the worst variable from a model according to the given criterion.
backward(data, crit = mbic, ...)
An object of class big.
big
an object of class big.
a function defining the model selection criterion. You can use your own function or one of these: bic, mbic, mbic2, aic, maic, maic2.
bic
mbic
mbic2
aic
maic
maic2
optional arguments to crit.
crit
Type browseVignettes("bigstep") for more details.
browseVignettes("bigstep")
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) d %>% fast_forward(crit = aic) %>% backward() %>% backward()
Run the code above in your browser using DataLab