covsellmr: CovSel-linear regression model

View source: R/covsellmr.R

covsellmrR Documentation

CovSel-linear regression model

Description

Variable selection for high-dimensionnal data with the COVSEL method (Roger et al. 2011), followed by a linear regression model.

Auxiliary functions

predict Calculates the predictions from the regression model for any new set of variables contained in the selection.

Usage


covsellmr(X, Y, nvar = NULL, Xscaling = c("none", "pareto", "sd")[1], 
Yscaling = c("none", "pareto", "sd")[1], weights = NULL)

## S3 method for class 'Covsellmr'
predict(object, X, ..., nvar = NULL)

Arguments

X

X-data (n, p).

Y

Y-data (n, q).

nvar

Number of variables to select in X.

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 (n, 1) to apply to the training observations. Internally, weights are "normalized" to sum to 1. Default to NULL (weights are set to 1 / n).

object

For the auxiliary functions: A fitted model, output of a call to the main functions.

...

For the auxiliary functions: Optional arguments. Not used.

Value

sel

A dataframe where variable sel shows the column indexes of the variables selected in X.

fm

List of linear regression models, involving 1 to nvar selected explicative variables.

weights

The weights used for the row observations.

References

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.

Examples


n <- 6 ; p <- 4
X <- matrix(rnorm(n * p), ncol = p)
Y <- matrix(rnorm(n * 2), ncol = 2)

sel <- covsellmr(X, Y, nvar = 3)

predict(sel, X, nvar = c(2,3))


rchemo documentation built on June 30, 2026, 5:10 p.m.