explained_variance: Calculation of explained variance

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/explained_variance.R

Description

This function calculates the variance explained by variates.

Usage

1
explained_variance(data, variates, ncomp)

Arguments

data

numeric matrix of predictors

variates

variates as obtained from a pls object for instance

ncomp

number of components. Should be lower than the number of columns of variates

Details

explained_variance calculates the explained variance of each variates out of the total variance in data.

Value

explained_variance simply returns the explained variance for each variate.

Author(s)

Florian Rohart

See Also

spls, splsda, plotIndiv, plotVar, cim, network.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
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

## End(Not run)

ajabadi/mixOmics2 documentation built on Aug. 9, 2019, 1:08 a.m.