Learn R Programming

mdatools (version 0.7.0)

ldecomp: Linear decomposition of data

Description

Creates an object of ldecomp class.

Usage

ldecomp(scores = NULL, loadings = NULL, residuals = NULL, totvar, tnorm = NULL, ncomp.selected = NULL, T2 = NULL, Q = NULL, cal = TRUE)

Arguments

scores
matrix with score values (nobj x ncomp).
loadings
matrix with loading values (nvar x ncomp).
residuals
matrix with data residuals
totvar
full variance of original data, preprocessed and centered
tnorm
singular values for score normalization
ncomp.selected
number of selected components
T2
matrix with calculated T2 values (e.g. for CV)
Q
matrix with calculated Q statistic (e.g. for CV)
cal
logical, true if data is for calibration of a LDECOMP based model

Value

Returns an object (list) of ldecomp class with following fields:
scores
matrix with score values (nobj x ncomp).
residuals
matrix with data residuals (nobj x nvar).
T2
matrix with T2 distances (nobj x ncomp).
Q
matrix with Q statistic (nobj x ncomp).
tnorm
vector with singular values used for scores normalization.
ncomp.selected
selected number of components.
expvar
explained variance for each component.
cumexpvar
cumulative explained variance.
modpower
modelling power of variables.

Details

ldecomp is a general class for decomposition 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 and plotting residuals, variances, and so on.

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.