View source: R/ols-all-possible-regression.R
ols_step_all_possible | R Documentation |
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.
ols_step_all_possible(model, ...)
## Default S3 method:
ols_step_all_possible(model, max_order = NULL, ...)
## S3 method for class 'ols_step_all_possible'
plot(x, model = NA, print_plot = TRUE, ...)
model |
An object of class |
... |
Other arguments. |
max_order |
Maximum subset order. |
x |
An object of class |
print_plot |
logical; if |
ols_step_all_possible
returns an object of class "ols_step_all_possible"
.
An object of class "ols_step_all_possible"
is a data frame containing the
following components:
mindex |
model index |
n |
number of predictors |
predictors |
predictors in the model |
rsquare |
rsquare of the model |
adjr |
adjusted rsquare of the model |
rmse |
root mean squared error 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 |
msep |
estimated MSE of prediction, assuming multivariate normality |
fpe |
final prediction error |
apc |
amemiya prediction criteria |
hsp |
hocking's Sp |
Mendenhall William and Sinsich Terry, 2012, A Second Course in Statistics Regression Analysis (7th edition). Prentice Hall
model <- lm(mpg ~ disp + hp, data = mtcars)
k <- ols_step_all_possible(model)
k
# plot
plot(k)
# maximum subset
model <- lm(mpg ~ disp + hp + drat + wt + qsec, data = mtcars)
ols_step_all_possible(model, max_order = 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.