lmwPcaEffects: PCA on the effect matrices

View source: R/lmwPcaEffects.R

lmwPcaEffectsR Documentation

PCA on the effect matrices

Description

Performs a PCA on each of the effect matrices from the outputs of lmwEffectMatrices. It has an option to determine the method applied: ASCA, APCA or ASCA-E. Combined effects (i.e. linear combinations of original effect matrices) can also be created and decomposed.

Usage

lmwPcaEffects(
  resLmwEffectMatrices,
  method = c("ASCA", "APCA", "ASCA-E"),
  combineEffects = NULL,
  verbose = FALSE
)

Arguments

resLmwEffectMatrices

A resLmwEffectMatrices list from lmwEffectMatrices.

method

The method used to compute the PCA. One of c("ASCA","APCA","ASCA-E").

combineEffects

If not NULL, a list of vectors containing the names of the effects to be combined.

verbose

If TRUE, will display a message with the duration of execution.

Details

The function allows 3 different methods :

ASCA

The PCA is applied directly on the pure effect matrix.

ASCA-E

The PCA is applied directly on the pure effect matrix but scores are updated.

APCA

The PCA is applied on the augmented effect matrix.

The ASCA-E method adds the residuals to the scores. The APCA method adds the residuals to the effect matrix before the PCA.

Value

A list of PCA results from pcaBySvd for each effect matrix. Those results contain :

scores

Scores from the PCA for each principal component.

loadings

Loadings from the PCA for each principal component.

eigval

Eigenvalues of each principal component.

singvar

Singular values of each principal component.

var

Explained variances of each principal component.

cumvar

Cumulated explained variances of each principal component.

original.dataset

Original dataset.

There are also others outputs :

lmwDataList

The initial object: a list of outcomes, design and formula.

effectsNamesUnique

A character vector with the p names of the model terms, each repeated once.

method

The dimension reduction method used: c("ASCA","APCA","ASCA-E").

type3SS

A vector with the type III SS for each model term.

variationPercentages

A vector with the percentage of variance explained by each model term.

Examples

data('UCH')
resLmwModelMatrix = lmwModelMatrix(UCH)
resLmwEffectMatrices = lmwEffectMatrices(resLmwModelMatrix)
resLmwPcaEffects = lmwPcaEffects(resLmwEffectMatrices, method="ASCA-E")

bgovaerts/LMWiRe documentation built on Sept. 17, 2022, 12:32 a.m.