Learn R Programming

nzilbb.vowels (version 0.4.3)

plot_procrustes_loadings: Plot loadings with confidence bands from procrustes_loadings()

Description

[Experimental] Plot index loadings or loadings with confidence intervals and null distributions generated by bootstrapping and permutation followed by Procrustes rotation. This approach works when PC loadings are unstable due to multiple PCs explaining similar amounts of variance. This is an alternative to the use of bootstrapping without Procrustes rotation (as in pca_test()) and avoids the need for the use of the filter_boots argument to plot_loadings().

Usage

plot_procrustes_loadings(proc_loadings, pc_no = 1, loadings_confint = 0.9)

Value

a ggplot object.

Arguments

proc_loadings

a tibble, generated by procrustes_loadings()

pc_no

an integer indicating which PC to plot.

loadings_confint

confidence limits for generated confidence intervals. (default: 0.9 to match pca_test()).

Examples

Run this code
  proc_loadings <- procrustes_loadings(
    pca_data = onze_intercepts |> dplyr::select(-speaker),
    max_pcs = 3,
    index = TRUE,
    n = 10, # set this to at least 100 in actual use.
    scale = TRUE
   )

   plot_procrustes_loadings(proc_loadings, pc_no = 2)

Run the code above in your browser using DataLab