Learn R Programming

PLSbiplot1 (version 0.1)

mod.VIP: The Variable Importance in the Projection (VIP) values

Description

Takes in a set of predictor variables and a set of response variables and gives the VIP values for the predictor variables.

Usage

mod.VIP(X, Y, algorithm = NULL, A, cutoff = NULL, ...)

Arguments

X
A (NxP) predictor matrix
Y
A (NxM) response matrix
A
The number of Partial Least Squares (PLS) components
algorithm
Any of the PLS algorithms ("mod.SIMPLS","mod.NIPALS", "mod.KernelPLS_R", "mod.KernelPLS_L")
cutoff
desired cut off value to use for selecting the important X-variables
...
Other arguments. Currently ignored

Value

The VIP value for each of the X-variables

Examples

Run this code
if(require(chemometrics))
data(cereal, package="chemometrics")
X = as.matrix(cbind(cereal$X))
Y = as.matrix(cbind(cereal$Y))
main2 = mod.VIP(X=X, Y=Y, algorithm=mod.SIMPLS, A=2, cutoff=0.8)
main2
X.new = X[,c(main2$X.impor)]  #important X-variables
X.new

#nutrimouse data
if(require(mixOmics))
data(nutrimouse, package="mixOmics")
X1 = as.matrix(nutrimouse$lipid, ncol=21)
Y1 = as.matrix(nutrimouse$gene, ncol=120)
main = mod.SIMPLS(X=X1, Y=Y1, A=17) #using the SIMPLS algorithm
#RMSEP
RMSEP = main$RMSEP
plot(t(RMSEP), type = "b", xlab="Number of components", ylab="RMSEP  values")
A.final = 9 #from the RMSEP plot
#Final PLSR
mod.SIMPLS(X=X1, Y=Y1, A=A.final)
#VIP
main2 = mod.VIP(X=X1, Y=Y1, algorithm=mod.SIMPLS, A=A.final, cutoff=0.8)
main2
X.new = X1[,c(main2$X.impor)]  #important X-variables
X.new

Run the code above in your browser using DataLab