best.subsets: F-test based best subset selection.

Description Usage Arguments Details Value Author(s) Examples

Description

Adaptation of existing methods based on AIC/BIC.

Usage

1
best.subsets(model, nbest = 5, nvmax, digits, force.in = "NULL")

Arguments

model

object class lm to select effects from.

nbest

numeric indicating number of models to report of each size.

nvmax

numeric maximum size of subsets to examine.

digits

numeric giving number of digits in format of output.

force.in

character vector indicating effects to keep in all models.

Details

F-based versions of built in subset method.

Value

No return, only print.

Author(s)

Kristian Hovde Liland

Examples

1
2
3
4
5
data <- data.frame(y = rnorm(8),
				   x = factor(c('a','a','a','a','b','b','b','b')),
				   z = factor(c('a','a','b','b','a','a','b','b')))
mod <- lm(y ~ x + z, data=data)
best.subsets(mod)

Example output

Attaching package: 'mixlm'

The following objects are masked from 'package:stats':

    glm, lm

         x1 z1       RSS          R2      R2adj       Cp
1  ( 1 )  *     6.489188 0.360200170  0.2535669 1.016869
1  ( 2 )     * 10.120709 0.002151296 -0.1641568 3.824441
2  ( 1 )  *  *  6.467369 0.362351467  0.1072921 3.000000

mixlm documentation built on May 2, 2019, 6:08 p.m.

Related to best.subsets in mixlm...