| covselrda | R Documentation |
Variable selection for high-dimensionnal data with the COVSEL method (Roger et al. 2011), followed by a linear regression model.
The training variable y (univariate class membership) is firstly transformed to a dummy table containing nclas columns, where nclas is the number of classes present in y. Each column is a dummy variable (0/1). Then, a variable selection, based on the COVSEL method, is implemented on the X-data and the dummy table, returning a set of X-variables that are used as dependent variables in a DA model.
- covselrda: A linear regression model predicts the Y-dummy table from the selected X-variables. For a given observation, the final prediction is the class corresponding to the dummy variable for which the prediction is the highest.
- covsellda and covselqda: Probabilistic LDA and QDA are run over the selected X-variables, respectively.
Auxiliary functions
predict Calculates the predictions for any new set of variables contained in the selection.
covselrda(X, y, nvar = NULL, Xscaling = c("none", "pareto", "sd")[1],
Yscaling = c("none", "pareto", "sd")[1], weights = NULL)
covsellda(X, y, nvar = NULL, prior = c("unif", "prop"),
Xscaling = c("none", "pareto", "sd")[1],
Yscaling = c("none", "pareto", "sd")[1], weights = NULL)
covselqda(X, y, nvar = NULL, prior = c("unif", "prop"),
Xscaling = c("none", "pareto", "sd")[1],
Yscaling = c("none", "pareto", "sd")[1], weights = NULL)
## S3 method for class 'Covselrda'
predict(object, X, ..., nvar = NULL)
## S3 method for class 'Covselprobda'
predict(object, X, ..., nvar = NULL)
X |
X-data ( |
y |
Training class membership ( |
nvar |
Number of variables to select in |
prior |
The prior probabilities of the classes. Possible values are "unif" (default; probabilities are set equal for all the classes) or "prop" (probabilities are set equal to the observed proportions of the classes in |
Xscaling |
X variable scaling among "none" (mean-centering only), "pareto" (mean-centering and pareto scaling), "sd" (mean-centering and unit variance scaling). If "pareto" or "sd", uncorrected standard deviation is used. |
Yscaling |
Y variable scaling among "none" (mean-centering only), "pareto" (mean-centering and pareto scaling), "sd" (mean-centering and unit variance scaling). If "pareto" or "sd", uncorrected standard deviation is used. |
weights |
Weights ( |
object |
For the auxiliary functions: A fitted model, output of a call to the main functions. |
... |
For the auxiliary functions: Optional arguments. Not used. |
For covselrda, covselda, covselqda:
sel |
A dataframe where variable |
fm |
List of linear regression or discriminant models, involving 1 to nvar selected explicative variables. |
lev |
classes |
ni |
number of observations in each class |
weights |
The weights used for the row observations. |
For predict.Covselrda, predict.Covselprobda:
pred |
predicted class for each observation |
posterior |
calculated probability of belonging to a class for each observation |
Roger, J.M., Palagos, B., Bertrand, D., Fernandez-Ahumada, E., 2011. CovSel: Variable selection for highly multivariate and multi-response calibration: Application to IR spectroscopy. Chem. Lab. Int. Syst. 106, 216-223.
n <- 6 ; p <- 4
X <- matrix(rnorm(n * p), ncol = p)
y <- c("A","A","B","B","C","C")
sel <- covselrda(X, y, nvar = 3)
predict(sel, X, nvar = c(2,3))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.