generate_cfc_lavaan_syntax: Generate lavaan Syntax for Compositional Forced-Choice (CFC)...

View source: R/generate_cfc_lavaan_syntax.R

generate_cfc_lavaan_syntaxR Documentation

Generate lavaan Syntax for Compositional Forced-Choice (CFC) Models

Description

Generates the syntax required to fit a continuous Compositional Forced-Choice model (log-ratio differences of utilities) in lavaan, strictly adhering to Brown's (2016) formulation.

Usage

generate_cfc_lavaan_syntax(
  n_blocks,
  block_size,
  key_matrix,
  trait_col,
  key_col,
  cor_matrix = NULL,
  force_positive_variances = TRUE
)

Arguments

n_blocks

Integer. Number of blocks.

block_size

Integer. Number of items per block.

key_matrix

A data.frame indicating item trait and item sign.

trait_col

Character string. The name of the column in key_matrix indicating the trait measured by the item.

key_col

Character string. The name of the column in key_matrix indicating the keying direction of the item (e.g., positive/negative).

cor_matrix

Optional matrix. Starting values for trait correlations.

force_positive_variances

Logical. If TRUE, prevents Heywood cases by forcing the utility uniquenesses to be > 0.001. Defaults to TRUE.

Value

A character string containing the lavaan model syntax.


autoFC documentation built on July 14, 2026, 5:07 p.m.