Learn R Programming

Morpho (version 2.12)

getMeaningfulPCs: get number of meaningful Principal components

Description

get number of meaningful Principal components

Usage

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

Value

tol

threshold of ratio specific for n

good

integer vector specifying the meaningful Principal Components

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).

References

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

See Also

getPCtol

Examples

Run this code
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)

Run the code above in your browser using DataLab