subsets(x=, ...) subsets.formula(formula=, data=, weights=rep(1, length(y)), nbest=1, nvmax=8, force.in=NULL, force.out=NULL, intercept=T, method=c("exhaustive", "backward", "forward", "seqrep"), really.big=F) subsets.default(x=, y=, weights=rep(1, length(y)), nbest=1, nvmax=8, force.in=NULL, force.out=NULL, intercept=T, method=c("exhaustive", "backward", "forward", "seqrep"), really.big=F)
formula
| model formula for full model |
data
| Optional data frame |
x
| design matrix with all predictors |
y
| response vector |
weights
| weight vector |
nbest
| number of subsets of each size to record |
nvmax
| maximum size of subsets to examine |
force.in
| index to columns of design matrix that should be in all models |
force.out
| index to columns of design matrix that should be in no models |
intercept
| Add an intercept? |
method
| Use exhaustive search, forward selection, backward selection or sequential replacement to search. |
really.big
| Must be T to performe exhaustive search on more than 50 variables. |
summary.leaps
. If you want to understand the components of this object then read the source.
leaps()
in several ways. The design matrix need not be of full rank. The ability to restrict nvmax
speeds up exhaustive searches considerably. There is no hard-coded limit to the number of variables.
leaps()
, summary.leaps
data(swiss) a<-subsets(as.matrix(swiss[,-1]),swiss[,1]) b<-summary(a)