allReg | R Documentation |
Creates a table of the best subsets of explanatory variables for a response variable.
allReg(x, y, wt = rep(1, nrow(x)), nmax = ncol(x), nbst = 3, na.rm.x = TRUE, lin.dep = 10)
x |
matrix of candidate explanatory variables. |
y |
the response variable. |
wt |
the weight variable if needed. |
nmax |
the maximum number of explanatory variables to include in the largest model. |
nbst |
the number of best models to determine for each subset size. |
na.rm.x |
logical, if |
lin.dep |
a value to protect against linear dependencies; the number of
the number of observations must be greater than the number of columns in
|
A data frame containing these columns:
model.formula |
the subset model formula |
nvars |
the size (number of variables in the subset model |
stderr |
the standard error of the subsbet model |
R2 |
the coefficient of determination for the subset model |
adjr2 |
the adjusted r-squared of the subbset model |
Cp |
Mallow's Cp for the subset model |
press |
the press statistic for the subset model |
This function is a wrapper for the regsubsets
function in the
leaps package.
Helsel, D.R. and Hirsch, R.M., 2002, Statistical methods in
water resources: U.S. Geological Survey Techniques of Water-Resources
Investigations, book 4, chap. A3, 522 p.
Mallow, C.L., 1973, Come comments of Cp: Technometrics, v. 15, p.
661–675.
Miller, A.J., 1990, Subset selection in regression in Monographs on
Statistics and Applied Probability 40: London, Chapman and Hall.
regsubsets
# See the regression vignette for examples .pager <- options("pager") options(pager="console") vignette(package="smwrStats") options(.pager)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.