| make_target | R Documentation |
Constructs a target matrix suitable for use with rotation = "target"
in esem. Items listed in keys are assigned a target
value of 1 for their primary factor; all other cells are set to
0 (penalised to be near zero) or NA (free, no penalty).
make_target(keys, nitems = NULL, item_names = NULL, cross_loading_value = 0)
keys |
A named list where each element is a vector of item indices
(integers) or item names (characters) that are hypothesised to load
primarily on that factor. Names become factor names.
Example: |
nitems |
Integer. Total number of items. Required when |
item_names |
Optional character vector of item names of length
|
cross_loading_value |
Numeric or |
Hard target (cross_loading_value = 0): Cross-loadings are
penalised toward zero. Use this when you have strong theory.
Soft target (cross_loading_value = NA): Only primary loadings
are targeted; cross-loadings are completely free. Use this when you are
less certain about the zero pattern.
An item can appear in multiple keys entries if it is expected to have
meaningful loadings on more than one factor. In that case its target value
will be 1 for both factors and cross_loading_value elsewhere.
A numeric matrix (items x factors) with row names set to item names
and column names set to factor names from keys.
esem
# Simple 15-item, 3-factor target (integer keys)
tgt <- make_target(
keys = list(Extrav = 1:5, Agree = 6:10, Open = 11:15),
nitems = 15
)
# Named items
tgt2 <- make_target(
keys = list(F1 = c("y1", "y2", "y3"), F2 = c("y4", "y5", "y6")),
item_names = paste0("y", 1:6)
)
# Soft target (cross-loadings free)
tgt_soft <- make_target(
keys = list(F1 = 1:5, F2 = 6:10),
nitems = 10,
cross_loading_value = NA
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.