efa_cfa_syntax: Write confirmatory factor analysis syntax

View source: R/Syntax-Functions.R

efa_cfa_syntaxR Documentation

Write confirmatory factor analysis syntax

Description

Uses the factor loadings matrix, presumably from an exploratory factor analysis, to generate lavaan compatible confirmatory factory analysis syntax.

Usage

efa_cfa_syntax(
  loadings,
  simple = TRUE,
  threshold = NA,
  single.item = c("keep", "drop", "none"),
  identified = TRUE,
  constrain0 = FALSE
)

Arguments

loadings

matrix of factor loadings

simple

logical; Should the simple structure be returned (default)? If FALSE, items can cross-load on multiple factors.

threshold

numeric between 0 and 1 indicating the minimum (absolute) value of the loading for an item on a factor. Must be specified when simple = FALSE

single.item

character indicating how single-item factors should be treated. Use "keep" (default) to keep them in the model when generating the CFA syntax, "drop" to remove them, or "none" indicating the CFA syntax should not be generated for this model and "" will be returned.

identified

logical; Should identification check for rotational uniqueness a la Millsap (2001) be performed?

constrain0

logical; Should variable(s) with all loadings below threshold still be included in model syntax? If TRUE, variable(s) will load onto first factor with the loading constrained to 0.

Examples

loadings <- matrix(c(rep(.2, 3), rep(.6, 3), rep(.8, 3), rep(.3, 3)), ncol = 2)
efa_cfa_syntax(loadings) # simple structure
efa_cfa_syntax(loadings, simple = FALSE, threshold = .25) # allow cross-loadings


kfa documentation built on March 18, 2022, 5:26 p.m.