Description Usage Arguments Value Author(s) Examples
Main function for selecting the best subset of q variables. Note that the selection procedure can be used with lm, glm or gam functions.
1 2 3 
x 
A data frame containing all the covariates. 
y 
A vector with the response values. 
q 
An integer specifying the size of the subset of variables to be selected. 
prevar 
A vector containing the number of the best subset of

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: ( 
seconds 
A logical value. By default, 
nmodels 
Number of secondary models to be returned. 
nfolds 
Number of folds for the crossvalidation procedure, for

cluster 
A logical value. If 
ncores 
An integer value specifying the number of cores to be used
in the parallelized procedure. If 
Best model 
The best model. If 
Variable name 
Names of the variable. 
Variable number 
Number of the variables. 
Information criterion 
Information criterion used and its value. 
Prediction 
The prediction of the best model. 
Marta Sestelo, Nora M. Villanueva and Javier RocaPardinas.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17  library(FWDselect)
data(diabetes)
x = diabetes[ ,2:11]
y = diabetes[ ,1]
obj1 = selection(x, y, q = 1, method = "lm", criterion = "variance", cluster = FALSE)
obj1
# second models
obj11 = selection(x, y, q = 1, method = "lm", criterion = "variance",
seconds = TRUE, nmodels = 2, cluster = FALSE)
obj11
# prevar argument
obj2 = selection(x, y, q = 2, method = "lm", criterion = "variance", cluster = FALSE)
obj2
obj3 = selection(x, y, q = 3, prevar = obj2$Variable_numbers,
method = "lm", criterion = "variance", cluster = FALSE)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.