Package 'esem'

Title: Exploratory Structural Equiation Modeling ESEM
Description: The package is developed to support the tutorial on using ESEM with LSAC dataset. The package uses "tidyverse","psych","lavaan","semPlot" package and provide additional functions to conduct ESEM. The package provides general functions to complete ESEM, including esem_c(), creation of target matrix if it is used make_target(), generation of CFA model syntax esem_cfa_syntax(). A sample data is provided. the package include a sample of SDQ LSAC data in sdq_lsac. The package vignette presents the tutorial demonstrating the use of ESEM on SDQ LSAC data
Authors: Maria Prokofieva, Vasileios Stavropoulos, Daniel Zarate
Maintainer: Maria Prokofieva <[email protected]>
License: GPL (>= 3)
Version: 1.0.0
Built: 2024-11-07 05:58:18 UTC
Source: https://github.com/maria-pro/esem

Help Index


Create a referent list

Description

Create a referent list

Usage

create_referent(esem_efa_results)

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 The function uses efa object to identify referents A referent indicator is selected for each factor It is the item that has a large (target) loading for the factor it measures and The referents are used to ensure model identification and are used as starting values/ fixed values in the the next step to create a lavaan model syntax.

Value

A list with factors and corresponding referents (i.e. referents in that factor)

Examples

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

#make exploratory analysis with geomin rotation
esem_efa_results <- esem_efa(hw_data,3)
referent_list <- create_referent(esem_efa_results)

Exploratory Structural Equiation Modeling ESEM (ESEM)

Description

Exploratory Structural Equiation Modeling ESEM (ESEM)

Usage

esem_c(
  data,
  nfactors,
  fm = "ML",
  rotate = "geominT",
  scores = "regression",
  residuals = TRUE,
  Target = NULL,
  missing = TRUE,
  mimic = c("MPlus"),
  std.lv = TRUE,
  ordered = TRUE
)

Arguments

ordered

Confirmatory factor anaysis (CFA) step for ESEM-with-CFA

Description

is a wrapper for lavaan::cfa() function

Usage

esem_cfa(model, data, mimic = c("MPlus"), std.lv = TRUE, ordered = TRUE)

Arguments

model

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

ordered

Title

Description

Title

Title

Usage

esem_cfa_syntax(loadings)

esem_cfa_syntax(loadings)

Arguments

esem_efa

Exploratory Structural Equiation Modeling ESEM (ESEM)

Description

Exploratory Structural Equiation Modeling ESEM (ESEM)

Usage

esem_cfa2(
  data,
  nfactors,
  fm = "ML",
  rotate = "geominT",
  scores = "regression",
  residuals = TRUE,
  Target = NULL,
  missing = TRUE,
  mimic = c("MPlus"),
  std.lv = TRUE,
  ordered = TRUE
)

Arguments

ordered

Exploratory factor analysis (EFA) for ESEM

Description

Exploratory factor analysis (EFA) for ESEM

Usage

esem_efa(
  data,
  nfactors,
  fm = "ML",
  rotate = "geominT",
  scores = "regression",
  residuals = TRUE,
  Target = NULL,
  missing = TRUE
)

Arguments

...

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)

Title

Description

Title

Usage

esem_syntax_keys(key_matrix, fixed)

Arguments

fixed

Create a model syntax for ESEM-with-CFA compatible with MPlus

Description

Create a model syntax for ESEM-with-CFA compatible with MPlus

Usage

esem_syntax_mplus(key_matrix = NULL)

Arguments

key_matrix

is a key matrix with the primary factor items. It can be made with the make.keys() function. The primary factor items in the matrix are used as referent items.

Value

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


Title

Description

Title

Usage

make_target(data, keys)

Arguments

data

is a dataset to be used in EFA

keys

is a key matrix with the primary factor items. It can be made with the make.keys() function. The primary factor items in the matrix are used as referent items.

Value

a list with target matrix


Strengths and Difficulties Questionnaire (SDQ) of the Longitudinal Study of Australian Children (LSAC)

Description

The Longitudinal Study of Australian Children (LSAC) is a major study following the development of 10,000 young people and their families from all parts of Australia. It is conducted in partnership between the Department of Social Services, the Australian Institute of Family Studies and the Australian Bureau of Statistics with advice provided by a consortium of leading researchers.

Usage

sdq_lsac

Details

The study began in 2003 with a representative sample of children from urban and rural areas of all states and territories in Australia. The study has a multi-disciplinary base, and examines a broad range of topics, including parenting, family, peers, education, child care and health.

Data are collected from two cohorts every two years. The first cohort of 5,000 children was aged 0–1 years in 2003–04, and the second cohort of 5,000 children was aged 4–5 years in 2003–04. The full dataset is available here The SDQ is a 25-item instrument for children aged 4-17 years and includes fives scales: the “Hyperactivity,” “Emotional Symptoms,” “Conduct Problems,” “Peer Problems,” and “Prosocial Behaviors”.

The dataset was pre-processed and includes only variables relevant to the original latent variables. The cleaning included:

- reverse coding items s7_1, s11_1, s14_1,  s21_1, s25_1. The reversed variables are named with R in the end: s7_1R, s11_1R, s14_1R,  s21_1R,s25_1R

- the missing data treatment was done is addressed following guidelines of Baraldi & Enders, 2010 and Baraldi & Enders, 2010.

The cases with more than 10 with 5 iterations using multivariate imputations by chained equations approach that is based on Fully Conditional Specification, where each incomplete variable is imputed by a separate model (see Groothuis-Oudshoorn, 2011

Source

https://growingupinaustralia.gov.au/data-and-documentation