TITLE(leaps @@ all-subsets regressopm)
USAGE(
leaps(x=, y=, wt=rep(1, NROW(x)), int=TRUE, method=c("Cp", "adjr2", "r2"), nbest=10, names=NULL, df=NROW(x), strictly.compatible=T)
)
ALIAS(leaps)
ARGUMENTS(
ARG(x @@ A matrix of predictors  )
ARG(y @@ A response vector )
ARG(wt @@ Optional weight vector )
ARG(int @@ Add an intercept to the model )
ARG(method @@ Calculate Cp, adjusted R-squared or R-squared  )
ARG(nbest @@ Number of subsets of each size to report )
ARG(names @@ vector of names for columns of LANG(x)  )
ARG(df @@ Total degrees of freedom to use instead of LANG(nrow(x)) in calculating Cp and adjusted R-squared)
ARG(strictly.compatible @@ Implement misfeatures of leaps() in S )
)
DESCRIPTION(
leaps() performs an exhaustive search for the best subsets of the variables in x for predicting y in linear regression, using an efficient branch-and-bound algorithm.  LANG(LINK(subsets)) does the same thing better.
)
VALUES(
A list with components
@@
ARG(which @@ logical matrix. Each row can be used to select the columns of LANG(x) in the respective model)
ARG(size @@ Number of variables, including intercept if any, in the model)
ARG(cp @@ or LANG(adjr2) or LANG(r2) is the value of the chosen model selectionstatistic for each model)
ARG(label @@ vector of names for the columns of x)
)
REFERENCES(
Alan Miller "Subset Selection in Regression" Chapman & Hall
S documentation for LANG(leaps())
)
NOTE(
With LANG(strictly.compatible=T) the function will stop with an error if LANG(x) is not of full rank or if it has more than 31 columns. It will ignore the column names of LANG(x) even if LANG(names==NULL) and will replace them with "0" to "9", "A" to "Z".
)

SEEALSO(
LANG(LINK(subsets)), LANG(LINK(subsets.formula)), LANG(LINK(subsets.default)), LANG(LINK(summary.leaps))
)
EXAMPLES(
x<-matrix(rnorm(100),ncol=4)
y<-rnorm(25)
leaps(x,y)
)
