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 |
Create a referent list
create_referent(esem_efa_results)
create_referent(esem_efa_results)
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. |
A list with factors and corresponding referents (i.e. referents in that factor)
# 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)
# 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)
esem_c( data, nfactors, fm = "ML", rotate = "geominT", scores = "regression", residuals = TRUE, Target = NULL, missing = TRUE, mimic = c("MPlus"), std.lv = TRUE, ordered = TRUE )
esem_c( data, nfactors, fm = "ML", rotate = "geominT", scores = "regression", residuals = TRUE, Target = NULL, missing = TRUE, mimic = c("MPlus"), std.lv = TRUE, ordered = TRUE )
ordered |
is a wrapper for lavaan::cfa() function
esem_cfa(model, data, mimic = c("MPlus"), std.lv = TRUE, ordered = TRUE)
esem_cfa(model, data, mimic = c("MPlus"), std.lv = TRUE, ordered = TRUE)
model |
is a character vector with a lavaan syntax for the ESEM model. |
ordered |
Title
Title
esem_cfa_syntax(loadings) esem_cfa_syntax(loadings)
esem_cfa_syntax(loadings) esem_cfa_syntax(loadings)
esem_efa |
Exploratory Structural Equiation Modeling ESEM (ESEM)
esem_cfa2( data, nfactors, fm = "ML", rotate = "geominT", scores = "regression", residuals = TRUE, Target = NULL, missing = TRUE, mimic = c("MPlus"), std.lv = TRUE, ordered = TRUE )
esem_cfa2( data, nfactors, fm = "ML", rotate = "geominT", scores = "regression", residuals = TRUE, Target = NULL, missing = TRUE, mimic = c("MPlus"), std.lv = TRUE, ordered = TRUE )
ordered |
Exploratory factor analysis (EFA) for ESEM
esem_efa( data, nfactors, fm = "ML", rotate = "geominT", scores = "regression", residuals = TRUE, Target = NULL, missing = TRUE )
esem_efa( data, nfactors, fm = "ML", rotate = "geominT", scores = "regression", residuals = TRUE, Target = NULL, missing = TRUE )
... |
Create a model syntax for ESEM-with-CFA
esem_syntax(esem_efa_results, referent_list = NULL)
esem_syntax(esem_efa_results, referent_list = NULL)
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 |
A character vector with a lavaan syntax for the ESEM model.
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)
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
esem_syntax_keys(key_matrix, fixed)
esem_syntax_keys(key_matrix, fixed)
fixed |
Create a model syntax for ESEM-with-CFA compatible with MPlus
esem_syntax_mplus(key_matrix = NULL)
esem_syntax_mplus(key_matrix = NULL)
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. |
A character vector with a lavaan syntax for the ESEM model that imitates MPlus.
Title
make_target(data, keys)
make_target(data, keys)
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. |
a list with target matrix
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.
sdq_lsac
sdq_lsac
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
https://growingupinaustralia.gov.au/data-and-documentation