Learn R Programming

olsrr (version 0.4.0)

ols_all_subset: All Possible Regression

Description

Fits all regressions involving one regressor, two regressors, three regressors, and so on. It tests all possible subsets of the set of potential independent variables.

Usage

ols_all_subset(model, ...)

# S3 method for ols_all_subset plot(x, model = NA, ...)

Arguments

model

an object of class lm

...

other arguments

x

an object of class ols_best_subset

Value

ols_all_subset returns an object of class "ols_all_subset". An object of class "ols_all_subset" is a data frame containing the following components:

n

model number

predictors

predictors in the model

rsquare

rsquare of the model

adjr

adjusted rsquare of the model

predrsq

predicted rsquare of the model

cp

mallow's Cp

aic

akaike information criteria

sbic

sawa bayesian information criteria

sbc

schwarz bayes information criteria

gmsep

estimated MSE of prediction, assuming multivariate normality

jp

final prediction error

pc

amemiya prediction criteria

sp

hocking's Sp

References

Mendenhall William and Sinsich Terry, 2012, A Second Course in Statistics Regression Analysis (7th edition). Prentice Hall

Examples

Run this code
# NOT RUN {
model <- lm(mpg ~ disp + hp, data = mtcars)
k <- ols_all_subset(model)
k
# }
# NOT RUN {
# }
# NOT RUN {
# plot
plot(k)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab