signCorrectionPCA: Sign correction for principal component analysis

Description Usage Arguments Details Value See Also

View source: R/signCorrectionPCA.R

Description

Corrects the sign ambiguity that exists in PCA by correlating scores with the data.

Usage

1

Arguments

data

matrix; The data matrix with samples in the rows and variables in the columns.

loadings

matrix; The loading matrix with variables in the rows and components in the columns.

scores

matrix; The score matrix with samples in the rows and components in the columns.

Details

The sign of the jth component is defined as: sum(cor(scores[, j], data) * loadings[, j]**2))

Value

A list containing the sign corrected loadings and scores.

See Also

prcomp


oliviermfmartin/HelpingHand documentation built on Oct. 10, 2020, 5:59 a.m.