View source: R/factorability.R
| factorability | R Documentation |
Before extracting a hierarchy, it is worth asking two prior questions:
is this correlation matrix even worth factoring, and is the sample large
enough to trust the answer. factorability() reports the standard
diagnostics for both, one object you can print or pull values from:
KMO – the Kaiser-Meyer-Olkin measure of sampling adequacy, overall
and per variable (via psych::KMO()). It contrasts correlations with
partial correlations: a low value means the variables share little common
variance once other variables are partialled out, so a factor model has
little to recover.
Bartlett's test of sphericity – tests whether the correlation matrix
differs from the identity (via psych::cortest.bartlett()). Needs N; a
non-significant result says the correlations are too weak to factor.
Sample size – N, the number of variables p, and the N:p ratio.
Ledermann bound – the largest number of common factors identifiable
from p variables (a hard limit for EFA/ESEM, though not for PCA).
Read these as conventions, not verdicts. Every cutoff here – Kaiser's
KMO bands, the 5:1 / 10:1 N:p rules of thumb, Bartlett significance at
.05 – is a widely repeated rule of thumb, not a settled threshold, and
each is contested in the methodological literature (the required N in
particular depends on communalities and factor overdetermination far more
than on any fixed ratio; MacCallum et al. 1999). factorability()
deliberately reports the numbers and their conventional bands rather than
returning a pass/fail flag. ackwards() runs the same screen internally and
warns only at the genuinely consequential extreme (KMO < 0.5, N:p < 5).
factorability(data, cor = c("pearson", "spearman", "polychoric"), n_obs = NULL)
data |
A data frame or numeric matrix of item responses, or a
correlation matrix (detected automatically). KMO and Bartlett are computed
on the correlation matrix in the basis you name via |
cor |
The correlation basis to screen on: |
n_obs |
Number of observations. Taken from |
An object of class factorability (a named list): cor, n_obs,
n_vars, np_ratio, kmo_overall, kmo_items (a data frame of per-item
MSA), bartlett (a list of chisq/df/p_value, or NULL when N is
unknown), and ledermann (the bound). Print it for a banded summary; index
the list for the raw values.
Kaiser, H. F. (1974). An index of factorial simplicity. Psychometrika, 39(1), 31–36.
MacCallum, R. C., Widaman, K. F., Zhang, S., & Hong, S. (1999). Sample size in factor analysis. Psychological Methods, 4(1), 84–99.
check_items() (per-item screening), suggest_k() (how many
factors), and comparability() (split-half replicability) – the other
pre-analysis diagnostics; ackwards(), which runs this screen internally.
# Continuous data, Pearson basis
factorability(sim16)
# From a correlation matrix: supply n_obs for the N-based diagnostics
R <- cor(sim16)
factorability(R, n_obs = nrow(sim16))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.