getMeaningfulPCs: get number of meaningful Principal components

View source: R/PCmeaning.r

getMeaningfulPCsR Documentation

get number of meaningful Principal components

Description

get number of meaningful Principal components

Usage

getMeaningfulPCs(values, n, expect = 2, sdev = FALSE)

Arguments

values

eigenvalues from a PCA

n

sample size

expect

expectation value for chi-square distribution of df=2

sdev

logical: if TRUE, it is assumed that the values are square roots of eigenvalues.

Details

This implements the method suggested by Bookstein (2014, pp. 324), to determine whether a PC is entitled to interpretation. I.e. a PC is regarded meaningful (its direction) if the ratio of this PC and its successor is above a threshold based on a log-likelihood ratio (and dependend on sample size).

Value

tol

threshold of ratio specific for n

good

integer vector specifying the meaningful Principal Components

References

Bookstein, F. L. Measuring and reasoning: numerical inference in the sciences. Cambridge University Press, 2014

See Also

getPCtol

Examples

data(boneData)
proc <- procSym(boneLM)
getMeaningfulPCs(proc$eigenvalues,n=nrow(proc$PCscores))
## the first 3 PCs are reported as meaningful
## show barplot that seem to fit the bill
barplot(proc$eigenvalues)

Morpho documentation built on Feb. 16, 2023, 10:51 p.m.