| top_items | R Documentation |
Returns, per level and factor, the items whose absolute loading meets or
exceeds cut, sorted by descending absolute loading. This gives a concise
reading of "what each factor is about" without printing a full item-by-factor
matrix, which does not scale well to large k or many items.
top_items(
x,
level = NULL,
cut = 0.3,
n = NULL,
sort = TRUE,
by = c("factor", "item"),
show_labels = TRUE
)
x |
An |
level |
Integer vector selecting which level(s) to include. |
cut |
Absolute-loading threshold. Items with |
n |
Maximum number of items to show per factor. |
sort |
Logical. When |
by |
One of |
show_labels |
Logical. When |
Loadings are signed and reflect the object's primary-parent sign alignment
(see ackwards()). Items near the cut threshold may appear for one sign
orientation but not the other; this is expected and informative.
If factor labels have been attached, the factor
dimension is shown as label (id) wherever it appears – the group headers
under by = "factor" and the body entries under by = "item".
An object of class "top_items". Print it for a grouped cli listing.
The underlying data frame (one row per selected item) is accessible via
$data and contains columns level, factor, item, and loading (plus
label when labels are available). The values equal the corresponding
tidy(x, what = "loadings") rows (after filtering and optional sorting).
tidy.ackwards(), label_template(), set_factor_labels(),
autoplot.ackwards()
# Fit the raw dataset (not na.omit(), which would drop the column
# attributes): bfi25's IPIP item labels are then captured and printed as
# `code: label`. `missing = "listwise"` handles the NAs cleanly. A 10-item
# subset keeps the example fast; use all items in practice.
x <- ackwards(bfi25[, 1:10], k_max = 3, cor = "polychoric", missing = "listwise")
top_items(x)
top_items(x, level = 3, cut = 0.4, n = 5)
# Invert the grouping to read cross-loadings item-by-item
top_items(x, level = 3, cut = 0.25, by = "item")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.