esem_syntax: Create a model syntax for ESEM-with-CFA

View source: R/esem_syntax.R

esem_syntaxR Documentation

Create a model syntax for ESEM-with-CFA

Description

Create a model syntax for ESEM-with-CFA

Usage

esem_syntax(esem_efa_results, referent_list = NULL)

Arguments

esem_efa_results

is a psych::fa() object with the results of exploratory factor analysis (EFA) The object can be created using psych::fa() or a wrapper esem_efa() function

referent_list

is a list with latent variables (factors) and their corresponding referent items. referent_list can be generated using create_referent() function. If no referent_list is provided, the list is generated automatically

Value

A character vector with a lavaan syntax for the ESEM model.

Examples

use Holzinger and Swineford (1939) dataset in lavaan package
hw_data <- lavaan::HolzingerSwineford1939
hw_data <- hw_data[,c(7:15)]

esem_efa_results <- esem_efa(hw_data,3)
model_syntax <- esem_syntax(esem_efa_results)
writeLines(model_syntax)

maria-pro/esem documentation built on June 29, 2023, 4:37 p.m.