perm_ci.pca | R Documentation |
Perform a permutation test to assess the significance of variance explained by PCA components.
## S3 method for class 'pca'
perm_ci(x, X, nperm = 100, k = 4, distr = "gamma", parallel = FALSE, ...)
x |
A PCA object from |
X |
The original data matrix used for PCA. |
nperm |
Number of permutations. |
k |
Number of components (beyond the first) to test. Default tests up to |
distr |
Distribution to fit to the permutation results ("gamma", "norm", or "empirical"). |
parallel |
Logical, whether to use parallel processing for permutations. |
... |
Additional arguments passed to |
The function computes a statistic F_a
for each component a
, representing the fraction
of variance explained relative to the remaining components. It then uses permutations of
the preprocessed data to generate a null distribution. The first component uses the full data;
subsequent components are tested by partialing out previously identified components and
permuting the residuals.
By default, a gamma distribution is fit to the permuted values to derive CIs and p-values.
If distr="empirical"
, it uses empirical quantiles instead.
A list containing:
The observed F_a values for tested components.
A matrix of permuted F-values. Each column corresponds to a component.
A list of fit objects or NULL if empirical chosen.
Computed confidence intervals for each component.
p-values for each component.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.