--
You received this message because you are subscribed to the Google Groups "lavaan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lavaan+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/lavaan/a7d3530b-ea8e-418b-8e8d-2add9089476dn%40googlegroups.com.
sam_esem_res <- sam(model = model,
data = data_ex,
mm.list = list(teacher = c("Teacher_autonomy", "Teacher_competence", "Teacher_relatedness"),
self = c("Self_Meaning", "Self_Confidence", "Intrinsic_Motivation"),
Quit = "Intent_to_Quit"),
mm.args = list(estimator = "MLR"),
struc.args = list(estimator = "ML"),
sam.method = "local",
std.lv = TRUE,
rotation = "geomin",
rotation.args = list(geomin.epsilon = 0.001),
output = "lavaan")
lavInspect(sam_esem_res, what = "est")$psi Tchr_t Tchr_c Tchr_r Slf_Mn Slf_Cn Intr_M Int__Q Teacher_autonomy 0.715 Teacher_competence 0.385 0.884 Teacher_relatedness 0.385 0.385 0.772 Self_Meaning 0.000 0.000 0.000 1.164 Self_Confidence 0.000 0.000 0.000 0.385 1.082 Intrinsic_Motivation 0.000 0.000 0.000 0.385 0.385 0.661 Intent_to_Quit 0.000 0.000 0.000 0.000 0.000 0.000 0.598
Summary Information Structural part: chisq df cfi rmsea srmr 94.131 5 0.802 0.257 0.185
##Set-ESEM with sem(): sem_esem_res <- sem(model = model, data = data_ex, estimator = "MLR",
std.lv = TRUE,
rotation = "geomin",
rotation.args = list(geomin.epsilon = 0.001))
lavInspect(sem_esem_res, what = "est")$psi Tchr_t Tchr_c Tchr_r Slf_Mn Slf_Cn Intr_M Int__Q Teacher_autonomy 1.000 Teacher_competence 0.741 1.000 Teacher_relatedness 0.664 0.598 1.000 Self_Meaning 0.000 0.000 0.000 1.000 Self_Confidence 0.000 0.000 0.000 0.173 1.000 Intrinsic_Motivation 0.000 0.000 0.000 0.070 0.266 1.000 Intent_to_Quit 0.000 0.000 0.000 0.000 0.000 0.000 1.000
##CFA with sam():
model_cfa <- '
##Measurement
#Block 1
Teacher_autonomy =~ T_autonomy1 + T_autonomy2 + T_autonomy3
Teacher_competence =~ T_competence1 + T_competence2 + T_competence3
Teacher_relatedness =~ T_relatedness1 + T_relatedness2 + T_relatedness3
#Block 2
Self_Meaning =~ S_meaning1 + S_meaning2 + S_meaning3
Self_Confidence =~ S_confidence1 + S_confidence2 + S_confidence3
Intrinsic_Motivation =~ S_Intrinsic1 + S_Intrinsic2 + S_Intrinsic3
#Block 3
Intent_to_Quit =~ Intent_to_withdraw1 + Intent_to_withdraw2 + Intent_to_withdraw3 + Intent_to_withdraw4 + Intent_to_withdraw5
##Structural part
Self_Meaning ~ Teacher_autonomy + Teacher_competence + Teacher_relatedness
Self_Confidence ~ Teacher_autonomy + Teacher_competence + Teacher_relatedness
Intrinsic_Motivation ~ Teacher_autonomy + Teacher_competence + Teacher_relatedness
Intent_to_Quit ~ Self_Meaning + Self_Confidence + Intrinsic_Motivation +
Teacher_autonomy + Teacher_competence + Teacher_relatedness
##Covariance between block 2 factors Self_Meaning ~~ Self_Confidence + Intrinsic_Motivation Self_Confidence ~~ Intrinsic_Motivation ' sam_cfa_res <- sam(model = model_cfa,
data = data_ex,
mm.list = list(teacher = c("Teacher_autonomy", "Teacher_competence", "Teacher_relatedness"),
self = c("Self_Meaning", "Self_Confidence", "Intrinsic_Motivation"),
Quit = "Intent_to_Quit"),
mm.args = list(estimator = "MLR"),
struc.args = list(estimator = "ML"),
sam.method = "local",
std.lv = TRUE,
output = "lavaan")
lavInspect(sam_cfa_res, what = "est")$psi Tchr_t Tchr_c Tchr_r Slf_Mn Slf_Cn Intr_M Int__Q Teacher_autonomy 1.000 Teacher_competence 0.764 1.000 Teacher_relatedness 0.794 0.655 1.000 Self_Meaning 0.000 0.000 0.000 0.837 Self_Confidence 0.000 0.000 0.000 0.201 0.892 Intrinsic_Motivation 0.000 0.000 0.000 0.054 0.200 0.411 Intent_to_Quit 0.000 0.000 0.000 0.000 0.000 0.000 0.588 Summary Information Structural part: chisq df cfi rmsea srmr 0 0 1 0 0 Moreover, when fitting multigroup set-ESEM with sam(), the error message mentioned in my first post returns again. Example : sam_res <- sam(model = struct, data = df_treat, mm.list = list(ML = c("f1","f2","f3","f4"), #ESEM block FWC = "FWC"), #Outcome mm.args = list(estimator = "MLR", rotation = "geomin", rotation.args = list(geomin.epsilon = 0.001)),
struc.args = list(estimator = "ML"),
group = "D01", #grouping variable (2 categories)
sam.method = "local",
output = "lavaan",
std.lv = TRUE)Best regards,
Nathan
To view this discussion visit https://groups.google.com/d/msgid/lavaan/CAAngqrL%3Dn6Za%3DJejJeMdneBJ_zmOBhPHwMzMkV%3DbPUWank72ZA%40mail.gmail.com.