ESEM {latentFactoR} | R Documentation |
Estimates Exploratory Structural Equation Model
Description
A general function to estimate an Exploratory Structural
Equation Model (ESEM) using the lavaan
package.
With latentFactoR
objects,
the function requires fewer inputs
Usage
ESEM(
data,
factors,
variables,
estimator = c("MLR", "WLSMV"),
fit_measures = NULL,
variable_polarity = NULL,
wording_factor = c("none", "CTCM1", "CTCM1_each", "RI", "RI_each"),
CTCM1_polarity = c("negative", "positive"),
...
)
Arguments
data |
Numeric matrix, data frame, or |
factors |
Numeric (length = 1). Number of ESEM factors to estimate |
variables |
Numeric (length = 1 or |
estimator |
Character.
Estimator to be used in |
fit_measures |
Character.
Fit measures to be computed using If scaled values are available (not |
variable_polarity |
Numeric/character (length = 1 or total variables).
Whether all (length = 1) or each variable (length = total variables) are
positive ( |
wording_factor |
Character (length = 1).
Whether wording factor(s) should be estimated.
Defaults to
|
CTCM1_polarity |
Character.
Polarity of the CTCM1 wording factor(s).
Defaults to |
... |
Additional arguments to be passed on to
|
Value
Returns a list containing:
model |
Estimated ESEM model |
fit |
Fit measures of estimated ESEM model |
Author(s)
Alexander P. Christensen <alexpaulchristensen@gmail.com>, Luis Eduardo Garrido <luisgarrido@pucmm.edu>
Examples
# Generate factor data
two_factor <- simulate_factors(
factors = 2, # factors = 2
variables = 6, # variables per factor = 6
loadings = 0.55, # loadings between = 0.45 to 0.65
cross_loadings = 0.05, # cross-loadings N(0, 0.05)
correlations = 0.30, # correlation between factors = 0.30
sample_size = 1000, # number of cases = 1000
variable_categories = 5 # 5-point Likert scale
)
## Not run:
# Estimate ESEM model with no wording effects
esem_no_wording_effects <- ESEM(
data = two_factor,
estimator = "WLSMV"
)
# Add wording effects using acquiescence method
two_factor_acquiescence <- add_wording_effects(
lf_object = two_factor,
proportion_negative = 0.50,
proportion_biased_cases = 0.10,
method = "acquiescence"
)
# Estimate ESEM model with wording effects
esem_wording_effects <- ESEM(
data = two_factor_acquiescence,
estimator = "WLSMV",
wording_factor = "RI"
)
## End(Not run)