| suggest_k | R Documentation |
Runs complementary factor-retention criteria and reports their
recommendations. No single criterion is definitive; the goal is a consensus
range to inform your choice of k in ackwards().
suggest_k(
data,
k_max = NULL,
criteria = c("pa_pc", "pa_fa", "map", "vss", "cd"),
cor = "pearson",
n_obs = NULL,
n_iter = 20L,
seed = NULL,
...
)
data |
A data frame or numeric matrix (items in columns, observations in
rows). Alternatively, a pre-computed correlation matrix may be supplied
(a square, symmetric, numeric matrix with unit diagonal). When a
correlation matrix is supplied, |
k_max |
Maximum number of factors/components to evaluate when
recommending a depth – not a depth itself. Defaults to
|
criteria |
Character vector of criteria to compute. Any subset of
|
cor |
Correlation basis: |
n_obs |
Number of observations. Required when |
n_iter |
Number of Monte Carlo iterations for parallel analysis. Default
|
seed |
Integer seed passed to |
... |
Reserved for future arguments. |
Criteria available (controlled by the criteria argument):
PA-PC ("pa_pc") – Horn (1965) parallel analysis on PC eigenvalues.
Compares observed eigenvalues to those from random correlation matrices;
suggests retaining components whose eigenvalues exceed the 95th percentile
of chance. Tends to overextract; treat as an upper bound.
PA-FA ("pa_fa") – Horn (1965) parallel analysis using common-factor
eigenvalues. More conservative than PA-PC and the better match for the EFA
and ESEM engines in ackwards(). Shares one psych::fa.parallel() call
with PA-PC.
MAP ("map") – Velicer (1976) Minimum Average Partial criterion.
Finds the k that minimises the average squared partial correlation
remaining after extracting k components. Usually conservative. Shares one
psych::vss() call with VSS.
VSS ("vss") – Revelle & Rocklin (1979) Very Simple Structure fit
at complexities 1 and 2 (VSS-1 and VSS-2). Finds the k maximising the
fit of a very simple loading structure. Shares one psych::vss() call
with MAP.
CD ("cd") – Ruscio & Roche (2012) Comparison Data. Resamples from
the observed item distributions to generate comparison eigenvalue profiles;
retains factors until adding one no longer improves RMSE beyond chance.
Requires the EFAtools package (install separately). Skipped with an
informational message when EFAtools is absent or when a correlation
matrix is supplied.
PA (both bases), MAP, and VSS share the same correlation matrix as
ackwards(). CD operates on the raw data matrix directly (required for
resampling).
An object of class "suggest_k". Print it for a formatted summary;
call autoplot() on it for a diagnostic scree/criteria plot. The list
contains:
k_parallel_pc |
Recommended k from PC-based parallel analysis
( |
k_parallel_fa |
Recommended k from FA-based parallel analysis
( |
k_map |
Recommended k from MAP ( |
k_vss1 |
Recommended k from VSS complexity-1 ( |
k_vss2 |
Recommended k from VSS complexity-2 ( |
k_cd |
Recommended k from Comparison Data ( |
cd_available |
Logical; |
criteria |
Data frame with one row per k: |
criteria_requested |
Character vector of the criteria that were requested (and therefore computed). |
k_max, n_obs, n_vars, cor |
Metadata. |
k in ackwards() is a maximum depth, not a claim that exactly k
factors exist. Users commonly set k one or two levels above the consensus to
watch higher-level factors fragment – this is a feature of the method, not
overextraction.
Treating retention estimates as a range rather than a verdict has direct
support in the parallel-analysis literature: Lim and Jahng (2019) recommend
interpreting the PA estimate as a range of roughly plus or minus one factor,
resolved by interpretability, and Achim (2021) argues that even that
overstates PA's precision – the disagreement itself is why suggest_k()
reports several criteria and a consensus range, never a single number.
suggest_k() screens on the Pearson or Spearman basis by design and never
computes polychoric correlations itself, so when the raw data look ordinal
(at most 7 distinct integer values per column) it emits a one-per-session
warning – the same detect_ordinal() signal ackwards() and
comparability() use (Invariant 6: announce consequential defaults loudly).
Crucially, the advice points at the final ackwards() fit
(cor = "polychoric"), not at suggest_k() itself: the screening basis
is intentional. The plausible-k range is robust to the Pearson-vs-polychoric
choice, so screening on Pearson and fitting the final model polychoric is the
recommended workflow – computing polychoric correlations at the screening
stage would only add cost and NPD risk without changing the range. The
warning is skipped for correlation-matrix input (there are no items to
inspect).
PA-PC in particular tends to recommend more factors than replicate across independent samples, especially with correlated items (Forbes, 2023). This is a long-standing observation in practice: Saucier (1997, footnote 14) reported parallel analysis suggesting as many as 30 factors in wide lexical item sets. PA-FA and CD are more conservative. Treat the full set of criteria as a range: the true k is likely somewhere in the middle.
Achim, A. (2021). Determining the number of factors using parallel analysis and its recent variants: Comment on Lim and Jahng (2019). Psychological Methods, 26(1), 69–73. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1037/met0000269")}
Forbes, M. K. (2023). Improving hierarchical models of individual differences: An extension of Goldberg's bass-ackward method. Psychological Methods. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1037/met0000546")}
Horn, J. L. (1965). A rationale and test for the number of factors in factor analysis. Psychometrika, 30, 179–185.
Lim, S., & Jahng, S. (2019). Determining the number of factors using parallel analysis and its recent variants. Psychological Methods, 24(4), 452–467. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1037/met0000230")}
Revelle, W., & Rocklin, T. (1979). Very simple structure: An alternative procedure for estimating the optimal number of interpretable factors. Multivariate Behavioral Research, 14(4), 403–414.
Ruscio, J., & Roche, B. (2012). Determining the number of factors to retain in an exploratory factor analysis using comparison data of a known factorial structure. Psychological Assessment, 24(2), 282–292.
Saucier, G. (1997). Effects of variable selection on the factor structure of person descriptors. Journal of Personality and Social Psychology, 73(6), 1296–1312. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1037/0022-3514.73.6.1296")}
Velicer, W. F. (1976). Determining the number of components from the matrix of partial correlations. Psychometrika, 41, 321–327.
ackwards(); factorability(), check_items(), and
comparability(), the other pre-analysis diagnostics.
sk <- suggest_k(sim16)
sk
autoplot(sk)
# Run only MAP (fast; skips parallel analysis and CD)
suggest_k(sim16, criteria = "map")
# Run only the parallel-analysis criteria
suggest_k(sim16, criteria = c("pa_pc", "pa_fa"), n_iter = 5)
# Faster exploratory run
suggest_k(sim16, k_max = 6, n_iter = 5)
# Correlation-matrix input (CD is skipped; n_obs required)
R <- cor(sim16)
suggest_k(R, n_obs = nrow(sim16))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.