model_RSE <- '
pos_items =~ Q1 + Q2 + Q4 + Q6 + Q7
neg_items =~ Q3_R + Q5_R + Q8_R + Q9_R + Q10_R '
Factorial_Invariance(model = model_RSE, data = data_RSE_sex,
group = 'gender', estimator = 'ML')
# \donttest{
# run Factorial_Invariance for an ESEM model
# first, use the ESEM function to obtain the esem_model_syntax (without the group variable, gender)
esem_output <- ESEM(data = subset(data_RSE_sex, select = -c(gender)), Nfactors = 2)
Factorial_Invariance(model = esem_output$esem_model_syntax, data = data_RSE_sex,
group = 'gender', estimator = 'ML')
# }
Run the code above in your browser using DataLab