Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

getMeaningfulPCs

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

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

Calculations and Visualisations Related to Geometric Morphometrics

v2.8
GPL-2
Authors
Stefan Schlager [aut, cre, cph], Gregory Jefferis [ctb], Dryden Ian [cph]
Initial release
2020-02-26

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.