qselection {FWDselect} | R Documentation |
Selecting variables for several subset sizes
Description
Function that enables to obtain the best variables for more than one size of subset. Returns a table with the chosen covariates to be introduced into the models and their information criteria. Additionally, an asterisk is shown next to the size of subset which minimizes the information criterion.
Usage
qselection(x, y, qvector, criterion = "deviance", method = "lm",
family = "gaussian", nfolds = 5, cluster = TRUE, ncores = NULL)
Arguments
x |
A data frame containing all the covariates. |
y |
A vector with the response values. |
qvector |
A vector with more than one variable-subset size to be selected. |
criterion |
The information criterion to be used.
Default is the deviance. Other functions provided
are the coefficient of determination ( |
method |
A character string specifying which regression method is used,
i.e., linear models ( |
family |
A description of the error distribution and link function to be
used in the model: ( |
nfolds |
Number of folds for the cross-validation procedure, for
|
cluster |
A logical value. If |
ncores |
An integer value specifying the number of cores to be used
in the parallelized procedure. If |
Value
q |
A vector of subset sizes. |
criterion |
A vector of Information criterion values. |
selection |
Selected variables for each size. |
Author(s)
Marta Sestelo, Nora M. Villanueva and Javier Roca-Pardinas.
See Also
Examples
library(FWDselect)
data(diabetes)
x = diabetes[ ,2:11]
y = diabetes[ ,1]
obj2 = qselection(x, y, qvector = c(1:9), method = "lm", criterion = "variance", cluster = FALSE)
obj2