Hi All,
Any help with how to obtain the prior predictive check in blavaan? I followed these steps on the
ecmerkle page, but receive the following two errors:
Stan model 'stanmarg' does not contain samples.
AND:
> bfit3 <- bsem(b3, data = osf, std.lv=TRUE, prisamp = T)
Error in eval(mc, parent.frame()) :
Exception: mismatch in dimension declared and found in context; processing stage=data initialization; variable name=YXbar; position=0; dims declared=(16,12); dims found=(1,12) (in 'string', line 513, column 2 to column 60)
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
Here is my full model:
b3 <- '
RT1 =~
prior("normal(0.81, .30)")*CRT1 +
prior("normal(0.50, .30)")*BBS1 +
prior("normal(0.72, .30)")*BRN1 +
prior("normal(0.37, .30)")*WAS1
# Time 2: Reflective Thinking
RT2 =~
prior("normal(0.81, .30)")*CRT2 +
prior("normal(0.81, .30)")*CRT4 +
prior("normal(0.81, .30)")*CRTv +
prior("normal(0.50, .30)")*BBS2 +
prior("normal(0.72, .30)")*BRN2 +
prior("normal(0.37, .30)")*WAS2
# Regression
RT2 ~ c*trt + prior("normal(0.65, .40)")*RT1 + prior("normal(0.35, .15)")*logDT + b*logDT
logDT ~ prior("normal(0.22, .20)")*trt + a*trt
# Estimated/Generated Quantities
IndirectEffect_ab := a*b
TotalEffect := (a*b)+c
# Correlated Uniqueness
BRN1 ~~ BRN2
WAS1 ~~ WAS2
BBS1 ~~ BBS2
CRT1 ~~ CRT2
'
#_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
The error occurs without the indirect effects, as well.
Thank you for any help you can offer!
Best,
Gabe