make_target: Create a Target Loading Matrix for Target Rotation

View source: R/target.R

make_targetR Documentation

Create a Target Loading Matrix for Target Rotation

Description

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).

Usage

make_target(keys, nitems = NULL, item_names = NULL, cross_loading_value = 0)

Arguments

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: list(F1 = 1:5, F2 = 6:10, F3 = 11:15).

nitems

Integer. Total number of items. Required when keys uses integer indices and item_names is not supplied.

item_names

Optional character vector of item names of length nitems. When supplied, keys may use either names or indices. Becomes the row names of the target matrix.

cross_loading_value

Numeric or NA. Value assigned to cells that are not the primary factor. Use 0 (default) to penalise cross-loadings toward zero, or NA to leave them completely free (soft target rotation).

Details

Target vs. Soft Target Rotation

  • 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.

Items Loading on Multiple Factors

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.

Value

A numeric matrix (items x factors) with row names set to item names and column names set to factor names from keys.

See Also

esem

Examples

# 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
)


bifactory documentation built on Oct. 28, 2026, 1:06 a.m.