Learn R Programming

plsVarSel (version 0.9.12)

covSel: Covariance Selection - CovSel

Description

Sequential selection of variables based on squared covariance with response and intermediate deflation (as in Partial Least Squares).

Usage

covSel(X, Y, nvar)

Value

selected

an integer vector of selected variables

scores

a matrix of score vectors

loadings

a matrix of loading vectors

Yloadings

a matrix of Y loadings

Arguments

X

matrix of input variables

Y

matrix of response variable(s)

nvar

maximum number of variables

References

J.M. Roger, B. Palagos, D. Bertrand, E. Fernandez-Ahumada. CovSel: Variable selection for highly multivariate and multi-response calibration: Application to IR spectroscopy. Chemom Intel Lab Syst. 2011;106(2):216-223. P. Mishra, A brief note on a new faster covariate's selection (fCovSel) algorithm, Journal of Chemometrics 36(5) 2022.

Examples

Run this code
data(gasoline, package = "pls")
sels <- with(gasoline, covSel(NIR, octane, 5))
matplot(t(gasoline$NIR), type = "l")
abline(v = sels$selected, col = 2)

Run the code above in your browser using DataLab