varimportance: Variables importance

Description Usage Arguments Value See Also Examples

Description

This function computes for a given regression method ("linreg", "pcr", "plsr", "ridge","sir", "rf", ) the importance of the covariates by estimating the response variable with some perturbations of the covariates and computing the error due to these perturbations. The variable importance (VI) of a covariate is the mean square error (MSE) when the values of this variable are randomly permuted. Covariates with higher VI are then more important to predict the response variable. This procedure is replicated several times giving several values of VI for each covariate. The original MSE (with no perturbation of the data) is also performed for comparison purpose.

Usage

1
varimportance(X, Y, method = "linreg", nperm = 10)

Arguments

X

a numerical matrix containing the p variables in the model.

Y

a numerical response vector.

method

a regression method ("linreg", "sir", "rf", "pcr", "plsr", "ridge").

nperm

the number of random perturbations to perform the importance of the covariates (VI).

Value

An object with S3 class "varimportance" and the following components:

mat_imp

a matrix of dimension nperm times p with the VI values for each permuation (in rows) and each covariate (un column).

base_imp

the original mean square error.

See Also

plot.varimportance, select.varimportance, choicemod

Examples

1
2
3
4
5
6
7
data("simus")
X <- simus$X
Y <- simus$Y1
imp <- varimportance(X, Y, method = "linreg", nperm=15)
plot(imp)
imp$mat_imp
apply(imp$mat_imp,2,mean)

chavent/modvarsel documentation built on May 22, 2019, 2:22 p.m.