PCA.selection: Select an optimal number of components using PCA

Description Usage Arguments Value Author(s) Examples

Description

Selects the optimal number of components from data using PCA. There are four different criteria available: accumulated variance explained, individual explained variance of each component, absolute value of variability or fixed number of components.

Usage

1
PCA.selection(Data, fac.sel, varthreshold=NULL, nvar=NULL, PCnum=NULL)

Arguments

Data

Data matrix (with samples in columns and features in rows)

fac.sel

Selection criteria ("%accum", "single%", "rel.abs", "fixed.num")

varthreshold

Threshold for "%accum" or "single%" criteria

nvar

Threshold for "rel.abs"

PCnum

Fixed number of components for "fixed.num"

Value

List containing:

PCAres

List containing results of PCA, with fields "eigen", "var.exp", "scores" and "loadings"

numComps

Number of components selected

Author(s)

Patricia Sebastian Leon

Examples

1
2
3
data(STATegRa_S3)
ps <- PCA.selection(Data=Block2.PCA, fac.sel="single%", varthreshold=0.03)
ps$numComps

llrs/STATegRa documentation built on May 29, 2019, 3:42 a.m.