ord_pca: PCA with randomization test

Description Usage Arguments Details Value References See Also Examples

Description

Principal components analysis with randomization test for stopping rules.

Usage

1
ord_pca(x, B = 999, ...)

Arguments

x

array, where rows = SUs and cols = variables such as environmental or traits values

B

numeric, number of randomizations

...

further arguments passed to other methods

Details

PCA with stopping rules based on RndLambda, RndF, AvgRnd, or broken-stick (Peres-Neto et al. 2005). The current implementation hard-codes the cross-products matrix as a correlation matrix (i.e., data are scaled and centered).

Value

List containing items returned by 'stats::prcomp', appended with further items:
- eig: eigenvalues.
- varexpl: proportion of variance explained.
- cumvar: cumulative variance explained.
- V: matrix of correlations between variables and the PCA scores.
- tab: table of randomization results by PCA axis.
- stopping: number of suggested dimensions, based on different stopping rules.

References

Peres-Neto, P.R., D.A. Jackson, and K.M. Somers. 2005. How many principal components? stopping rules for determining the number of non-trivial axes revisited. Computational Statistics and Data Analysis 49:974–997.

See Also

prcomp

Examples

1
2
3
4
5
6
data(smoky)
pc <- ord_pca(smoky$env)                    # PCA with randomization
plot(pc$x, type='n', asp=1) ; text(pc$x, cex=0.7)  # plot first two axes
head(pc$tab)                                # better format than `summary()`
pc$stopping                                 # number of dimensions
pc$V                                        # V = correlations with PC axes

phytomosaic/ecole documentation built on Jan. 2, 2022, 11:24 p.m.