| sfa_parallel | R Documentation |
Determines the number of factors to retain from an embedding similarity matrix using random unit vectors as the null distribution, avoiding the need for a participant-level sample size.
sfa_parallel(
sim_matrix,
embeddings,
n_iter = 100L,
percentile = 95,
seed = 42L
)
sim_matrix |
Numeric similarity matrix (n_items x n_items). |
embeddings |
Numeric embedding matrix (n_items x embedding_dim). |
n_iter |
Number of random iterations (default 100). |
percentile |
Percentile of null eigenvalues to use as threshold (default 95). |
seed |
Random seed, used via |
The adaptation keeps Horn's (1965) logic — retain leading eigenvalues that
exceed those of structureless data of the same size — but replaces the
respondent-level null with similarity matrices of random Gaussian unit
vectors in the item count and embedding dimension of the data. Retention
follows Horn's sequential rule: leading eigenvalues are counted until the
first falls at or below its null percentile (against the 95th null
percentile by default, a common modern choice; Horn compared against the
null mean). Two caveats follow from the
null. First, random unit vectors in a high-dimensional space are nearly
orthogonal, so the null similarity matrix is near-identity and the
eigenvalue thresholds concentrate just above one. Second, the null carries
none of the general positive similarity component that real item embeddings
share, so it is a structureless baseline, not a matched one. Benchmarking
on embedding similarity matrices, Garrido et al. (2025) found conventional
parallel analysis systematically overextracted; corroborate retention with
the other criteria in sfa_nfactors().
A list with components:
Integer: suggested number of factors.
Numeric vector: observed eigenvalues (descending).
Numeric vector: threshold eigenvalues from the null.
Horn, J. L. (1965). A rationale and test for the number of factors in factor analysis. Psychometrika, 30(2), 179–185.
Garrido, L. E., Russell-Lasalandra, L. L., & Golino, H. (2025). Estimating dimensional structure in generative psychometrics: Comparing PCA and network methods using large language model item embeddings. PsyArXiv preprint. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.31234/osf.io/2s7pw_v1")}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.