refit.lmSubsets {lmSubsets}R Documentation

Refit a subset regression

Description

Fit the specified submodel and return the obtained "lm" object.

Usage

## S3 method for class 'lmSubsets'
refit(object, size, best = 1, ...)

## S3 method for class 'lmSelect'
refit(object, best = 1, ...)

Arguments

object

"lmSubsets", "lmSelect"—a subset regression

size

integer—the submodel size

best

integer—the submodel position

...

ignored

Value

"lm"—the fitted model

See Also

Examples

## load data
data("AirPollution", package = "lmSubsets")

## fit subsets
lm_all <- lmSubsets(mortality ~ ., data = AirPollution)

## refit best model
lm5 <- refit(lm_all, size = 5)
summary(lm5)

[Package lmSubsets version 0.5-2 Index]