Dear all,
I am running a metric measurement invariance analysis and have run into an error message I don't understand. I am copying the code and error message below.
CODE:
factorBSI <- '
Somatization=~ BSI_2+BSI_7+ BSI_23+ BSI_29+ BSI_30+ BSI_33+ BSI_37
ObsessionCompulsion=~ BSI_5+ BSI_15+ BSI_26+ BSI_27+ BSI_32+ BSI_36
InterpersonalSensitivity=~ BSI_20+ BSI_21+ BSI_22+ BSI_42
Depression=~ BSI_9+BSI_16+ BSI_17+ BSI_18+ BSI_35+ BSI_50
Anxiety=~ BSI_1+ BSI_12+ BSI_19+ BSI_38+ BSI_45+ BSI_49
Hostility=~ BSI_6+ BSI_13+ BSI_40+ BSI_41 +BSI_46
PhobicAnxiety=~ BSI_8+ BSI_28+ BSI_31+ BSI_43+ BSI_47
ParanoidIdeation=~ BSI_4+ BSI_10+ BSI_24+ BSI_48 +BSI_51
Psychoticism=~ BSI_3+ BSI_14+ BSI_34+ BSI_44+ BSI_53
'
fit2 <- bcfa(factorBSI, data = P_study_items_prepared_for_analysisBezrecod,
n.chains = 2,
burnin = 10000,
sample = 10000,
inits = "prior",
group = "Country", group.equal = "loadings")
Error message:
Error in eval(mc, parent.frame()) :
Exception: model_stanmarg_namespace::model_stanmarg: v10[2][10] is 0, but must be greater than or equal to 1.000000 (in 'string', line 629, column 2 to column 38)
failed to create the sampler; sampling not done
Computing post-estimation metrics (including lvs if requested)...
Stan model 'stanmarg' does not contain samples.
Error in rowvec[samppar] <- which(grepl(stanvec[j], names(b.est)) & !(grepl("_c\\[", :
replacement has length zero
Kind regards,
Nikola Ćirović