Error in rhs[[3L]] : subscript out of bounds mtmm.model <- 'mom =~ mqrli + mrins + mhos_drec + mwarm_dad + dad=~ dqrli + drins + dhos_mrec + dwarm_mom + relqual =~ mqrli + mrins + mhos_drec + mwarm_dad + dqrli + drins + dhos_mrec + dwarm_mom + mrins~~ drins' > fit<-cfa(model=mtmm.model) Error in rhs[[3L]] : subscript out of bounds
I am not sure what the error means, or how to fix it. Any help you could give would be greatly appreciated.
In addition, might you also be able to help me figure out how to write syntax to constrain/freely estimate item loadings, factor variances, and constrain factor correlations to zero?
I am trying to replicate this model that runs without issue in Mplus:
mom by mwarm_d* mrins mhos_d mqrli (1);
mom@1;
dad by dwarm_m* drins dhos_m dqrli (2);
dad@1;
qual by mwarm_d mrins mhos_d mqrli dwarm_m drins dhos_m dqrli;
qual;
drins with mrins;
qual with mom @ 0;
qual with dad @ 0;
mom with dad@0;
In words:
there are two reporter factors, with each indicator constrained to be equal within reporter.
reporter factor variances are set to 1.
I am freely estimating variance of overall factor (i.e., qual).
I am constraining covariance of each reporter factor with overall factor to 0.
I also constrain covariance of reporter factors to 0, so that all covariances is explained in overall factor.
residual terms from one indicator for each reporter (rins) are estimated based on modification indices.
Sincere thanks for any help--
RC
Error in rhs[[3L]] : subscript out of bounds.
I never got this message before and all models I fitted before were quite similar. Here is the syntax:
qu1a <- ' aff =~ z2_swls1+ z2_swls2+z2_swls3+z2_swls4+ z2_swls5+ z2_soc6 + z2_soc7+z2_sub_hap1+z2_sub_hap3+z2_pmh10_9+ z2_pmh10_3+ z2_res3+ z2_res10+ z2_soc1+ z2_soc2_um+ z2_soc3_um+ z2_soc4+ z2_soc5_um+z2_pmh10_1+ z2_pmh10_2
OptPess =~ + z2_lotr3+ z2_lotr7+ z2_lotr9+ z2_pmh10_4+ z2_soc5_um
Soz =~ z2_social_sup1+ z2_social_sup2+ z2_social_sup3+z2_social_sup4+ z2_social_sup5+ z2_social_sup6+ z2_social_sup7+ z2_social_sup8+ z2_social_sup9+ z2_social_sup10+
z2_social_sup11+ z2_social_sup12+ z2_social_sup13+z2_social_sup14
Selbstk =~ z2_pmh10_7+ z2_pmh10_8+ z2_res2+ z2_res3 + z2_res7+ z2_res4 + z2_res5+ z2_res11+z2_soc1+z2_pmh10_10+z2
Ziel =~ z2_res1+ z2_res2+z2
Selbstreg =~ z2_res3+ z2_res8+ z2_res9 + z2_pmh10_5 + z2_sub_hap3'
fitqua <- cfa (qu1a, data = g2_z, estimator = "ml")
Does anyone know what`s wrong and how can I fix it!
Thank you for your help!
Kind regards, Angela