| sfa_anchor | R Documentation |
Produces an item-by-construct similarity matrix — the embedding analogue of a factor-loading table. Similarities are computed in the raw, un-flipped embedding space: embeddings encode topic, not valence, so a reverse-keyed item is still topically close to its construct and no sign-alignment is applied. Each cell is a belonging strength: high means the item belongs to that construct (for forward and reverse items alike), low means it does not. Read it like a loadings matrix — a well-behaved item is high in its own construct's column and low in the others; an item whose largest value lands on a different construct is a semantic cross-loader and a candidate for review.
sfa_anchor(
x,
anchor = c("centroid", "label", "both"),
labels = NULL,
label_embeddings = NULL,
embed = NULL,
model = NULL
)
x |
An object of class |
anchor |
One of |
labels |
Optional construct labels for the label anchor: either a
character vector (one per construct, in the order of
|
label_embeddings |
Optional precomputed numeric matrix of label
embeddings (one row per construct; named rows are matched to constructs).
Use when the |
embed, model |
Embedding backend and model for the label anchor. Default
to the backend/model recorded on |
Two anchor types are available:
"centroid"(default) Each construct's anchor is the mean of
its own (un-flipped) item embeddings. An item's similarity to its own
construct is computed leave-one-out (the item is excluded from its own
anchor), mirroring a corrected item-total correlation. Self-contained —
needs no construct text and works for any sfa object.
"label"Each construct's anchor is the embedding of the
construct's name (or a richer gloss supplied via labels). Requires
an embedding backend or precomputed label_embeddings. Because it
uses the raw item embeddings, it is independent of the encoding the fit
happened to use.
An object of class "sfa_anchor": a list with the requested
centroid and/or label item-by-construct similarity matrices,
plus constructs, factors, and codes.
Wulff, D. U., & Mata, R. (2025). Semantic embeddings reveal and address taxonomic incommensurability in psychological measurement. Nature Human Behaviour, 9(5), 944–954. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1038/s41562-024-02089-y")}
sfa_simplify, sfa
data(big5)
fit <- sfa(
data.frame(code = big5$codes, item = big5$items,
factor = big5$factors, scoring = big5$scoring),
embeddings = big5$embeddings, scoring = big5$scoring, nfactors = 5)
# item-by-construct belonging matrix (read like a loadings table)
a <- sfa_anchor(fit, anchor = "centroid")
head(round(a$centroid, 2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.