Description Usage Arguments Details Value Author(s) References See Also Examples
View source: R/explained_variance.R
This function calculates the variance explained by their own variates (components) based on redundancy.
1 | 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 variance explained by each variate / component and
divides by the total variance in data
using the definition of 'redundancy'. This applies to
any component-based approaches.
Variance explained by component t_h in X for dimension h:
Rd(X, t_h) = \frac{1}{p} ∑_{j = 1}^p \mbox{cor}^2(X^j, t_h)
where X^j is the variable centered and scaled, p is the total number of variables.
explained_variance
returns the explained variance for
each variate.
Florian Rohart, Kim-Anh Lê Cao, Al J Abadi
Tenenhaus, M., La Régression PLS théorie et pratique (1998). Technip, Paris, chap2.
spls
, splsda
, plotIndiv
,
plotVar
, cim
, network
.
1 2 3 4 5 6 7 8 9 10 | 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
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.