explained_variance {mixOmics} | R Documentation |
This function calculates the variance explained by variates.
explained_variance(data, variates, ncomp)
data |
numeric matrix of predictors |
variates |
variates as obtained from a |
ncomp |
number of components. Should be lower than the number of columns of |
explained_variance
calculates the explained variance of each variates out of the total variance in data
.
explained_variance
simply returns the explained variance for each variate.
Florian Rohart
spls
, splsda
,
plotIndiv
, plotVar
,
cim
, network
.
data(liver.toxicity) X <- liver.toxicity$gene Y <- liver.toxicity$clinic toxicity.spls <- spls(X, Y, ncomp = 2, keepX = c(50, 50), keepY = c(10, 10)) ex = explained_variance(toxicity.spls$X, toxicity.spls$variates$X, ncomp =2) # ex should be the same as toxicity.spls$explained_variance$X