ldecomp {mdatools}R Documentation

Class for storing and visualising linear decomposition of dataset (X = TP' + E)

Description

Creates an object of ldecomp class.

Usage

ldecomp(scores, loadings, residuals, eigenvals, ncomp.selected = ncol(scores))

Arguments

scores

matrix with score values (I x A).

loadings

matrix with loading values (J x A).

residuals

matrix with data residuals (I x J)

eigenvals

vector with eigenvalues for the loadings

ncomp.selected

number of selected components

Details

ldecomp is a general class for storing results of decomposition of dataset in form X = TP' + E. Here, X is a data matrix, T - matrix with scores, P - matrix with loadings and E - matrix with residuals. It is used, for example, for PCA results (pcares), in PLS and other methods. The class also includes methods for calculation of residual distances and explained variance.

There is no need to use the ldecomp manually. For example, when build PCA model with pca or apply it to a new data, the results will automatically inherit all methods of ldecomp.

Value

Returns an object (list) of ldecomp class with following fields:

scores

matrix with score values (I x A).

residuals

matrix with data residuals (I x J).

T2

matrix with score distances (I x A).

Q

matrix with orthogonal distances (I x A).

ncomp.selected

selected number of components.

expvar

explained variance for each component.

cumexpvar

cumulative explained variance.


[Package mdatools version 0.14.1 Index]