| autoplot.suggest_k | R Documentation |
Renders a ggplot2 diagnostic for a suggest_k object. The plot shows one
panel for each criterion group that was requested: Scree/PA (if "pa_pc" or
"pa_fa" were requested), MAP (if "map"), VSS (if "vss"), and CD RMSE
(if "cd" and EFAtools was available). When four panels are shown the
layout is a 2x2 grid; otherwise a single-column layout is used. The
recommended k for each criterion is marked with a star-shaped point.
## S3 method for class 'suggest_k'
autoplot(object, ...)
object |
A |
... |
Ignored. |
The scree panel shows both PC and FA observed eigenvalues alongside their respective random-data thresholds (for whichever PA bases were requested). PA-PC compares the blue "Observed (PC)" line to the dashed PA-PC threshold; PA-FA compares the teal "Observed (FA)" line to the dotted PA-FA threshold.
The CD panel plots the mean RMSE between observed and comparison-data
eigenvalues at each k. CD uses a sequential one-sided Wilcoxon test
(Ruscio & Roche, 2012): a factor is retained while adding it significantly
reduces RMSE (default \alpha = 0.30); the starred k is the last
retained factor. The curve is shown only over the levels that were actually
computed; the starred k need not be the visible minimum of the plotted curve.
Requires the ggplot2 package.
A ggplot object.
suggest_k()
if (requireNamespace("ggplot2", quietly = TRUE)) {
sk <- suggest_k(sim16, n_iter = 5)
autoplot(sk)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.