# 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
)
if (FALSE) {
# 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"
)}
Run the code above in your browser using DataLab