Learn R Programming

lmSubsets (version 0.5-2)

refit.lmSubsets: Refit a subset regression

Description

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

Usage

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

# S3 method for 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

Run this code
# NOT RUN {
## 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)
# }

Run the code above in your browser using DataLab