NA MargLogLik and low BGammaHat

323 views
Skip to first unread message

Yuanyuan Hu

unread,
Mar 28, 2023, 12:32:13 PM3/28/23
to blavaan
Hi,

I am fitting Bayesian RI-CLPMs with two variables (Enj, Eff, measured at 13 timepoints), two covariates (preTest, preEnj, measured at the beginning), two outcomes (postTest, game, measured at the end), and two dummy variables (3 groups: group0 is the reference of group1 and group2). The main research question is whether there are group differences on Enj, Eff, preTest, and game.

Some issues:
1.  MargLogLik value is NA. What does this mean and how should I proceed?
2.  BGammaHat .865, which is below .900, is quite different from BCFI .918. What could be the reason? How to increase the model fit? 
3. When looking at the output, are there any other things that I need to worry?

fit.RICLPMpoCogEnjEff <- '
# mediator
RIEnj ~ a1*group1 + a2*group2

# direct Effect
RIEff ~ c11*group1 + c12*group2
postTest ~ c21*group1 + c22*group2
game ~ c31*group1 + c32*group2

# add group (use group0 as reference)
preTest ~ f1*group1 + f2*group2
preEnj ~ e1*group1 + e2*group2

# add outcomes z2
# Residual variance and covariance z2
postTest ~~ postTest
game ~~ game
game ~~ postTest

# add regression
postTest ~ preTest
game ~ preTest

# add covariates z1
# 1b) Regression of random intercepts on time-invariant predictor z1
RIEnj ~ preEnj
RIEff ~ preTest

# Residual variance and covariance z1
preEnj ~~ preEnj
preTest ~~ preTest
preEnj ~~ preTest

# Create between components (random intercepts)
RIEnj =~ 1*Enj1+1*Enj2+1*Enj3+1*Enj4+1*Enj5+1*Enj6+1*Enj7+1*Enj8+1*Enj9+1*Enj10+1*Enj11+1*Enj12+1*Enj13
RIEff =~ 1*Eff1+1*Eff2+1*Eff3+1*Eff4+1*Eff5+1*Eff6+1*Eff7+1*Eff8+1*Eff9+1*Eff10+1*Eff11+1*Eff12+1*Eff13

# Create within-person centered variables
wEnj1=~ 1*Enj1
wEnj2=~ 1*Enj2
wEnj3=~ 1*Enj3
wEnj4=~ 1*Enj4
wEnj5=~ 1*Enj5
wEnj6=~ 1*Enj6
wEnj7=~ 1*Enj7
wEnj8=~ 1*Enj8
wEnj9=~ 1*Enj9
wEnj10=~ 1*Enj10
wEnj11=~ 1*Enj11
wEnj12=~ 1*Enj12
wEnj13=~ 1*Enj13

wEff1=~ 1*Eff1
wEff2=~ 1*Eff2
wEff3=~ 1*Eff3
wEff4=~ 1*Eff4
wEff5=~ 1*Eff5
wEff6=~ 1*Eff6
wEff7=~ 1*Eff7
wEff8=~ 1*Eff8
wEff9=~ 1*Eff9
wEff10=~ 1*Eff10
wEff11=~ 1*Eff11
wEff12=~ 1*Eff12
wEff13=~ 1*Eff13

# Estimate lagged Effects between within-person centered variables
# auto-regression Effect
wEnj2 ~ wEnj1
wEnj3 ~ wEnj2
wEnj4 ~ wEnj3
wEnj5 ~ wEnj4
wEnj6 ~ wEnj5
wEnj7 ~ wEnj6
wEnj8 ~ wEnj7
wEnj9 ~ wEnj8
wEnj10 ~ wEnj9
wEnj11 ~ wEnj10
wEnj12 ~ wEnj11
wEnj13 ~ wEnj12

wEff2 ~ wEff1
wEff3 ~ wEff2
wEff4 ~ wEff3
wEff5 ~ wEff4
wEff6 ~ wEff5
wEff7 ~ wEff6
wEff8 ~ wEff7
wEff9 ~ wEff8
wEff10 ~ wEff9
wEff11 ~ wEff10
wEff12 ~ wEff11
wEff13 ~ wEff12

#cross-lagged Effects
wEff2 ~ wEnj1
wEff3 ~ wEnj2
wEff4 ~ wEnj3
wEff5 ~ wEnj4
wEff6 ~ wEnj5
wEff7 ~ wEnj6
wEff8 ~ wEnj7
wEff9 ~ wEnj8
wEff10 ~ wEnj9
wEff11 ~ wEnj10
wEff12 ~ wEnj11
wEff13 ~ wEnj12

wEnj2 ~ wEff1
wEnj3 ~ wEff2
wEnj4 ~ wEff3
wEnj5 ~ wEff4
wEnj6 ~ wEff5
wEnj7 ~ wEff6
wEnj8 ~ wEff7
wEnj9 ~ wEff8
wEnj10 ~ wEff9
wEnj11 ~ wEff10
wEnj12 ~ wEff11
wEnj13 ~ wEff12

# Estimate covariance between within-person centered variables at first wave
wEnj1 ~~ wEff1  # Covariance
# Estimate covariances between residuals of within-person centered variables
# (i.e., innovations)
 wEnj2 ~~ wEff2
 wEnj3 ~~ wEff3
 wEnj4 ~~ wEff4
 wEnj5 ~~ wEff5
 wEnj6 ~~ wEff6
 wEnj7 ~~ wEff7
 wEnj8 ~~ wEff8
 wEnj9 ~~ wEff9
 wEnj10 ~~ wEff10
 wEnj11 ~~ wEff11
 wEnj12 ~~ wEff12
 wEnj13 ~~ wEff13

# Estimate variance and covariance of random intercepts
RIEnj ~~ RIEnj
RIEff ~~ RIEff
RIEff ~~ RIEnj

# Estimate (residual) variance of within-person centered variables
wEnj1 ~~ wEnj1 # Variances
wEff1 ~~ wEff1
wEnj2 ~~ wEnj2 # Residual variances
wEnj3 ~~ wEnj3
wEnj4 ~~ wEnj4
wEnj5 ~~ wEnj5
wEnj6 ~~ wEnj6
wEnj7 ~~ wEnj7
wEnj8 ~~ wEnj8
wEnj9 ~~ wEnj9
wEnj10 ~~ wEnj10
wEnj11 ~~ wEnj11
wEnj12 ~~ wEnj12
wEnj13 ~~ wEnj13

wEff2 ~~ wEff2
wEff3 ~~ wEff3
wEff4 ~~ wEff4
wEff5 ~~ wEff5
wEff6 ~~ wEff6
wEff7 ~~ wEff7
wEff8 ~~ wEff8
wEff9 ~~ wEff9
wEff10 ~~ wEff10
wEff11 ~~ wEff11
wEff12 ~~ wEff12
wEff13 ~~ wEff13
'
fit.RICLPMpoCogEnjEff <- blavaan(fit.RICLPMpoCogEnjEff, data=dat,target = "stan",
                                 n.chains = 2, burnin = 200, sample = 1500, bcontrol = list(cores = 4),
                                 mcmcfile = TRUE) # add test ="none" to speed up
summary(fit.RICLPMpoCogEnjEff)
## fit null model to calculate CFI, TLI, and NFI
bnull.modelEnjEff <- lav_partable_independence(fit.RICLPMpoCogEnjEff)
fit_bnullEnjEff <- blavaan(bnull.modelEnjEff, data = dat, target = "stan",
                           n.chains = 2, burnin = 200, sample = 1500, bcontrol = list(cores = 4), mcmcfile = TRUE)
modelfitEnjEff <- blavFitIndices(fit.RICLPMpoCogEnjEff, pD = c("loo", "waic","dic"), baseline.model = fit_bnullEnjEff)


> summary(modelfitEnjEff,prob=.95)

Posterior summary statistics and highest posterior density (HPD) 95% credible intervals for devm-based fit indices:

               EAP Median   MAP    SD lower upper
BRMSEA       0.081  0.081 0.081 0.002 0.077 0.085
BGammaHat    0.865  0.865 0.866 0.006 0.854 0.877
adjBGammaHat 0.800  0.800 0.801 0.009 0.783 0.818
BMc          0.288  0.288 0.290 0.019 0.254 0.327
BCFI         0.918  0.918 0.919 0.004 0.910 0.927
BTLI         0.889  0.889 0.890 0.006 0.878 0.900
BNFI         0.843  0.844 0.844 0.004 0.837 0.851

> summary(fit.RICLPMpoCogEnjEff)
blavaan (0.4-7) results of 1500 samples after 200 adapt/burnin iterations

  Number of observations                           131

  Number of missing patterns                         3

  Statistic                                 MargLogLik         PPP
  Value                                             NA       0.000
Latent Variables:
                   Estimate  Post.SD pi.lower pi.upper     Rhat    Prior      
  RIEnj =~                                                                    
    Enj1              1.000                                                    
    Enj2              1.000                                                    
    Enj3              1.000                                                    
    Enj4              1.000                                                    
    Enj5              1.000                                                    
    Enj6              1.000                                                    
    Enj7              1.000                                                    
    Enj8              1.000                                                    
    Enj9              1.000                                                    
    Enj10             1.000                                                    
    Enj11             1.000                                                    
    Enj12             1.000                                                    
    Enj13             1.000                                                    
  RIEff =~                                                                    
    Eff1              1.000                                                    
    Eff2              1.000                                                    
    Eff3              1.000                                                    
    Eff4              1.000                                                    
    Eff5              1.000                                                    
    Eff6              1.000                                                    
    Eff7              1.000                                                    
    Eff8              1.000                                                    
    Eff9              1.000                                                    
    Eff10             1.000                                                    
    Eff11             1.000                                                    
    Eff12             1.000                                                    
    Eff13             1.000                                                    
  wEnj1 =~                                                                    
    Enj1              1.000                                                    
  wEnj2 =~                                                                    
    Enj2              1.000                                                    
  wEnj3 =~                                                                    
    Enj3              1.000                                                    
  wEnj4 =~                                                                    
    Enj4              1.000                                                    
  wEnj5 =~                                                                    
    Enj5              1.000                                                    
  wEnj6 =~                                                                    
    Enj6              1.000                                                    
  wEnj7 =~                                                                    
    Enj7              1.000                                                    
  wEnj8 =~                                                                    
    Enj8              1.000                                                    
  wEnj9 =~                                                                    
    Enj9              1.000                                                    
  wEnj10 =~                                                                    
    Enj10             1.000                                                    
  wEnj11 =~                                                                    
    Enj11             1.000                                                    
  wEnj12 =~                                                                    
    Enj12             1.000                                                    
  wEnj13 =~                                                                    
    Enj13             1.000                                                    
  wEff1 =~                                                                    
    Eff1              1.000                                                    
  wEff2 =~                                                                    
    Eff2              1.000                                                    
  wEff3 =~                                                                    
    Eff3              1.000                                                    
  wEff4 =~                                                                    
    Eff4              1.000                                                    
  wEff5 =~                                                                    
    Eff5              1.000                                                    
  wEff6 =~                                                                    
    Eff6              1.000                                                    
  wEff7 =~                                                                    
    Eff7              1.000                                                    
  wEff8 =~                                                                    
    Eff8              1.000                                                    
  wEff9 =~                                                                    
    Eff9              1.000                                                    
  wEff10 =~                                                                    
    Eff10             1.000                                                    
  wEff11 =~                                                                    
    Eff11             1.000                                                    
  wEff12 =~                                                                    
    Eff12             1.000                                                    
  wEff13 =~                                                                    
    Eff13             1.000                                                    

Regressions:
                   Estimate  Post.SD pi.lower pi.upper     Rhat    Prior      
  RIEnj ~                                                                      
    group1    (a1)    0.173    0.158   -0.148    0.480    1.003    normal(0,10)
    group2    (a2)   -0.156    0.178   -0.515    0.188    1.002    normal(0,10)
  RIEff ~                                                                      
    group1   (c11)   -0.153    0.341   -0.827    0.506    1.000    normal(0,10)
    group2   (c12)    0.455    0.387   -0.295    1.215    1.000    normal(0,10)
  postTest ~                                                                  
    group1   (c21)   -0.835    0.581   -1.995    0.303    1.000    normal(0,10)
    group2   (c22)   -0.468    0.685   -1.811    0.874    1.000    normal(0,10)
  game ~                                                                      
    group1   (c31)    1.113    0.605   -0.125    2.266    1.000    normal(0,10)
    group2   (c32)   -0.077    0.709   -1.457    1.330    1.000    normal(0,10)
  preTest ~                                                                    
    group1    (f1)    0.178    0.532   -0.827    1.233    1.000    normal(0,10)
    group2    (f2)   -0.690    0.600   -1.828    0.499    1.001    normal(0,10)
  preEnj ~                                                                    
    group1    (e1)    0.334    0.187   -0.035    0.704    1.000    normal(0,10)
    group2    (e2)    0.221    0.216   -0.204    0.647    1.000    normal(0,10)
  postTest ~                                                                  
    preTest           0.674    0.100    0.474    0.876    1.000    normal(0,10)
  game ~                                                                      
    preTest           0.426    0.105    0.219    0.627    1.000    normal(0,10)
  RIEnj ~                                                                      
    preEnj            0.517    0.078    0.362    0.669    1.000    normal(0,10)
  RIEff ~                                                                      
    preTest          -0.208    0.056   -0.317   -0.097    1.001    normal(0,10)
  wEnj2 ~                                                                      
    wEnj1             0.329    0.101    0.128    0.520    0.999    normal(0,10)
  wEnj3 ~                                                                      
    wEnj2             0.292    0.094    0.100    0.479    1.001    normal(0,10)
  wEnj4 ~                                                                      
    wEnj3             0.148    0.106   -0.063    0.356    1.000    normal(0,10)
  wEnj5 ~                                                                      
    wEnj4             0.376    0.115    0.149    0.596    1.000    normal(0,10)
  wEnj6 ~                                                                      
    wEnj5             0.432    0.096    0.239    0.619    1.000    normal(0,10)
  wEnj7 ~                                                                      
    wEnj6             0.321    0.120    0.088    0.563    1.000    normal(0,10)
  wEnj8 ~                                                                      
    wEnj7             0.448    0.089    0.273    0.625    1.000    normal(0,10)
  wEnj9 ~                                                                      
    wEnj8             0.604    0.110    0.375    0.813    0.999    normal(0,10)
  wEnj10 ~                                                                    
    wEnj9             0.529    0.079    0.370    0.681    0.999    normal(0,10)
  wEnj11 ~                                                                    
    wEnj10            0.522    0.080    0.362    0.673    1.000    normal(0,10)
  wEnj12 ~                                                                    
    wEnj11            0.721    0.090    0.539    0.895    1.000    normal(0,10)
  wEnj13 ~                                                                    
    wEnj12            0.668    0.081    0.516    0.822    1.001    normal(0,10)
  wEff2 ~                                                                      
    wEff1             0.666    0.064    0.542    0.792    1.000    normal(0,10)
  wEff3 ~                                                                      
    wEff2             0.581    0.085    0.408    0.746    1.000    normal(0,10)
  wEff4 ~                                                                      
    wEff3             0.461    0.071    0.320    0.592    1.000    normal(0,10)
  wEff5 ~                                                                      
    wEff4             0.377    0.107    0.160    0.582    1.000    normal(0,10)
  wEff6 ~                                                                      
    wEff5             0.253    0.101    0.048    0.447    0.999    normal(0,10)
  wEff7 ~                                                                      
    wEff6             0.302    0.106    0.090    0.509    1.000    normal(0,10)
  wEff8 ~                                                                      
    wEff7             0.268    0.128    0.012    0.514    1.000    normal(0,10)
  wEff9 ~                                                                      
    wEff8             0.473    0.082    0.307    0.627    1.000    normal(0,10)
  wEff10 ~                                                                    
    wEff9             0.356    0.124    0.099    0.587    1.001    normal(0,10)
  wEff11 ~                                                                    
    wEff10            0.233    0.113    0.003    0.444    1.000    normal(0,10)
  wEff12 ~                                                                    
    wEff11            0.180    0.147   -0.129    0.442    1.000    normal(0,10)
  wEff13 ~                                                                    
    wEff12            0.224    0.099    0.021    0.409    1.002    normal(0,10)
  wEff2 ~                                                                      
    wEnj1             0.036    0.113   -0.191    0.264    0.999    normal(0,10)
  wEff3 ~                                                                      
    wEnj2             0.277    0.140    0.009    0.563    1.000    normal(0,10)
  wEff4 ~                                                                      
    wEnj3             0.292    0.133    0.024    0.550    1.000    normal(0,10)
  wEff5 ~                                                                      
    wEnj4             0.479    0.164    0.158    0.799    1.000    normal(0,10)
  wEff6 ~                                                                      
    wEnj5             0.053    0.149   -0.237    0.345    1.000    normal(0,10)
  wEff7 ~                                                                      
    wEnj6             0.126    0.143   -0.157    0.409    1.001    normal(0,10)
  wEff8 ~                                                                      
    wEnj7            -0.478    0.143   -0.764   -0.204    1.000    normal(0,10)
  wEff9 ~                                                                      
    wEnj8            -0.285    0.121   -0.531   -0.052    1.000    normal(0,10)
  wEff10 ~                                                                    
    wEnj9            -0.135    0.128   -0.393    0.112    1.000    normal(0,10)
  wEff11 ~                                                                    
    wEnj10           -0.131    0.149   -0.427    0.152    1.000    normal(0,10)
  wEff12 ~                                                                    
    wEnj11           -0.284    0.190   -0.659    0.088    1.000    normal(0,10)
  wEff13 ~                                                                    
    wEnj12           -0.026    0.144   -0.301    0.254    1.000    normal(0,10)
  wEnj2 ~                                                                      
    wEff1            -0.039    0.053   -0.141    0.065    1.000    normal(0,10)
  wEnj3 ~                                                                      
    wEff2             0.008    0.055   -0.101    0.117    1.000    normal(0,10)
  wEnj4 ~                                                                      
    wEff3             0.015    0.055   -0.097    0.121    0.999    normal(0,10)
  wEnj5 ~                                                                      
    wEff4             0.015    0.073   -0.127    0.167    1.000    normal(0,10)
  wEnj6 ~                                                                      
    wEff5             0.007    0.064   -0.121    0.133    1.000    normal(0,10)
  wEnj7 ~                                                                      
    wEff6             0.083    0.084   -0.078    0.247    1.000    normal(0,10)
  wEnj8 ~                                                                      
    wEff7             0.047    0.074   -0.100    0.197    1.000    normal(0,10)
  wEnj9 ~                                                                      
    wEff8            -0.085    0.072   -0.228    0.054    1.000    normal(0,10)
  wEnj10 ~                                                                    
    wEff9            -0.182    0.069   -0.317   -0.043    0.999    normal(0,10)
  wEnj11 ~                                                                    
    wEff10           -0.031    0.058   -0.144    0.082    0.999    normal(0,10)
  wEnj12 ~                                                                    
    wEff11            0.000    0.064   -0.128    0.125    1.000    normal(0,10)
  wEnj13 ~                                                                    
    wEff12           -0.115    0.052   -0.214   -0.015    1.000    normal(0,10)

Covariances:
                   Estimate  Post.SD pi.lower pi.upper     Rhat    Prior      
 .postTest ~~                                                                  
   .game              2.933    0.781    1.550    4.623    1.000       beta(1,1)
 .preTest ~~                                                                  
   .preEnj            0.218    0.199   -0.163    0.627    0.999       beta(1,1)
  wEnj1 ~~                                                                    
    wEff1             0.004    0.110   -0.221    0.219    1.000       beta(1,1)
 .wEnj2 ~~                                                                    
   .wEff2            -0.085    0.059   -0.205    0.027    0.999       beta(1,1)
 .wEnj3 ~~                                                                    
   .wEff3            -0.044    0.065   -0.172    0.083    1.000       beta(1,1)
 .wEnj4 ~~                                                                    
   .wEff4            -0.060    0.055   -0.170    0.043    1.001       beta(1,1)
 .wEnj5 ~~                                                                    
   .wEff5             0.011    0.061   -0.112    0.134    1.000       beta(1,1)
 .wEnj6 ~~                                                                    
   .wEff6            -0.094    0.056   -0.205    0.015    0.999       beta(1,1)
 .wEnj7 ~~                                                                    
   .wEff7            -0.214    0.070   -0.364   -0.083    1.000       beta(1,1)
 .wEnj8 ~~                                                                    
   .wEff8            -0.194    0.070   -0.339   -0.065    1.000       beta(1,1)
 .wEnj9 ~~                                                                    
   .wEff9            -0.063    0.049   -0.158    0.026    1.000       beta(1,1)
 .wEnj10 ~~                                                                    
   .wEff10           -0.128    0.057   -0.245   -0.021    0.999       beta(1,1)
 .wEnj11 ~~                                                                    
   .wEff11           -0.062    0.054   -0.167    0.038    0.999       beta(1,1)
 .wEnj12 ~~                                                                    
   .wEff12            0.006    0.065   -0.121    0.136    1.000       beta(1,1)
 .wEnj13 ~~                                                                    
   .wEff13           -0.005    0.063   -0.130    0.118    1.000       beta(1,1)
 .RIEnj ~~                                                                    
   .RIEff            -0.021    0.110   -0.242    0.196    0.999       beta(1,1)

Intercepts:
                   Estimate  Post.SD pi.lower pi.upper     Rhat    Prior      
   .Enj1              1.603    0.265    1.073    2.123    1.001    normal(0,32)
   .Enj2              1.571    0.266    1.040    2.085    1.001    normal(0,32)
   .Enj3              1.472    0.265    0.948    1.989    1.001    normal(0,32)
   .Enj4              1.273    0.263    0.748    1.774    1.001    normal(0,32)
   .Enj5              1.092    0.264    0.569    1.596    1.001    normal(0,32)
   .Enj6              1.091    0.264    0.568    1.607    1.001    normal(0,32)
   .Enj7              1.181    0.266    0.662    1.687    1.001    normal(0,32)
   .Enj8              1.257    0.265    0.737    1.760    1.001    normal(0,32)
   .Enj9              1.319    0.267    0.780    1.834    1.001    normal(0,32)
   .Enj10             1.174    0.266    0.649    1.693    1.001    normal(0,32)
   .Enj11             1.052    0.264    0.530    1.575    1.001    normal(0,32)
   .Enj12             1.145    0.267    0.606    1.663    1.001    normal(0,32)
   .Enj13             1.244    0.266    0.709    1.756    1.001    normal(0,32)
   .Eff1              6.028    0.441    5.176    6.873    1.001    normal(0,32)
   .Eff2              6.135    0.442    5.287    6.982    1.001    normal(0,32)
   .Eff3              5.965    0.438    5.106    6.810    1.001    normal(0,32)
   .Eff4              6.488    0.434    5.635    7.337    1.001    normal(0,32)
   .Eff5              6.596    0.433    5.736    7.452    1.002    normal(0,32)
   .Eff6              6.568    0.430    5.707    7.386    1.001    normal(0,32)
   .Eff7              6.517    0.434    5.665    7.350    1.002    normal(0,32)
   .Eff8              6.228    0.439    5.345    7.089    1.001    normal(0,32)
   .Eff9              6.138    0.435    5.279    6.993    1.001    normal(0,32)
   .Eff10             6.123    0.436    5.265    6.970    1.001    normal(0,32)
   .Eff11             6.681    0.434    5.832    7.521    1.001    normal(0,32)
   .Eff12             6.242    0.436    5.395    7.086    1.001    normal(0,32)
   .Eff13             7.030    0.435    6.193    7.886    1.001    normal(0,32)
   .postTest          4.160    0.755    2.647    5.631    1.000    normal(0,32)
   .game              7.611    0.790    6.044    9.166    0.999    normal(0,32)
   .preTest           5.954    0.410    5.171    6.733    1.001    normal(0,32)
   .preEnj            2.777    0.149    2.493    3.062    1.000    normal(0,32)
   .RIEnj             0.000                                                    
   .RIEff             0.000                                                    
    wEnj1             0.000                                                    
   .wEnj2             0.000                                                    
   .wEnj3             0.000                                                    
   .wEnj4             0.000                                                    
   .wEnj5             0.000                                                    
   .wEnj6             0.000                                                    
   .wEnj7             0.000                                                    
   .wEnj8             0.000                                                    
   .wEnj9             0.000                                                    
   .wEnj10            0.000                                                    
   .wEnj11            0.000                                                    
   .wEnj12            0.000                                                    
   .wEnj13            0.000                                                    
    wEff1             0.000                                                    
   .wEff2             0.000                                                    
   .wEff3             0.000                                                    
   .wEff4             0.000                                                    
   .wEff5             0.000                                                    
   .wEff6             0.000                                                    
   .wEff7             0.000                                                    
   .wEff8             0.000                                                    
   .wEff9             0.000                                                    
   .wEff10            0.000                                                    
   .wEff11            0.000                                                    
   .wEff12            0.000                                                    
   .wEff13            0.000                                                    

Variances:
                   Estimate  Post.SD pi.lower pi.upper     Rhat    Prior      
   .postTest          7.959    1.010    6.273   10.173    0.999 gamma(1,.5)[sd]
   .game              8.697    1.118    6.838   11.161    1.000 gamma(1,.5)[sd]
   .preEnj            0.789    0.101    0.621    1.011    1.000 gamma(1,.5)[sd]
   .preTest           6.324    0.772    4.999    7.999    1.000 gamma(1,.5)[sd]
   .RIEnj             0.459    0.075    0.331    0.631    1.000 gamma(1,.5)[sd]
   .RIEff             2.409    0.331    1.833    3.136    1.001 gamma(1,.5)[sd]
    wEnj1             0.607    0.093    0.442    0.814    1.000 gamma(1,.5)[sd]
    wEff1             1.848    0.280    1.376    2.467    1.000 gamma(1,.5)[sd]
   .wEnj2             0.507    0.071    0.383    0.662    1.000 gamma(1,.5)[sd]
   .wEnj3             0.411    0.061    0.307    0.543    1.000 gamma(1,.5)[sd]
   .wEnj4             0.393    0.061    0.286    0.521    1.000 gamma(1,.5)[sd]
   .wEnj5             0.417    0.058    0.318    0.542    1.001 gamma(1,.5)[sd]
   .wEnj6             0.376    0.052    0.288    0.486    0.999 gamma(1,.5)[sd]
   .wEnj7             0.562    0.079    0.428    0.731    1.000 gamma(1,.5)[sd]
   .wEnj8             0.420    0.058    0.318    0.549    1.000 gamma(1,.5)[sd]
   .wEnj9             0.471    0.061    0.365    0.606    1.000 gamma(1,.5)[sd]
   .wEnj10            0.315    0.045    0.238    0.413    1.001 gamma(1,.5)[sd]
   .wEnj11            0.303    0.042    0.232    0.394    0.999 gamma(1,.5)[sd]
   .wEnj12            0.356    0.047    0.276    0.458    1.000 gamma(1,.5)[sd]
   .wEnj13            0.376    0.050    0.291    0.488    1.000 gamma(1,.5)[sd]
   .wEff2             0.742    0.099    0.572    0.953    1.000 gamma(1,.5)[sd]
   .wEff3             1.048    0.141    0.806    1.351    1.000 gamma(1,.5)[sd]
   .wEff4             0.671    0.101    0.500    0.894    1.000 gamma(1,.5)[sd]
   .wEff5             0.850    0.129    0.624    1.140    0.999 gamma(1,.5)[sd]
   .wEff6             0.842    0.122    0.630    1.107    1.000 gamma(1,.5)[sd]
   .wEff7             0.800    0.117    0.596    1.060    1.000 gamma(1,.5)[sd]
   .wEff8             0.994    0.157    0.728    1.339    1.000 gamma(1,.5)[sd]
   .wEff9             0.552    0.077    0.415    0.720    1.000 gamma(1,.5)[sd]
   .wEff10            0.973    0.140    0.716    1.279    1.001 gamma(1,.5)[sd]
   .wEff11            0.873    0.142    0.627    1.176    1.000 gamma(1,.5)[sd]
   .wEff12            1.331    0.199    0.993    1.769    1.000 gamma(1,.5)[sd]
   .wEff13            1.111    0.169    0.807    1.474    1.000 gamma(1,.5)[sd]
   .Enj1              0.000                                                    
   .Enj2              0.000                                                    
   .Enj3              0.000                                                    
   .Enj4              0.000                                                    
   .Enj5              0.000                                                    
   .Enj6              0.000                                                    
   .Enj7              0.000                                                    
   .Enj8              0.000                                                    
   .Enj9              0.000                                                    
   .Enj10             0.000                                                    
   .Enj11             0.000                                                    
   .Enj12             0.000                                                    
   .Enj13             0.000                                                    
   .Eff1              0.000                                                    
   .Eff2              0.000                                                    
   .Eff3              0.000                                                    
   .Eff4              0.000                                                    
   .Eff5              0.000                                                    
   .Eff6              0.000                                                    
   .Eff7              0.000                                                    
   .Eff8              0.000                                                    
   .Eff9              0.000                                                    
   .Eff10             0.000                                                    
   .Eff11             0.000                                                    
   .Eff12             0.000                                                    
   .Eff13             0.000                                Latent Variables:
                   Estimate  Post.SD pi.lower pi.upper     Rhat    Prior      
  RIEnj =~                                                                    
    Enj1              1.000                                                    
    Enj2              1.000                                                    
    Enj3              1.000                                                    
    Enj4              1.000                                                    
    Enj5              1.000                                                    
    Enj6              1.000                                                    
    Enj7              1.000                                                    
    Enj8              1.000                                                    
    Enj9              1.000                                                    
    Enj10             1.000                                                    
    Enj11             1.000                                                    
    Enj12             1.000                                                    
    Enj13             1.000                                                    
  RIEff =~                                                                    
    Eff1              1.000                                                    
    Eff2              1.000                                                    
    Eff3              1.000                                                    
    Eff4              1.000                                                    
    Eff5              1.000                                                    
    Eff6              1.000                                                    
    Eff7              1.000                                                    
    Eff8              1.000                                                    
    Eff9              1.000                                                    
    Eff10             1.000                                                    
    Eff11             1.000                                                    
    Eff12             1.000                                                    
    Eff13             1.000                                                    
  wEnj1 =~                                                                    
    Enj1              1.000                                                    
  wEnj2 =~                                                                    
    Enj2              1.000                                                    
  wEnj3 =~                                                                    
    Enj3              1.000                                                    
  wEnj4 =~                                                                    
    Enj4              1.000                                                    
  wEnj5 =~                                                                    
    Enj5              1.000                                                    
  wEnj6 =~                                                                    
    Enj6              1.000                                                    
  wEnj7 =~                                                                    
    Enj7              1.000                                                    
  wEnj8 =~                                                                    
    Enj8              1.000                                                    
  wEnj9 =~                                                                    
    Enj9              1.000                                                    
  wEnj10 =~                                                                    
    Enj10             1.000                                                    
  wEnj11 =~                                                                    
    Enj11             1.000                                                    
  wEnj12 =~                                                                    
    Enj12             1.000                                                    
  wEnj13 =~                                                                    
    Enj13             1.000                                                    
  wEff1 =~                                                                    
    Eff1              1.000                                                    
  wEff2 =~                                                                    
    Eff2              1.000                                                    
  wEff3 =~                                                                    
    Eff3              1.000                                                    
  wEff4 =~                                                                    
    Eff4              1.000                                                    
  wEff5 =~                                                                    
    Eff5              1.000                                                    
  wEff6 =~                                                                    
    Eff6              1.000                                                    
  wEff7 =~                                                                    
    Eff7              1.000                                                    
  wEff8 =~                                                                    
    Eff8              1.000                                                    
  wEff9 =~                                                                    
    Eff9              1.000                                                    
  wEff10 =~                                                                    
    Eff10             1.000                                                    
  wEff11 =~                                                                    
    Eff11             1.000                                                    
  wEff12 =~                                                                    
    Eff12             1.000                                                    
  wEff13 =~                                                                    
    Eff13             1.000                                                    

Regressions:
                   Estimate  Post.SD pi.lower pi.upper     Rhat    Prior      
  RIEnj ~                                                                      
    group1    (a1)    0.173    0.158   -0.148    0.480    1.003    normal(0,10)
    group2    (a2)   -0.156    0.178   -0.515    0.188    1.002    normal(0,10)
  RIEff ~                                                                      
    group1   (c11)   -0.153    0.341   -0.827    0.506    1.000    normal(0,10)
    group2   (c12)    0.455    0.387   -0.295    1.215    1.000    normal(0,10)
  postTest ~                                                                  
    group1   (c21)   -0.835    0.581   -1.995    0.303    1.000    normal(0,10)
    group2   (c22)   -0.468    0.685   -1.811    0.874    1.000    normal(0,10)
  game ~                                                                      
    group1   (c31)    1.113    0.605   -0.125    2.266    1.000    normal(0,10)
    group2   (c32)   -0.077    0.709   -1.457    1.330    1.000    normal(0,10)
  preTest ~                                                                    
    group1    (f1)    0.178    0.532   -0.827    1.233    1.000    normal(0,10)
    group2    (f2)   -0.690    0.600   -1.828    0.499    1.001    normal(0,10)
  preEnj ~                                                                    
    group1    (e1)    0.334    0.187   -0.035    0.704    1.000    normal(0,10)
    group2    (e2)    0.221    0.216   -0.204    0.647    1.000    normal(0,10)
  postTest ~                                                                  
    preTest           0.674    0.100    0.474    0.876    1.000    normal(0,10)
  game ~                                                                      
    preTest           0.426    0.105    0.219    0.627    1.000    normal(0,10)
  RIEnj ~                                                                      
    preEnj            0.517    0.078    0.362    0.669    1.000    normal(0,10)
  RIEff ~                                                                      
    preTest          -0.208    0.056   -0.317   -0.097    1.001    normal(0,10)
  wEnj2 ~                                                                      
    wEnj1             0.329    0.101    0.128    0.520    0.999    normal(0,10)
  wEnj3 ~                                                                      
    wEnj2             0.292    0.094    0.100    0.479    1.001    normal(0,10)
  wEnj4 ~                                                                      
    wEnj3             0.148    0.106   -0.063    0.356    1.000    normal(0,10)
  wEnj5 ~                                                                      
    wEnj4             0.376    0.115    0.149    0.596    1.000    normal(0,10)
  wEnj6 ~                                                                      
    wEnj5             0.432    0.096    0.239    0.619    1.000    normal(0,10)
  wEnj7 ~                                                                      
    wEnj6             0.321    0.120    0.088    0.563    1.000    normal(0,10)
  wEnj8 ~                                                                      
    wEnj7             0.448    0.089    0.273    0.625    1.000    normal(0,10)
  wEnj9 ~                                                                      
    wEnj8             0.604    0.110    0.375    0.813    0.999    normal(0,10)
  wEnj10 ~                                                                    
    wEnj9             0.529    0.079    0.370    0.681    0.999    normal(0,10)
  wEnj11 ~                                                                    
    wEnj10            0.522    0.080    0.362    0.673    1.000    normal(0,10)
  wEnj12 ~                                                                    
    wEnj11            0.721    0.090    0.539    0.895    1.000    normal(0,10)
  wEnj13 ~                                                                    
    wEnj12            0.668    0.081    0.516    0.822    1.001    normal(0,10)
  wEff2 ~                                                                      
    wEff1             0.666    0.064    0.542    0.792    1.000    normal(0,10)
  wEff3 ~                                                                      
    wEff2             0.581    0.085    0.408    0.746    1.000    normal(0,10)
  wEff4 ~                                                                      
    wEff3             0.461    0.071    0.320    0.592    1.000    normal(0,10)
  wEff5 ~                                                                      
    wEff4             0.377    0.107    0.160    0.582    1.000    normal(0,10)
  wEff6 ~                                                                      
    wEff5             0.253    0.101    0.048    0.447    0.999    normal(0,10)
  wEff7 ~                                                                      
    wEff6             0.302    0.106    0.090    0.509    1.000    normal(0,10)
  wEff8 ~                                                                      
    wEff7             0.268    0.128    0.012    0.514    1.000    normal(0,10)
  wEff9 ~                                                                      
    wEff8             0.473    0.082    0.307    0.627    1.000    normal(0,10)
  wEff10 ~                                                                    
    wEff9             0.356    0.124    0.099    0.587    1.001    normal(0,10)
  wEff11 ~                                                                    
    wEff10            0.233    0.113    0.003    0.444    1.000    normal(0,10)
  wEff12 ~                                                                    
    wEff11            0.180    0.147   -0.129    0.442    1.000    normal(0,10)
  wEff13 ~                                                                    
    wEff12            0.224    0.099    0.021    0.409    1.002    normal(0,10)
  wEff2 ~                                                                      
    wEnj1             0.036    0.113   -0.191    0.264    0.999    normal(0,10)
  wEff3 ~                                                                      
    wEnj2             0.277    0.140    0.009    0.563    1.000    normal(0,10)
  wEff4 ~                                                                      
    wEnj3             0.292    0.133    0.024    0.550    1.000    normal(0,10)
  wEff5 ~                                                                      
    wEnj4             0.479    0.164    0.158    0.799    1.000    normal(0,10)
  wEff6 ~                                                                      
    wEnj5             0.053    0.149   -0.237    0.345    1.000    normal(0,10)
  wEff7 ~                                                                      
    wEnj6             0.126    0.143   -0.157    0.409    1.001    normal(0,10)
  wEff8 ~                                                                      
    wEnj7            -0.478    0.143   -0.764   -0.204    1.000    normal(0,10)
  wEff9 ~                                                                      
    wEnj8            -0.285    0.121   -0.531   -0.052    1.000    normal(0,10)
  wEff10 ~                                                                    
    wEnj9            -0.135    0.128   -0.393    0.112    1.000    normal(0,10)
  wEff11 ~                                                                    
    wEnj10           -0.131    0.149   -0.427    0.152    1.000    normal(0,10)
  wEff12 ~                                                                    
    wEnj11           -0.284    0.190   -0.659    0.088    1.000    normal(0,10)
  wEff13 ~                                                                    
    wEnj12           -0.026    0.144   -0.301    0.254    1.000    normal(0,10)
  wEnj2 ~                                                                      
    wEff1            -0.039    0.053   -0.141    0.065    1.000    normal(0,10)
  wEnj3 ~                                                                      
    wEff2             0.008    0.055   -0.101    0.117    1.000    normal(0,10)
  wEnj4 ~                                                                      
    wEff3             0.015    0.055   -0.097    0.121    0.999    normal(0,10)
  wEnj5 ~                                                                      
    wEff4             0.015    0.073   -0.127    0.167    1.000    normal(0,10)
  wEnj6 ~                                                                      
    wEff5             0.007    0.064   -0.121    0.133    1.000    normal(0,10)
  wEnj7 ~                                                                      
    wEff6             0.083    0.084   -0.078    0.247    1.000    normal(0,10)
  wEnj8 ~                                                                      
    wEff7             0.047    0.074   -0.100    0.197    1.000    normal(0,10)
  wEnj9 ~                                                                      
    wEff8            -0.085    0.072   -0.228    0.054    1.000    normal(0,10)
  wEnj10 ~                                                                    
    wEff9            -0.182    0.069   -0.317   -0.043    0.999    normal(0,10)
  wEnj11 ~                                                                    
    wEff10           -0.031    0.058   -0.144    0.082    0.999    normal(0,10)
  wEnj12 ~                                                                    
    wEff11            0.000    0.064   -0.128    0.125    1.000    normal(0,10)
  wEnj13 ~                                                                    
    wEff12           -0.115    0.052   -0.214   -0.015    1.000    normal(0,10)

Covariances:
                   Estimate  Post.SD pi.lower pi.upper     Rhat    Prior      
 .postTest ~~                                                                  
   .game              2.933    0.781    1.550    4.623    1.000       beta(1,1)
 .preTest ~~                                                                  
   .preEnj            0.218    0.199   -0.163    0.627    0.999       beta(1,1)
  wEnj1 ~~                                                                    
    wEff1             0.004    0.110   -0.221    0.219    1.000       beta(1,1)
 .wEnj2 ~~                                                                    
   .wEff2            -0.085    0.059   -0.205    0.027    0.999       beta(1,1)
 .wEnj3 ~~                                                                    
   .wEff3            -0.044    0.065   -0.172    0.083    1.000       beta(1,1)
 .wEnj4 ~~                                                                    
   .wEff4            -0.060    0.055   -0.170    0.043    1.001       beta(1,1)
 .wEnj5 ~~                                                                    
   .wEff5             0.011    0.061   -0.112    0.134    1.000       beta(1,1)
 .wEnj6 ~~                                                                    
   .wEff6            -0.094    0.056   -0.205    0.015    0.999       beta(1,1)
 .wEnj7 ~~                                                                    
   .wEff7            -0.214    0.070   -0.364   -0.083    1.000       beta(1,1)
 .wEnj8 ~~                                                                    
   .wEff8            -0.194    0.070   -0.339   -0.065    1.000       beta(1,1)
 .wEnj9 ~~                                                                    
   .wEff9            -0.063    0.049   -0.158    0.026    1.000       beta(1,1)
 .wEnj10 ~~                                                                    
   .wEff10           -0.128    0.057   -0.245   -0.021    0.999       beta(1,1)
 .wEnj11 ~~                                                                    
   .wEff11           -0.062    0.054   -0.167    0.038    0.999       beta(1,1)
 .wEnj12 ~~                                                                    
   .wEff12            0.006    0.065   -0.121    0.136    1.000       beta(1,1)
 .wEnj13 ~~                                                                    
   .wEff13           -0.005    0.063   -0.130    0.118    1.000       beta(1,1)
 .RIEnj ~~                                                                    
   .RIEff            -0.021    0.110   -0.242    0.196    0.999       beta(1,1)

Intercepts:
                   Estimate  Post.SD pi.lower pi.upper     Rhat    Prior      
   .Enj1              1.603    0.265    1.073    2.123    1.001    normal(0,32)
   .Enj2              1.571    0.266    1.040    2.085    1.001    normal(0,32)
   .Enj3              1.472    0.265    0.948    1.989    1.001    normal(0,32)
   .Enj4              1.273    0.263    0.748    1.774    1.001    normal(0,32)
   .Enj5              1.092    0.264    0.569    1.596    1.001    normal(0,32)
   .Enj6              1.091    0.264    0.568    1.607    1.001    normal(0,32)
   .Enj7              1.181    0.266    0.662    1.687    1.001    normal(0,32)
   .Enj8              1.257    0.265    0.737    1.760    1.001    normal(0,32)
   .Enj9              1.319    0.267    0.780    1.834    1.001    normal(0,32)
   .Enj10             1.174    0.266    0.649    1.693    1.001    normal(0,32)
   .Enj11             1.052    0.264    0.530    1.575    1.001    normal(0,32)
   .Enj12             1.145    0.267    0.606    1.663    1.001    normal(0,32)
   .Enj13             1.244    0.266    0.709    1.756    1.001    normal(0,32)
   .Eff1              6.028    0.441    5.176    6.873    1.001    normal(0,32)
   .Eff2              6.135    0.442    5.287    6.982    1.001    normal(0,32)
   .Eff3              5.965    0.438    5.106    6.810    1.001    normal(0,32)
   .Eff4              6.488    0.434    5.635    7.337    1.001    normal(0,32)
   .Eff5              6.596    0.433    5.736    7.452    1.002    normal(0,32)
   .Eff6              6.568    0.430    5.707    7.386    1.001    normal(0,32)
   .Eff7              6.517    0.434    5.665    7.350    1.002    normal(0,32)
   .Eff8              6.228    0.439    5.345    7.089    1.001    normal(0,32)
   .Eff9              6.138    0.435    5.279    6.993    1.001    normal(0,32)
   .Eff10             6.123    0.436    5.265    6.970    1.001    normal(0,32)
   .Eff11             6.681    0.434    5.832    7.521    1.001    normal(0,32)
   .Eff12             6.242    0.436    5.395    7.086    1.001    normal(0,32)
   .Eff13             7.030    0.435    6.193    7.886    1.001    normal(0,32)
   .postTest          4.160    0.755    2.647    5.631    1.000    normal(0,32)
   .game              7.611    0.790    6.044    9.166    0.999    normal(0,32)
   .preTest           5.954    0.410    5.171    6.733    1.001    normal(0,32)
   .preEnj            2.777    0.149    2.493    3.062    1.000    normal(0,32)
   .RIEnj             0.000                                                    
   .RIEff             0.000                                                    
    wEnj1             0.000                                                    
   .wEnj2             0.000                                                    
   .wEnj3             0.000                                                    
   .wEnj4             0.000                                                    
   .wEnj5             0.000                                                    
   .wEnj6             0.000                                                    
   .wEnj7             0.000                                                    
   .wEnj8             0.000                                                    
   .wEnj9             0.000                                                    
   .wEnj10            0.000                                                    
   .wEnj11            0.000                                                    
   .wEnj12            0.000                                                    
   .wEnj13            0.000                                                    
    wEff1             0.000                                                    
   .wEff2             0.000                                                    
   .wEff3             0.000                                                    
   .wEff4             0.000                                                    
   .wEff5             0.000                                                    
   .wEff6             0.000                                                    
   .wEff7             0.000                                                    
   .wEff8             0.000                                                    
   .wEff9             0.000                                                    
   .wEff10            0.000                                                    
   .wEff11            0.000                                                    
   .wEff12            0.000                                                    
   .wEff13            0.000                                                    

Variances:
                   Estimate  Post.SD pi.lower pi.upper     Rhat    Prior      
   .postTest          7.959    1.010    6.273   10.173    0.999 gamma(1,.5)[sd]
   .game              8.697    1.118    6.838   11.161    1.000 gamma(1,.5)[sd]
   .preEnj            0.789    0.101    0.621    1.011    1.000 gamma(1,.5)[sd]
   .preTest           6.324    0.772    4.999    7.999    1.000 gamma(1,.5)[sd]
   .RIEnj             0.459    0.075    0.331    0.631    1.000 gamma(1,.5)[sd]
   .RIEff             2.409    0.331    1.833    3.136    1.001 gamma(1,.5)[sd]
    wEnj1             0.607    0.093    0.442    0.814    1.000 gamma(1,.5)[sd]
    wEff1             1.848    0.280    1.376    2.467    1.000 gamma(1,.5)[sd]
   .wEnj2             0.507    0.071    0.383    0.662    1.000 gamma(1,.5)[sd]
   .wEnj3             0.411    0.061    0.307    0.543    1.000 gamma(1,.5)[sd]
   .wEnj4             0.393    0.061    0.286    0.521    1.000 gamma(1,.5)[sd]
   .wEnj5             0.417    0.058    0.318    0.542    1.001 gamma(1,.5)[sd]
   .wEnj6             0.376    0.052    0.288    0.486    0.999 gamma(1,.5)[sd]
   .wEnj7             0.562    0.079    0.428    0.731    1.000 gamma(1,.5)[sd]
   .wEnj8             0.420    0.058    0.318    0.549    1.000 gamma(1,.5)[sd]
   .wEnj9             0.471    0.061    0.365    0.606    1.000 gamma(1,.5)[sd]
   .wEnj10            0.315    0.045    0.238    0.413    1.001 gamma(1,.5)[sd]
   .wEnj11            0.303    0.042    0.232    0.394    0.999 gamma(1,.5)[sd]
   .wEnj12            0.356    0.047    0.276    0.458    1.000 gamma(1,.5)[sd]
   .wEnj13            0.376    0.050    0.291    0.488    1.000 gamma(1,.5)[sd]
   .wEff2             0.742    0.099    0.572    0.953    1.000 gamma(1,.5)[sd]
   .wEff3             1.048    0.141    0.806    1.351    1.000 gamma(1,.5)[sd]
   .wEff4             0.671    0.101    0.500    0.894    1.000 gamma(1,.5)[sd]
   .wEff5             0.850    0.129    0.624    1.140    0.999 gamma(1,.5)[sd]
   .wEff6             0.842    0.122    0.630    1.107    1.000 gamma(1,.5)[sd]
   .wEff7             0.800    0.117    0.596    1.060    1.000 gamma(1,.5)[sd]
   .wEff8             0.994    0.157    0.728    1.339    1.000 gamma(1,.5)[sd]
   .wEff9             0.552    0.077    0.415    0.720    1.000 gamma(1,.5)[sd]
   .wEff10            0.973    0.140    0.716    1.279    1.001 gamma(1,.5)[sd]
   .wEff11            0.873    0.142    0.627    1.176    1.000 gamma(1,.5)[sd]
   .wEff12            1.331    0.199    0.993    1.769    1.000 gamma(1,.5)[sd]
   .wEff13            1.111    0.169    0.807    1.474    1.000 gamma(1,.5)[sd]
   .Enj1              0.000                                                    
   .Enj2              0.000                                                    
   .Enj3              0.000                                                    
   .Enj4              0.000                                                    
   .Enj5              0.000                                                    
   .Enj6              0.000                                                    
   .Enj7              0.000                                                    
   .Enj8              0.000                                                    
   .Enj9              0.000                                                    
   .Enj10             0.000                                                    
   .Enj11             0.000                                                    
   .Enj12             0.000                                                    
   .Enj13             0.000                                                    
   .Eff1              0.000                                                    
   .Eff2              0.000                                                    
   .Eff3              0.000                                                    
   .Eff4              0.000                                                    
   .Eff5              0.000                                                    
   .Eff6              0.000                                                    
   .Eff7              0.000                                                    
   .Eff8              0.000                                                    
   .Eff9              0.000                                                    
   .Eff10             0.000                                                    
   .Eff11             0.000                                                    
   .Eff12             0.000                                                    
   .Eff13             0.000                                 

Thank you in advance!
Yuan
Yuanyuan Hu | PhD Candidate | Department of Education | Utrecht University | Heidelberglaan 1, 3584 CS Utrecht, the Netherlands | 

Mauricio Garnier-Villarreal

unread,
Mar 29, 2023, 7:44:34 AM3/29/23
to blavaan
Yuan

some models with high number of constraints end up with issues of NA on on the margloglik, but this is not a problem in practice as it is only needed for bayes factor calculations (which I dont recommend)

About the gamma hat, remember that the cutoff of 0.9 is arbitrary and there is no reason to belief ot applies to all models/data, etc.

You can look at modification indices, but guven that you dont have an actual measurement model, might indicate to relase model constraints that could go agaiants the restrictions for theis model.

Another note, you dont need to save so many samples (1500 per chain), could probably do with 500

You can estimate posterior modifiction indices with this code and the ppmc function

### modification indices
discFUN <- list(mod.ind_mi = function(object){
  temp <- modificationindices(object,free.remove = F)
  mods <- temp$mi
  names(mods) <- paste0(temp$lhs,temp$op,temp$rhs)
  return(mods)
},mod.ind_sepc.all = function(object){
  temp <- modificationindices(object,free.remove = F)
  sepc.all <- temp$sepc.all
  names(sepc.all) <- paste0(temp$lhs,temp$op,temp$rhs)
  return(sepc.all )
}
)

#######
## PPMC - Modification indices
#######
out <- ppmc(bfit, thin=5, discFUN = discFUN)

### -MI
ss_mod_mi <- summary(out, prob=.9, discFUN = "mod.ind_mi", sort.by="Median", decreasing=T)[1:5,]
### -SEPC
ss_mod_sepc <- summary(out, prob=.9, discFUN = "mod.ind_sepc.all", sort.by="Median", decreasing=T)[1:5,]

Yuanyuan Hu

unread,
Mar 29, 2023, 9:37:59 AM3/29/23
to blavaan
Thank you Mauricio! 

Sample: 
1). When sample = 500, I got below warnings so I increased sample =1500. I was planning to use sample =10000 (which takes 40 mins each run) in the final reporting. Perhaps no need to be so high?
3: Bulk Effective Samples Size (ESS) is too low, indicating posterior means and medians may be unreliable.
Running the chains for more iterations may help. See
https://mc-stan.org/misc/warnings.html#bulk-ess
4: Tail Effective Samples Size (ESS) is too low, indicating posterior variances and tail quantiles may be unreliable.
Running the chains for more iterations may help. See
https://mc-stan.org/misc/warnings.html#tail-ess 

2) When sample = 1500, I also got below warning. I checked suggestions in this group, it seems that  I can ignore this warning?
blavaan WARNING: As specified, the psi covariance matrix is neither diagonal nor unrestricted, so the actual prior might differ from the stated prior. See
 https://arxiv.org/abs/2301.08667 

Modification indices:
1)In the code that you shared, I replaced "bfit" with my model "fit.RICLPMpoCogEnjEff". It's almost 2 hours, but the analysis is still running and nothing comes out... Did I do anything wrong?

Best,
Yuan

Mauricio Garnier-Villarreal

unread,
Mar 29, 2023, 10:36:08 AM3/29/23
to blavaan
Yuan

1. 10000 is an overkill, if 1500 is enough to not get the ESS warnings you are fine. It would only be neccesary to have sucha a large sample for bayes factor estabilibility. But not for inferences etc

2. Yes, that is a warning not a problematic error

3. Sadly, that is a know problem with modification indices, they can take a while for large models, as it is estimating the lavaan indices 600 time for example. If R is still running I would let it run a for a bot. or you can increase thin so that it estimates it less times

out <- ppmc( fit.RICLPMpoCogEnjEff , thin=8, discFUN = discFUN)

as a last resort, you can run the model with lavaan and use its modification indices. They should not point to different parameters. Honetsly I am not sure what would be recommended as added parameters in this model with so many constraints

Yuanyuan Hu

unread,
Mar 29, 2023, 11:33:47 AM3/29/23
to blavaan
Running the model with lavaan and using its modification indices is indeed a fast solution. 

I tried the possible modification indices but the gammaHat is still below .900. You recommended to report gammaHat and BCFI. What if the reviewers are very critical about the the cutoff value, do you have any references that I can cite to say in this case, the model fit is acceptable?

Many thanks!

Mauricio Garnier-Villarreal

unread,
Mar 30, 2023, 9:12:18 AM3/30/23
to blavaan
You can use the BSEM fit indices paper, we have a section about the interpretation of the indices and how the cutoffs cannot be generalized, and you can see the otehr references in that section
This is a general problem of a bad practice has become common.

What is "acceptable" is such a qualitative interpretation that generalized the 0.9 is silly. Sorry I dont have a better solution to handle reviewers

Yuanyuan Hu

unread,
Apr 2, 2023, 2:46:50 PM4/2/23
to blavaan

Thank you Mauricio! 
My sample size is 131 in total, group0 = 36, group1=62, group2=33. If I run the same model in lavaan with MLR estimator and in blavaan with default priors, will the model fit and parameter estimate differ a lot? I tried and got quite different 
1) model fit :
CFI: .920
BCFI: .802
2) regression coefficients (lavaan a1, a2....b3) (related to our research question whether there are group differences)
lavaan:  p value of  e1, b2, and b3 are smaller than .050
blavaan: 95% CI of a1, c12, f1,f2, e1, e2, b1, b2, and b3 do not contain zero.

lavaan:
fit.RICLPMpoEnjEff1g <- lavaan(fit.RICLPMpoEnjEff1g,
                                  data = dat,
                                  estimator = "MLR",
                                  missing = 'FIML',
                                  meanstructure = T, 
                                  fixed.x = TRUE,
                                  int.ov.free = T)
> summary(fit.RICLPMpoEnjEffL, fit.measures=TRUE)
lavaan 0.6.15 ended normally after 156 iterations

  Estimator                                         ML
  Optimization method                           NLMINB
  Number of model parameters                       145


  Number of observations                           131
  Number of missing patterns                         3

Model Test User Model:
                                              Standard      Scaled
  Test Statistic                               727.569     678.644
  Degrees of freedom                               410         410
  P-value (Chi-square)                           0.000       0.000
  Scaling correction factor                                  1.072
    Yuan-Bentler correction (Mplus variant)                      

Model Test Baseline Model:

  Test statistic                              4481.396    3798.233
  Degrees of freedom                               495         495
  P-value                                        0.000       0.000
  Scaling correction factor                                  1.180

User Model versus Baseline Model:

  Comparative Fit Index (CFI)                    0.920       0.919
  Tucker-Lewis Index (TLI)                       0.904       0.902
                                                                 
  Robust Comparative Fit Index (CFI)                         0.932
  Robust Tucker-Lewis Index (TLI)                            0.918

Loglikelihood and Information Criteria:

  Loglikelihood user model (H0)              -5306.909   -5306.909
  Scaling correction factor                                  1.340
      for the MLR correction                                      
  Loglikelihood unrestricted model (H1)      -4943.124   -4943.124
  Scaling correction factor                                  1.142
      for the MLR correction                                      
                                                                 
  Akaike (AIC)                               10903.817   10903.817
  Bayesian (BIC)                             11320.721   11320.721
  Sample-size adjusted Bayesian (SABIC)      10862.100   10862.100

Root Mean Square Error of Approximation:

  RMSEA                                          0.077       0.071
  90 Percent confidence interval - lower         0.068       0.062
  90 Percent confidence interval - upper         0.086       0.080
  P-value H_0: RMSEA <= 0.050                    0.000       0.000
  P-value H_0: RMSEA >= 0.080                    0.293       0.045
                                                                 
  Robust RMSEA                                               0.070
  90 Percent confidence interval - lower                     0.060
  90 Percent confidence interval - upper                     0.081
  P-value H_0: Robust RMSEA <= 0.050                         0.001
  P-value H_0: Robust RMSEA >= 0.080                         0.063

Standardized Root Mean Square Residual:

  SRMR                                           0.101       0.101

Parameter Estimates:

  Standard errors                             Sandwich
  Information bread                           Observed
  Observed information based on                Hessian

Latent Variables:
                   Estimate  Std.Err  z-value  P(>|z|)
                   Estimate  Std.Err  z-value  P(>|z|)
  RIEnj ~                                            
    group1    (a1)    0.174    0.156    1.115    0.265
    group2    (a2)   -0.151    0.162   -0.934    0.350
  RIEff ~                                            
    group1   (c11)   -0.330    0.339   -0.974    0.330
    group2   (c12)    0.464    0.389    1.191    0.234
  postTest ~                                          
    group1   (c21)   -1.096    0.626   -1.751    0.080
    group2   (c22)   -0.447    0.601   -0.744    0.457
  game ~                                              
    group1   (c31)    0.762    0.587    1.298    0.194
    group2   (c32)   -0.050    0.682   -0.073    0.942
  preTest ~                                          
    group1    (f1)    0.185    0.531    0.348    0.728
    group2    (f2)   -0.684    0.557   -1.228    0.220
  preEnj ~                                            
    group1    (e1)    0.335    0.166    2.015    0.044
    group2    (e2)    0.222    0.186    1.195    0.232
  RIEff ~                                            
    RIEnj     (b1)    0.539    0.344    1.565    0.118
  postTest ~                                          
    RIEnj     (b2)    0.748    0.313    2.392    0.017
  game ~                                              
    RIEnj     (b3)    1.055    0.299    3.527    0.000
  postTest ~                                          
    preTest           0.663    0.101    6.558    0.000
  game ~                                              
    preTest           0.409    0.094    4.370    0.000
  RIEnj ~                                            
    preEnj            0.513    0.069    7.490    0.000
  RIEff ~                                            
    preTest          -0.221    0.045   -4.878    0.000
  wEnj2 ~                                            
    wEnj1             0.303    0.119    2.550    0.011
  wEnj3 ~                                            
    wEnj2             0.271    0.114    2.369    0.018
  wEnj4 ~                                            
    wEnj3             0.117    0.140    0.841    0.400
  wEnj5 ~                                            
    wEnj4             0.379    0.142    2.678    0.007
  wEnj6 ~                                            
    wEnj5             0.442    0.183    2.417    0.016
  wEnj7 ~                                            
    wEnj6             0.327    0.135    2.432    0.015
  wEnj8 ~                                            
    wEnj7             0.447    0.112    3.992    0.000
  wEnj9 ~                                            
    wEnj8             0.636    0.137    4.637    0.000
  wEnj10 ~                                            
    wEnj9             0.547    0.105    5.203    0.000
  wEnj11 ~                                            
    wEnj10            0.527    0.106    4.948    0.000
  wEnj12 ~                                            
    wEnj11            0.724    0.079    9.145    0.000
  wEnj13 ~                                            
    wEnj12            0.671    0.085    7.926    0.000
  wEff2 ~                                            
    wEff1             0.679    0.075    9.006    0.000
  wEff3 ~                                            
    wEff2             0.607    0.125    4.877    0.000
  wEff4 ~                                            
    wEff3             0.483    0.109    4.414    0.000
  wEff5 ~                                            
    wEff4             0.402    0.163    2.476    0.013
  wEff6 ~                                            
    wEff5             0.275    0.156    1.758    0.079
  wEff7 ~                                            
    wEff6             0.330    0.190    1.740    0.082
  wEff8 ~                                            
    wEff7             0.295    0.184    1.605    0.109
  wEff9 ~                                            
    wEff8             0.487    0.116    4.200    0.000
  wEff10 ~                                            
    wEff9             0.352    0.128    2.743    0.006
  wEff11 ~                                            
    wEff10            0.182    0.221    0.824    0.410
  wEff12 ~                                            
    wEff11            0.109    0.372    0.294    0.769
  wEff13 ~                                            
    wEff12            0.177    0.241    0.733    0.464
  wEff2 ~                                            
    wEnj1             0.035    0.134    0.260    0.795
  wEff3 ~                                            
    wEnj2             0.294    0.159    1.844    0.065
  wEff4 ~                                            
    wEnj3             0.284    0.173    1.639    0.101
  wEff5 ~                                            
    wEnj4             0.502    0.164    3.056    0.002
  wEff6 ~                                            
    wEnj5             0.060    0.151    0.399    0.690
  wEff7 ~                                            
    wEnj6             0.126    0.155    0.814    0.416
  wEff8 ~                                            
    wEnj7            -0.437    0.198   -2.210    0.027
  wEff9 ~                                            
    wEnj8            -0.262    0.162   -1.617    0.106
  wEff10 ~                                            
    wEnj9            -0.126    0.133   -0.953    0.340
  wEff11 ~                                            
    wEnj10           -0.161    0.180   -0.896    0.370
  wEff12 ~                                            
    wEnj11           -0.306    0.248   -1.234    0.217
  wEff13 ~                                            
    wEnj12           -0.052    0.159   -0.325    0.745
  wEnj2 ~                                            
    wEff1            -0.036    0.062   -0.574    0.566
  wEnj3 ~                                            
    wEff2             0.006    0.067    0.088    0.930
  wEnj4 ~                                            
    wEff3             0.012    0.064    0.191    0.848
  wEnj5 ~                                            
    wEff4             0.011    0.097    0.113    0.910
  wEnj6 ~                                            
    wEff5            -0.003    0.056   -0.058    0.953
  wEnj7 ~                                            
    wEff6             0.089    0.097    0.924    0.355
  wEnj8 ~                                            
    wEff7             0.047    0.078    0.596    0.551
  wEnj9 ~                                            
    wEff8            -0.063    0.087   -0.719    0.472
  wEnj10 ~                                            
    wEff9            -0.173    0.086   -2.007    0.045
  wEnj11 ~                                            
    wEff10           -0.034    0.067   -0.514    0.607
  wEnj12 ~                                            
    wEff11           -0.004    0.079   -0.053    0.958
  wEnj13 ~                                            
    wEff12           -0.122    0.085   -1.435    0.151

Covariances:
                   Estimate  Std.Err  z-value  P(>|z|)
 .postTest ~~                                        
   .game              2.367    0.723    3.275    0.001
 .preTest ~~                                          
   .preEnj            0.208    0.163    1.279    0.201
  wEnj1 ~~                                            
    wEff1             0.012    0.124    0.097    0.923
 .wEnj2 ~~                                            
   .wEff2            -0.083    0.064   -1.299    0.194
 .wEnj3 ~~                                            
   .wEff3            -0.042    0.063   -0.659    0.510
 .wEnj4 ~~                                            
   .wEff4            -0.063    0.057   -1.111    0.267
 .wEnj5 ~~                                            
   .wEff5             0.011    0.055    0.194    0.847
 .wEnj6 ~~                                            
   .wEff6            -0.095    0.053   -1.806    0.071
 .wEnj7 ~~                                            
   .wEff7            -0.205    0.072   -2.821    0.005
 .wEnj8 ~~                                            
   .wEff8            -0.181    0.075   -2.418    0.016
 .wEnj9 ~~                                            
   .wEff9            -0.051    0.068   -0.743    0.457
 .wEnj10 ~~                                          
   .wEff10           -0.129    0.060   -2.160    0.031
 .wEnj11 ~~                                          
   .wEff11           -0.068    0.057   -1.191    0.234
 .wEnj12 ~~                                          
   .wEff12            0.005    0.062    0.081    0.935
 .wEnj13 ~~                                          
   .wEff13           -0.019    0.074   -0.254    0.800
 .RIEnj ~~                                            
   .RIEff            -0.255    0.174   -1.469    0.142

Intercepts:
                   Estimate  Std.Err  z-value  P(>|z|)
   .Enj1              1.610    0.233    6.915    0.000
   .Enj2              1.579    0.248    6.357    0.000
   .Enj3              1.480    0.244    6.078    0.000
   .Enj4              1.282    0.233    5.491    0.000
   .Enj5              1.098    0.241    4.551    0.000
   .Enj6              1.098    0.238    4.610    0.000
   .Enj7              1.190    0.247    4.818    0.000
   .Enj8              1.266    0.252    5.022    0.000
   .Enj9              1.327    0.244    5.434    0.000
   .Enj10             1.182    0.239    4.948    0.000
   .Enj11             1.060    0.233    4.544    0.000
   .Enj12             1.152    0.235    4.894    0.000
   .Enj13             1.251    0.236    5.310    0.000
   .Eff1              5.335    0.616    8.658    0.000
   .Eff2              5.441    0.625    8.707    0.000
   .Eff3              5.273    0.611    8.634    0.000
   .Eff4              5.793    0.616    9.399    0.000
   .Eff5              5.899    0.609    9.689    0.000
   .Eff6              5.877    0.608    9.668    0.000
   .Eff7              5.823    0.626    9.301    0.000
   .Eff8              5.533    0.614    9.018    0.000
   .Eff9              5.441    0.606    8.981    0.000
   .Eff10             5.426    0.600    9.046    0.000
   .Eff11             5.983    0.605    9.884    0.000
   .Eff12             5.548    0.614    9.036    0.000
   .Eff13             6.337    0.604   10.493    0.000
   .postTest          3.156    0.851    3.709    0.000
   .game              6.204    0.938    6.617    0.000
   .preTest           5.944    0.416   14.302    0.000
   .preEnj            2.778    0.112   24.828    0.000
                   Estimate  Std.Err  z-value  P(>|z|)
   .postTest          7.234    0.748    9.674    0.000
   .game              7.601    1.039    7.313    0.000
   .preEnj            0.751    0.082    9.149    0.000
   .preTest           6.029    0.810    7.439    0.000
   .RIEnj             0.418    0.070    5.990    0.000
   .RIEff             2.362    0.312    7.569    0.000
    wEnj1             0.563    0.101    5.586    0.000
    wEff1             1.857    0.373    4.973    0.000
   .wEnj2             0.471    0.064    7.310    0.000
   .wEnj3             0.389    0.061    6.351    0.000
   .wEnj4             0.360    0.053    6.735    0.000
   .wEnj5             0.405    0.104    3.880    0.000
   .wEnj6             0.361    0.058    6.262    0.000
   .wEnj7             0.535    0.076    7.081    0.000
   .wEnj8             0.400    0.056    7.194    0.000
   .wEnj9             0.457    0.083    5.502    0.000
   .wEnj10            0.302    0.068    4.445    0.000
   .wEnj11            0.289    0.043    6.794    0.000
   .wEnj12            0.338    0.062    5.430    0.000
   .wEnj13            0.358    0.068    5.222    0.000
   .wEff2             0.713    0.120    5.941    0.000
   .wEff3             1.016    0.161    6.303    0.000
   .wEff4             0.655    0.134    4.903    0.000
   .wEff5             0.807    0.232    3.479    0.001
   .wEff6             0.817    0.165    4.948    0.000
   .wEff7             0.787    0.227    3.472    0.001
   .wEff8             0.963    0.189    5.089    0.000
   .wEff9             0.532    0.088    6.073    0.000
   .wEff10            0.911    0.174    5.243    0.000
   .wEff11            0.774    0.236    3.279    0.001
   .wEff12            1.221    0.284    4.307    0.000
   .wEff13            1.003    0.208    4.829    0.000
> fitMeasures(fit.RICLPMpoEnjEffL, c("cfi","tli", "rmsea","srmr","AIC","BIC", "df", "Chisq"))
      cfi       tli     rmsea      srmr       aic       bic        df     chisq
    0.920     0.904     0.077     0.101 10903.817 11320.721   410.000   727.569 


blavaan:
fit.RICLPMpoEnjEff <- blavaan(fit.RICLPMpoEnjEff, data=dat,target = "stan",

                              n.chains = 2, burnin = 200, sample = 1500, bcontrol = list(cores = 4), mcmcfile = TRUE)
> summary(fit.RICLPMpoEnjEff)
    group1    (a1)    0.399    0.166    0.071    0.728    1.000    normal(0,10)
    group2    (a2)    0.066    0.194   -0.310    0.442    1.000    normal(0,10)
  RIEff ~                                                                      
    group1   (c11)   -0.193    0.491   -1.170    0.771    1.000    normal(0,10)
    group2   (c12)    1.361    0.516    0.309    2.351    0.999    normal(0,10)
  postTest ~                                                                  
    group1   (c21)   -0.907    0.607   -2.060    0.262    1.000    normal(0,10)
    group2   (c22)    0.062    0.645   -1.192    1.300    1.000    normal(0,10)
  game ~                                                                      
    group1   (c31)    1.207    0.645   -0.048    2.505    1.000    normal(0,10)
    group2   (c32)    1.047    0.707   -0.337    2.418    0.999    normal(0,10)
  preTest ~                                                                    
    group1    (f1)    6.117    0.498    5.131    7.077    1.000    normal(0,10)
    group2    (f2)    5.281    0.684    3.907    6.578    1.000    normal(0,10)
  preEnj ~                                                                    
    group1    (e1)    3.104    0.211    2.693    3.534    1.000    normal(0,10)
    group2    (e2)    2.993    0.297    2.399    3.564    0.999    normal(0,10)
  RIEff ~                                                                      
    RIEnj     (b1)    1.710    0.188    1.351    2.097    1.000    normal(0,10)
  postTest ~                                                                  
    RIEnj     (b2)    1.198    0.213    0.786    1.628    1.000    normal(0,10)
  game ~                                                                      
    RIEnj     (b3)    2.048    0.242    1.581    2.538    1.000    normal(0,10)
  postTest ~                                                                  
    preTest           0.775    0.085    0.611    0.940    1.000    normal(0,10)
  game ~                                                                      
    preTest           0.649    0.098    0.454    0.843    1.000    normal(0,10)
  RIEnj ~                                                                      
    preEnj            0.839    0.043    0.754    0.921    1.000    normal(0,10)
  RIEff ~                                                                      
    preTest           0.012    0.064   -0.113    0.138    1.000    normal(0,10)
  wEnj2 ~                                                                      
    wEnj1             0.494    0.089    0.317    0.663    0.999    normal(0,10)
  wEnj3 ~                                                                      
    wEnj2             0.425    0.083    0.260    0.590    1.000    normal(0,10)
  wEnj4 ~                                                                      
    wEnj3             0.213    0.094    0.028    0.399    1.000    normal(0,10)
  wEnj5 ~                                                                      
    wEnj4             0.452    0.117    0.221    0.685    1.000    normal(0,10)
  wEnj6 ~                                                                      
    wEnj5             0.481    0.086    0.313    0.648    1.000    normal(0,10)
  wEnj7 ~                                                                      
    wEnj6             0.289    0.118    0.051    0.512    1.002    normal(0,10)
  wEnj8 ~                                                                      
    wEnj7             0.366    0.092    0.184    0.541    1.000    normal(0,10)
  wEnj9 ~                                                                      
    wEnj8             0.599    0.117    0.372    0.819    0.999    normal(0,10)
  wEnj10 ~                                                                    
    wEnj9             0.503    0.084    0.335    0.670    1.000    normal(0,10)
  wEnj11 ~                                                                    
    wEnj10            0.519    0.091    0.334    0.694    0.999    normal(0,10)
  wEnj12 ~                                                                    
    wEnj11            0.638    0.100    0.438    0.831    1.001    normal(0,10)
  wEnj13 ~                                                                    
    wEnj12            0.629    0.087    0.448    0.796    1.000    normal(0,10)
  wEff2 ~                                                                      
    wEff1             0.715    0.059    0.595    0.827    1.001    normal(0,10)
  wEff3 ~                                                                      
    wEff2             0.701    0.085    0.531    0.853    1.002    normal(0,10)
  wEff4 ~                                                                      
    wEff3             0.494    0.075    0.345    0.637    1.004    normal(0,10)
  wEff5 ~                                                                      
    wEff4             0.459    0.098    0.251    0.637    1.002    normal(0,10)
  wEff6 ~                                                                      
    wEff5             0.371    0.106    0.162    0.579    1.001    normal(0,10)
  wEff7 ~                                                                      
    wEff6             0.422    0.121    0.176    0.640    1.003    normal(0,10)
  wEff8 ~                                                                      
    wEff7             0.362    0.135    0.077    0.604    1.000    normal(0,10)
  wEff9 ~                                                                      
    wEff8             0.574    0.084    0.398    0.728    1.000    normal(0,10)
  wEff10 ~                                                                    
    wEff9             0.446    0.103    0.237    0.641    1.000    normal(0,10)
  wEff11 ~                                                                    
    wEff10            0.036    0.116   -0.176    0.272    1.004    normal(0,10)
  wEff12 ~                                                                    
    wEff11           -0.250    0.328   -0.931    0.259    1.005    normal(0,10)
  wEff13 ~                                                                    
    wEff12           -0.065    0.190   -0.463    0.281    1.004    normal(0,10)
  wEff2 ~                                                                      
    wEnj1             0.026    0.094   -0.158    0.213    1.000    normal(0,10)
  wEff3 ~                                                                      
    wEnj2             0.068    0.127   -0.182    0.316    1.000    normal(0,10)
  wEff4 ~                                                                      
    wEnj3             0.357    0.125    0.115    0.605    1.000    normal(0,10)
  wEff5 ~                                                                      
    wEnj4             0.385    0.155    0.086    0.687    1.000    normal(0,10)
  wEff6 ~                                                                      
    wEnj5            -0.010    0.135   -0.277    0.249    0.999    normal(0,10)
  wEff7 ~                                                                      
    wEnj6             0.120    0.146   -0.163    0.406    0.999    normal(0,10)
  wEff8 ~                                                                      
    wEnj7            -0.324    0.164   -0.658   -0.014    1.000    normal(0,10)
  wEff9 ~                                                                      
    wEnj8            -0.243    0.137   -0.517    0.021    1.000    normal(0,10)
  wEff10 ~                                                                    
    wEnj9            -0.092    0.133   -0.351    0.166    1.000    normal(0,10)
  wEff11 ~                                                                    
    wEnj10           -0.254    0.153   -0.555    0.042    1.000    normal(0,10)
  wEff12 ~                                                                    
    wEnj11           -0.292    0.241   -0.803    0.142    1.003    normal(0,10)
  wEff13 ~                                                                    
    wEnj12           -0.173    0.202   -0.569    0.214    1.001    normal(0,10)
  wEnj2 ~                                                                      
    wEff1            -0.065    0.048   -0.161    0.031    1.000    normal(0,10)
  wEnj3 ~                                                                      
    wEff2            -0.008    0.050   -0.105    0.089    1.000    normal(0,10)
  wEnj4 ~                                                                      
    wEff3            -0.002    0.047   -0.095    0.090    1.000    normal(0,10)
  wEnj5 ~                                                                      
    wEff4             0.007    0.066   -0.124    0.135    0.999    normal(0,10)
  wEnj6 ~                                                                      
    wEff5            -0.036    0.056   -0.146    0.075    1.000    normal(0,10)
  wEnj7 ~                                                                      
    wEff6             0.083    0.075   -0.067    0.227    1.000    normal(0,10)
  wEnj8 ~                                                                      
    wEff7             0.035    0.065   -0.088    0.164    1.000    normal(0,10)
  wEnj9 ~                                                                      
    wEff8            -0.052    0.068   -0.191    0.077    1.000    normal(0,10)
  wEnj10 ~                                                                    
    wEff9            -0.101    0.063   -0.230    0.019    1.000    normal(0,10)
  wEnj11 ~                                                                    
    wEff10            0.023    0.057   -0.090    0.137    1.000    normal(0,10)
  wEnj12 ~                                                                    
    wEff11           -0.022    0.087   -0.204    0.137    1.001    normal(0,10)
  wEnj13 ~                                                                    
    wEff12           -0.150    0.060   -0.276   -0.038    1.001    normal(0,10)


Covariances:
                   Estimate  Post.SD pi.lower pi.upper     Rhat    Prior      
 .postTest ~~                                                                  
   .game              2.846    0.824    1.341    4.550    0.999       beta(1,1)
 .preTest ~~                                                                  
   .preEnj            4.804    0.734    3.566    6.444    1.000       beta(1,1)
  wEnj1 ~~                                                                    
    wEff1            -0.174    0.147   -0.473    0.102    1.000       beta(1,1)
 .wEnj2 ~~                                                                    
   .wEff2            -0.087    0.062   -0.210    0.031    0.999       beta(1,1)
 .wEnj3 ~~                                                                    
   .wEff3            -0.113    0.072   -0.262    0.024    1.000       beta(1,1)
 .wEnj4 ~~                                                                    
   .wEff4            -0.064    0.057   -0.178    0.043    1.000       beta(1,1)
 .wEnj5 ~~                                                                    
   .wEff5            -0.044    0.066   -0.175    0.090    1.000       beta(1,1)
 .wEnj6 ~~                                                                    
   .wEff6            -0.117    0.058   -0.236   -0.009    1.001       beta(1,1)
 .wEnj7 ~~                                                                    
   .wEff7            -0.193    0.070   -0.340   -0.063    1.000       beta(1,1)
 .wEnj8 ~~                                                                    
   .wEff8            -0.186    0.068   -0.327   -0.060    1.000       beta(1,1)
 .wEnj9 ~~                                                                    
   .wEff9            -0.058    0.053   -0.161    0.043    1.000       beta(1,1)
 .wEnj10 ~~                                                                    
   .wEff10           -0.091    0.057   -0.212    0.018    1.000       beta(1,1)
 .wEnj11 ~~                                                                    
   .wEff11           -0.112    0.057   -0.230   -0.006    1.001       beta(1,1)
 .wEnj12 ~~                                                                    
   .wEff12           -0.015    0.069   -0.154    0.120    1.000       beta(1,1)
 .wEnj13 ~~                                                                    
   .wEff13           -0.015    0.074   -0.152    0.144    1.000       beta(1,1)
 .RIEnj ~~                                                                    
   .RIEff            -0.538    0.208   -0.992   -0.170    1.000       beta(1,1)


Intercepts:
                   Estimate  Post.SD pi.lower pi.upper     Rhat    Prior      
   .postTest          0.000                                                    
   .game              0.000                                                    
   .preTest           0.000                                                    
   .preEnj            0.000                                                    
   .postTest          7.767    1.004    6.024    9.935    0.999 gamma(1,.5)[sd]
   .game              8.999    1.188    6.985   11.625    1.000 gamma(1,.5)[sd]
   .preEnj            2.946    0.365    2.334    3.766    1.000 gamma(1,.5)[sd]
   .preTest          16.111    2.026   12.646   20.699    1.000 gamma(1,.5)[sd]
   .RIEnj             0.592    0.091    0.440    0.790    1.000 gamma(1,.5)[sd]
   .RIEff             4.372    0.672    3.225    5.805    1.000 gamma(1,.5)[sd]
    wEnj1             0.820    0.125    0.601    1.085    0.999 gamma(1,.5)[sd]
    wEff1             2.451    0.444    1.705    3.410    1.002 gamma(1,.5)[sd]
   .wEnj2             0.571    0.078    0.439    0.742    1.000 gamma(1,.5)[sd]
   .wEnj3             0.450    0.061    0.345    0.580    1.001 gamma(1,.5)[sd]
   .wEnj4             0.397    0.061    0.289    0.528    1.000 gamma(1,.5)[sd]
   .wEnj5             0.477    0.067    0.362    0.625    1.000 gamma(1,.5)[sd]
   .wEnj6             0.369    0.050    0.282    0.476    1.000 gamma(1,.5)[sd]
   .wEnj7             0.518    0.074    0.385    0.680    1.000 gamma(1,.5)[sd]
   .wEnj8             0.385    0.056    0.289    0.504    1.000 gamma(1,.5)[sd]
   .wEnj9             0.475    0.063    0.368    0.611    0.999 gamma(1,.5)[sd]
   .wEnj10            0.321    0.045    0.240    0.417    0.999 gamma(1,.5)[sd]
   .wEnj11            0.318    0.043    0.244    0.410    1.000 gamma(1,.5)[sd]
   .wEnj12            0.341    0.046    0.262    0.441    1.001 gamma(1,.5)[sd]
   .wEnj13            0.368    0.049    0.281    0.480    1.000 gamma(1,.5)[sd]
   .wEff2             0.752    0.099    0.586    0.970    0.999 gamma(1,.5)[sd]
   .wEff3             1.225    0.164    0.942    1.571    0.999 gamma(1,.5)[sd]
   .wEff4             0.747    0.114    0.544    0.992    1.000 gamma(1,.5)[sd]
   .wEff5             0.910    0.129    0.685    1.191    1.000 gamma(1,.5)[sd]
   .wEff6             0.936    0.140    0.698    1.236    1.001 gamma(1,.5)[sd]
   .wEff7             0.874    0.132    0.638    1.161    1.002 gamma(1,.5)[sd]
   .wEff8             1.132    0.167    0.834    1.489    1.000 gamma(1,.5)[sd]
   .wEff9             0.623    0.087    0.472    0.815    1.000 gamma(1,.5)[sd]
   .wEff10            0.974    0.133    0.752    1.268    1.001 gamma(1,.5)[sd]
   .wEff11            0.731    0.195    0.402    1.149    1.004 gamma(1,.5)[sd]
   .wEff12            1.069    0.307    0.436    1.633    1.003 gamma(1,.5)[sd]
   .wEff13            1.292    0.253    0.869    1.841    1.001 gamma(1,.5)[sd]

bnull.modelEnjEff <- lav_partable_independence(fit.RICLPMpoEnjEff) # need run lavaan

fit_bnullEnjEff <- blavaan(bnull.modelEnjEff, data = dat, target = "stan",
                           n.chains = 2, burnin = 200, sample = 1500, bcontrol = list(cores = 4), mcmcfile = TRUE)
modelfitEnjEfffull <- blavFitIndices(fit.RICLPMpoEnjEff, pD = c("loo", "waic","dic"), baseline.model = fit_bnullEnjEff)

> summary(modelfitEnjEfffull,prob=.95)
                        EAP Median   MAP    SD lower upper
BRMSEA       0.123  0.123 0.123 0.001 0.121 0.126
BGammaHat    0.727  0.727 0.728 0.004 0.720 0.735
adjBGammaHat 0.613  0.613 0.613 0.005 0.602 0.623
BMc          0.050  0.050 0.050 0.003 0.044 0.056
BCFI         0.803  0.803 0.803 0.004 0.795 0.810
BTLI         0.744  0.744 0.745 0.005 0.734 0.754
BNFI         0.737  0.737 0.738 0.003 0.731 0.744

Best,
Yuan

Mauricio Garnier-Villarreal

unread,
Apr 2, 2023, 5:57:14 PM4/2/23
to blavaan
Yuan

In general should be colse to teach other of the model is the same. I would recommend to use the function sem and bsem to make sure that the same underlying constraints are used. For example, I am not sure you are running the same model with the argument fixed.x=T . Can check with fitMeasures of the blavaan object to have the same npar as the lavaan object

Also, these fit indices should be compare to the "normal" indices not the MLR ones

Since you are not actually sunning a multiple group model what matters more is the total sample

Even with models like this, would recommended to use priors less wide as the deafult ones

Didnt you say in an earlier post that the CFI was higher?

ML is not neccesarily the "correct" answer, so replicating them is not the objective of BSEM. Differences in the parameters can also be related to the unrealistic expectation of ML that your 130 sample is asymototically correct (equivalent to infinetly large)

Yuanyuan Hu

unread,
Apr 3, 2023, 5:17:11 AM4/3/23
to blavaan
Hi Mauricio,

1) The argument fixed.x= T is used because I add groups as predictors. Otherwise, I got lavaan ERROR: unordered factor(s) detected; make them numeric or ordered: group1 group2
2)  previous model: the output of the blavaan object from my first email is higher and close to the fitMeasures of the lavaan object. After I closed R studio, I run the same model again, the model fit become worse and very different from the fitMeasures of the lavaan object. So I restarted R studio, tried many times, and still got different results.
3) I chose BSEM because my sample size is small and Bayesian estimation may work for small samples. I chose robust estimation in lavaan because the assumptions of normality is voilated and I have outliers. What do you think which analysis is better? I am thinking blavaan with default priors, blavaan with informative priors, lavaan with robust estimator etc.
4) the npar is different. What should I do?
lavaan: npar = 145
blavaan: npar = 115
> fitMeasures(fit.RICLPMpoEnjEff)
      npar       logl        ppp        bic        dic      p_dic       waic     p_waic    se_waic      looic
   115.000  -5560.341      0.000  11680.449  11343.411    111.364  11408.784    165.576    215.236  11409.930
     p_loo     se_loo margloglik
   166.149    215.418         NA 

5) sem in lavaan:   lavaan WARNING: fit measures not available if model did not converge
 bsem in blavaan:  took 1 hour to run the model and got many below warnings so I used blavaan instead of bsem.
Warning messages:
1: There were 3 divergent transitions after warmup. See
https://mc-stan.org/misc/warnings.html#divergent-transitions-after-warmup
to find out why this is a problem and how to eliminate them.
2: There were 7 transitions after warmup that exceeded the maximum treedepth. Increase max_treedepth above 10. See
https://mc-stan.org/misc/warnings.html#maximum-treedepth-exceeded
3: Examine the pairs() plot to diagnose sampling problems
 
4: The largest R-hat is NA, indicating chains have not mixed.

Running the chains for more iterations may help. See
https://mc-stan.org/misc/warnings.html#r-hat
5: Bulk Effective Samples Size (ESS) is too low, indicating posterior means and medians may be unreliable.

Running the chains for more iterations may help. See
https://mc-stan.org/misc/warnings.html#bulk-ess
6: Tail Effective Samples Size (ESS) is too low, indicating posterior variances and tail quantiles may be unreliable.

Running the chains for more iterations may help. See
https://mc-stan.org/misc/warnings.html#tail-ess
7: blavaan WARNING: As specified, the psi covariance matrix is neither diagonal nor unrestricted, so the actual prior might differ from the stated prior. See
 https://arxiv.org/abs/2301.08667 

I attached my code and data file if you would like to try it.

Many thanks!
Yuan

blavaan consultation 20230403.R
dataStudy4_3groups_R.xlsx

Mauricio Garnier-Villarreal

unread,
Apr 3, 2023, 8:25:55 AM4/3/23
to blavaan
Yuan

With MCMC the results will change a little bit between runs, due to MCMC error variability but should not change a lot.

The main difference is due to not be running the same model, as you have different number of parameters.

First, check between models and find what are the differences between them. Probably the fixed.x argument, you can give the same argument to blavaan and see if you get the same model. Can run it with very few iterations, just to see you have the right model.

Once you have the same model, I would recommend BSEM with weakly informative priors, these are good general applications for small sample sizes. Can get properly estimated models, that dont rely on the large sample assumption

Yuanyuan Hu

unread,
Apr 4, 2023, 11:34:25 AM4/4/23
to blavaan
After I added the argument meanstructure = T, int.ov.free = T in blavaan, the npar is the same and model fit becomes close. Thank you so much Mauricio!

Yuanyuan Hu

unread,
Apr 18, 2023, 3:15:46 AM4/18/23
to blavaan
Hi Mauricio,

If you don't mind, I have some questions on mediation with multiple dummy variables as independent variable. I am interested in whether enjoyment mediates the effects of the intervention (group, with 3 levels) on effort. 
1. If I add group as one predictor. I should check whether the indirect effect differs from zero. This is easy to understand. I tried and then group can not be a factor. Otherwise, I got the below Error. Is it possible to add group as one predictor? 
Error in lav_data_full(data = data, group = group, cluster = cluster,  :
  lavaan ERROR: unordered factor(s) with more than 2 levels detected as exogenous covariate(s): group

2. If I make three dummy variables for the group and add them as the predictors in mediation using the following code (e.g., group 0 is the reference group). Because a1 and a2  are the beta, compared with the reference group 0, how should I interpret the indirect effects? What should I report?

RIEnj ~ a1*group1 + a2*group2
RIEff ~ b1*RIEnj

RIEff ~ c11*group1 + c12*group2

# indirect Effect (a*b)
a1b1 := a1*b1
a2b1 := a2*b1

# total effect
tot_a1b1 := a1b1 + c11
tot_a2b1 := a2b1 + c12

Defined Parameters:

                         Estimate  Std.Err  z-value  P(>|z|)
    a1b1              0.094    0.099    0.943    0.346
    a2b1             -0.081    0.100   -0.812    0.417

Thank you in advance!
Yuan

Mauricio Garnier-Villarreal

unread,
Apr 20, 2023, 7:10:30 AM4/20/23
to blavaan
I dont usually use dummy variables as predictors like this. Because its hard to interpret what is the indirect effect and what is the indirect effect of the baseline groups. I would usually have group as a multiple group model, but that would be a moderation question, instead of mediation

These are the indirect effects of groups 2 compared to 0 group, and indirect of groups 3 to group 0. Not sure how meaningful this interpretation is?


Another option could be to include the 3 dummy code variables (no baseline group), and fixed the intercept of the outcome variables to 0. This way would estimate the paths for each group and you can define the difference between them. Havent use this approach for mediation, but I think it should work

Yuanyuan Hu

unread,
May 22, 2023, 6:39:27 AM5/22/23
to blavaan
Thank you Mauricio!

I am trying your suggestion by including 3 dummy variables (no baseline group), and fixed the intercept of the outcome variables to 0.  
Some issues:
1) What are the code for indirect effect and total effect? 
2) Do I need to fixed the intercept of covariates to 0 as well?
3) I ran the below code and got Warning messages:
1: In lav_mvnorm_missing_h1_estimate_moments(Y = X[[g]], wt = WT[[g]],  :
  lavaan WARNING:
    The smallest eigenvalue of the EM estimated variance-covariance
    matrix (Sigma) is smaller than 1e-05; this may cause numerical
    instabilities; interpret the results with caution.
2: In lavaan(fit.RICLPMRQ2EnjPaptest, data = dat, estimator = "MLR",  :
  lavaan WARNING:
    Model estimation FAILED! Returning starting values.

"
# direct effect a
#RIEnj ~ a1*group1 + a2*group2 + a0*group0

# direct effect b
RIEff ~ b1*RIEnj

# direct effect c
#RIEff ~ c11*group1 + c12*group2 + c10*group0

# covariate
preEnj ~ f1*group1 + f2*group2+ f0*group0
preTest ~ e1*group1 + e2*group2+ e0*group0

# indirect Effect (a*b)
?
# total effect  (a*b + c)
?

# fixed the intercept to 0
RIEnj ~ 0*1
RIEff ~ 0*1 
"

Best,
Yuan

Terrence Jorgensen

unread,
May 22, 2023, 4:57:56 PM5/22/23
to blavaan
Including a dummy code for each group is possible in OLS regression, but not in analyses of covariance structure (SEM).  The dummy codes are multicollinear: 1 of them equals 1 minus the sum of the others.  However, a multigroup model would be conceptually equivalent to having a dummy code for each group.  The effect of the grouping variable is reflected by differences in intercepts across groups.  


There are multiple indirect effects of a polytomous grouping variable, just like there are multiple direct effects (any pairwise comparison among the 3 groups).
You can find some lavaan example syntax in a power-analysis tutorial I coauthored:


Terrence D. Jorgensen    (he, him, his)
Assistant Professor, Methods and Statistics
Research Institute for Child Development and Education, the University of Amsterdam
http://www.uva.nl/profile/t.d.jorgensen


Yuanyuan Hu

unread,
May 25, 2023, 3:18:02 AM5/25/23
to blavaan
Oh,  I see there are two approaches:
1. Hayes and Preacher (2014) estimate the relative indirect effects.  a1 is the difference in intercepts between experimental 1 and control group; a2 is the difference in intercepts between experimental 2 and control group.  
I found a conflicting result: 1) a1, a2, and b differ from zero (there is mediation), but 2) a1b=0 and a2b=0 (no mediation).

2. multiple-group approach estimates group differences in indirect effect. 
Are the two approaches similar?



Yuanyuan Hu

unread,
Aug 16, 2023, 10:44:56 AM8/16/23
to blavaan

Hi Mauricio,


I am exploring the influence of priors. Some follow-up questions for weakly informative priors:

1. Specific priors for RI-CLPMs: do you have any recommendations on the values? 

e.g., NcNeish (2019; https://doi.org/10.1080/10705511.2019.1578657 suggested:

"Two-Level Dynamic Structural Equation Models with Small Samples

assuming stationarity, the magnitude of the autoregressive inertia paths from the outcome at time t – 1 to the outcome at time t must fall between −1 and 1"

"Inertia Slope Variance.—The inertia slope of the outcome (y at time t) autoregressed on the outcome at the immediately preceding time (y at time t – 1) cannot exceed 1, provided that the assumption of stationarity has been met."



2. How to set these specific priors in blavaan?

E.g., dp=dpriors(XX) , to specify Inertia Slope Variance (0,1) and autoregressive effect (-1, 1), what should XX be replaced?


3. How to do the posterior predictive checking? 

I tried the following code, but it took forever and still did not give any output...

AFIs <- ppmc(fit.RICLPMEnjEff, thin = 10, fit.measures = c("srmr","chisq","rmsea","cfi"))
summary(AFIs) 

Can we do something in blavaan that is similar to posterior predictive checking on the following website?

https://utrechtuniversity.github.io/BayesianEstimation/content/wednesday/prior_posterior_predictive_practical.html


Best,

Yuan

Mauricio Garnier-Villarreal

unread,
Aug 18, 2023, 5:57:05 AM8/18/23
to blavaan
Hi Yuan

This is an interesting issue, that brings severals ideas. I havent read the full paper

1. Check what they mean "Dynamic", as there is a disagremment of what constitutes a dynamic model. For example, what Mplus calls DSEM is no consider dynamic by mnay people in the field (me included). But thet have taken the name, creating confusion. I wouldnt consider RI-CLPM as dynamic model. Can check the work of Ood , Voeckle, Chow, Moleenar, Diver
2. Can do a prior predictive simulation to see what distirbutions are the prior stating, I made a tutorial about this for blavaan https://ecmerkle.github.io/blavaan/articles/prior_pred_checks.html
3. I Think yo can use dpriors(normal(0, 0.5)) as with this you would have a prior with 95% between -1 and 1. In Stan the recommend to not have strint boundaries (unless is absolutely neccesary), as these priors are easier for the sampler

hist(rnorm(100000, mean=0, sd=1))
hist(rnorm(100000, mean=0, sd=.5))
qnorm(c(.025, .975), mean=0, sd=.5)
pnorm(c(-1,1), mean=0, sd=.5)

4. You can check the function blavpredict for possible doing posterior predictive checks. The problem, is that PPC are easier and make more sense when you have a single outcome item, while in SEM we usually have factors, multiple indicatros, multiple outcomes etc. So, what is a "meanigngful" outcome becomes a harder question to answer. Could be useful if there is a clear easy answer to it.

Hope this helps

Ed Merkle

unread,
Aug 20, 2023, 12:37:21 PM8/20/23
to Yuanyuan Hu, blavaan

Yuanyuan,

A couple additions to Mauricio's response:

I imagine that you have multiple slopes in your model, and the dpriors() thing sets a prior distribution for all slopes. So you might want to use prior() inside the model specification syntax. See:

https://ecmerkle.github.io/blavaan/articles/prior.html#individual-parameters

About ppmc() taking a long time: this partly depends on your model. If you have many columns in your data and/or missing data, it will take longer. I believe that future::plan("multicore") can help here (or "multisession" on windows), but it might still take awhile.

Ed


On Wed, 2023-08-16 at 07:44 -0700, Yuanyuan Hu wrote:


Hi Mauricio,
>
I am exploring the influence of priors. Some follow-up questions for
> weakly informative priors:
> 1. Specific priors for RI-CLPMs: do you have any recommendations on
> the values? 
> e.g., NcNeish

> "Two-Level Dynamic Structural Equation Models with Small Samples
> assuming stationarity, the magnitude of the autoregressive inertia
> paths from the outcome at time t – 1 to the outcome at time t must
> fall between −1 and 1"
> "Inertia Slope Variance.—The inertia slope of the outcome (y at time
> t) autoregressed on the outcome at the immediately preceding time (y
> at time t – 1) cannot exceed 1, provided that the assumption of
> stationarity has been met."
>  *
>  *
> 2. How to set these specific priors in blavaan?
> E.g., dp=dpriors(XX) , to specify Inertia Slope Variance (0,1)
> and autoregressive effect (-1, 1), what should XX be replaced?
>
3. How to do the posterior predictive checking? 
> I tried the following code, but it took forever and still did not
> give any output...
> AFIs <- ppmc(fit.RICLPMEnjEff, thin = 10, fit.measures =
> c("srmr","chisq","rmsea","cfi"))
> summary(AFIs) 
> Can we do something in blavaan that is similar to posterior
> predictive checking on the following website?

> 在2023年4月3日星期一 UTC+2 14:25:55<[mauga...@gmail.com](mailto:mauga...@gmail.com)> 写道:
> > > Yuan
> > > >
> > With MCMC the results will change a little bit between runs, due to
> > MCMC error variability but should not change a lot.
> > > >
> > The main difference is due to not be running the same model, as you
> > have different number of parameters.
> > > >
> > First, check between models and find what are the differences
> > between them. Probably the fixed.x argument, you can give the same
> > argument to blavaan and see if you get the same model. Can run it
> > with very few iterations, just to see you have the right model.
> > > >
> > Once you have the same model, I would recommend BSEM with weakly
> > informative priors, these are good general applications for small
> > sample sizes. Can get properly estimated models, that dont rely on
> > the large sample assumption
> > > >
> >
> >
> > On Monday, April 3, 2023 at 11:17:11 AM UTC+2 [huyy...@gmail.com](mailto:huyy...@gmail.com)

> > > > > > > to find out why this is a problem and how to eliminate them.
> > > > > > > 2: There were 7 transitions after warmup that exceeded the
> > > maximum treedepth. Increase max_treedepth above 10. See

> > > > > > > 3: Examine the pairs() plot to diagnose sampling problems
> > > > > > >  
> > > > > > > 4: The largest R-hat is NA, indicating chains have not mixed.
> > > > > > >
> > > > Running the chains for more iterations may help. See
> > > > > > > 5: Bulk Effective Samples Size (ESS) is too low, indicating
> > > posterior means and medians may be unreliable.
> > > > > > >
> > > > Running the chains for more iterations may help. See
> > > > > > > 6: Tail Effective Samples Size (ESS) is too low, indicating
> > > posterior variances and tail quantiles may be unreliable.
> > > > > > >
> > > > Running the chains for more iterations may help. See
> > > > > > > 7: blavaan WARNING: As specified, the psi covariance matrix is
> > > neither diagonal nor unrestricted, so the actual prior might
> > > differ from the stated prior. See

> > > > > > >
> > > > I attached my code and data file if you would like to try it.
> > > > > > >
> > > > Many thanks!
> > > > > > > Yuan
> > > > > > >
> > > > 在2023年4月2日星期日 UTC+2 23:57:14<[mauga...@gmail.com](mailto:mauga...@gmail.com)> 写道:
> > > > > > > > > Yuan
> > > > > > > > > >
> > > > > > In general should be colse to teach other of the model is the
> > > > same. I would recommend to use the function sem and bsem to
> > > > make sure that the same underlying constraints are used. For
> > > > example, I am not sure you are running the same model with the
> > > > argument fixed.x=T . Can check with fitMeasures of the blavaan
> > > > object to have the same npar as the lavaan object
> > > > > > > > > >
> > > > > > Also, these fit indices should be compare to the "normal"
> > > > indices not the MLR ones
> > > > > > > > > >
> > > > > > Since you are not actually sunning a multiple group model what
> > > > matters more is the total sample
> > > > > > > > > >
> > > > > > Even with models like this, would recommended to use priors
> > > > less wide as the deafult ones
> > > > > > > > > >
> > > > > > Didnt you say in an earlier post that the CFI was higher?
> > > > > > > > > >
> > > > > > ML is not neccesarily the "correct" answer, so replicating them
> > > > is not the objective of BSEM. Differences in the parameters can
> > > > also be related to the unrealistic expectation of ML that your
> > > > 130 sample is asymototically correct (equivalent to infinetly
> > > > large)
> > > > > > > > > >
> > > > > >
> > > > > >
> > > > > > On Sunday, April 2, 2023 at 8:46:50 PM UTC+2 [huyy...@gmail.com](mailto:huyy...@gmail.com)
> > > > > > > > > > > > > 在2023年3月30日星期四 UTC+2 15:12:18<[mauga...@gmail.com](mailto:mauga...@gmail.com)> 写道:
> > > > > > > > > > > > > > > You can use the BSEM fit indices paper, we have a section
> > > > > > about the interpretation of the indices and how the cutoffs
> > > > > > cannot be generalized, and you can see the otehr references
> > > > > > in that section
> > > > > > > > > > > > > > > > This is a general problem of a bad practice has become
> > > > > > common.
> > > > > > > > > > > > > > > >
> > > > > > > > > > What is "acceptable" is such a qualitative interpretation
> > > > > > that generalized the 0.9 is silly. Sorry I dont have a
> > > > > > better solution to handle reviewers
> > > > > > > > > > > > > > > >
> > > > > > > > > > On Wednesday, March 29, 2023 at 5:33:47 PM UTC+2
> > > > > > [huyy...@gmail.com](mailto:huyy...@gmail.com) wrote:
> > > > > > > > > > > > > > > > > > Running the model with lavaan and using its modification
> > > > > > > indices is indeed a fast solution. 
> > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > I tried the possible modification indices but the
> > > > > > > gammaHat is still below .900. You recommended to report
> > > > > > > gammaHat and BCFI. What if the reviewers are very
> > > > > > > critical about the the cutoff value, do you have any
> > > > > > > references that I can cite to say in this case, the model
> > > > > > > fit is acceptable?
> > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > Many thanks!
> > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > 在2023年3月29日星期三 UTC+2 16:36:08<[mauga...@gmail.com](mailto:mauga...@gmail.com)> 写道:
> > > > > > > > > > > > > > > > > > > > > Yuan
> > > > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > 1. 10000 is an overkill, if 1500 is enough to not get
> > > > > > > > the ESS warnings you are fine. It would only be
> > > > > > > > neccesary to have sucha a large sample for bayes factor
> > > > > > > > estabilibility. But not for inferences etc
> > > > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > 2. Yes, that is a warning not a problematic error
> > > > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > 3. Sadly, that is a know problem with modification
> > > > > > > > indices, they can take a while for large models, as it
> > > > > > > > is estimating the lavaan indices 600 time for example.
> > > > > > > > If R is still running I would let it run a for a bot.
> > > > > > > > or you can increase thin so that it estimates it less
> > > > > > > > times
> > > > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > out <- ppmc(fit.RICLPMpoCogEnjEff, thin=8, discFUN =

> > > > > > > > discFUN)
> > > > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > as a last resort, you can run the model with lavaan and
> > > > > > > > use its modification indices. They should not point to
> > > > > > > > different parameters. Honetsly I am not sure what would
> > > > > > > > be recommended as added parameters in this model with
> > > > > > > > so many constraints
> > > > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > On Wednesday, March 29, 2023 at 3:37:59 PM UTC+2
> > > > > > > > [huyy...@gmail.com](mailto:huyy...@gmail.com) wrote:
> > > > > > > > > > > > > > > > > > > > > > > > Thank you Mauricio! 
> > > > > > > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > Sample: 
> > > > > > > > > > > > > > > > > > > > > > > > > 1). When sample = 500, I got below warnings so I
> > > > > > > > > increased sample =1500. I was planning to use sample
> > > > > > > > > =10000 (which takes 40 mins each run) in the final
> > > > > > > > > reporting. Perhaps no need to be so high?
> > > > > > > > > > > > > > > > > > > > > > > > > 3: Bulk Effective Samples Size (ESS) is too low,
> > > > > > > > > indicating posterior means and medians may be
> > > > > > > > > unreliable.
> > > > > > > > > > > > > > > > > > > > > > > > > Running the chains for more iterations may help. See
> > > > > > > > > > > > > > > > > > > > > > > > > 4: Tail Effective Samples Size (ESS) is too low,
> > > > > > > > > indicating posterior variances and tail quantiles may
> > > > > > > > > be unreliable.
> > > > > > > > > > > > > > > > > > > > > > > > > Running the chains for more iterations may help. See

> > > > > > > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > 2) When sample = 1500, I also got below warning. I
> > > > > > > > > checked suggestions in this group, it seems that  I
> > > > > > > > > can ignore this warning?
> > > > > > > > > > > > > > > > > > > > > > > > > blavaan WARNING: As specified, the psi covariance
> > > > > > > > > matrix is neither diagonal nor unrestricted, so the
> > > > > > > > > actual prior might differ from the stated prior. See
> > > > > > > > > > > > > > > > > > > > > > > > >  [https://arxiv.org/abs/2301.08667](https://arxiv.org/abs/2301.08667) 
> --
> You received this message because you are subscribed to the Google
> Groups "blavaan" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to [blavaan+u...@googlegroups.com](mailto:blavaan+u...@googlegroups.com).
> To view this discussion on the web visit
> [https://groups.google.com/d/msgid/blavaan/94e0ab73-591c-4c87-ae76-62575c9deaf5n%40googlegroups.com](https://groups.google.com/d/msgid/blavaan/94e0ab73-591c-4c87-ae76-62575c9deaf5n%40googlegroups.com).

Yuanyuan Hu

unread,
Sep 11, 2023, 9:53:33 AM9/11/23
to blavaan

Thank you!

Setting priors are too complex for my model. So, I have to leave it for now. I am exploring another model with moderation. But got errors:
Chain 1: Exception: Exception: invese_spd: LDLT factor failed   (in 'model_stanmarg' at line 384)
  (in 'model_stanmarg' at line 1835)

Chain 2: Exception: Exception: invese_spd: LDLT factor failed   (in 'model_stanmarg' at line 384)
  (in 'model_stanmarg' at line 1835)

How to solve this?

Best,
Yuan

Mauricio Garnier-Villarreal

unread,
Sep 12, 2023, 6:51:04 AM9/12/23
to blavaan
Yuan

we would need you to share more details, to see what is the problem

with blavaan, i think for now the only way to include moderation is with the indicator product approach, can check the function indprod() from semTools to see an example in lavaan

Yuanyuan Hu

unread,
Sep 12, 2023, 8:16:50 AM9/12/23
to blavaan

Hi Mauricio,


I attached my code here and datafile (via WeTransfer, it's too big to attach here). The mdoerator is sex (binary: 1=male, 0=female). The predictor is my intervention (multicategorical, 3 groups, 0=neutral state, 1=enjoyment, 2=frustration). The outcomes are Enj, Eff, postTest, game. The model works under lavaan, but got the errors under blavaan.

The code for moderation:

RIEnj ~ d1*sex1
RIEnj ~ m11*sex1:group1 + m12*sex1:group2
RIEff ~ d2*sex1
RIEff ~ m21*sex1:group1 + m22*sex1:group2


Best,

Yuan

test gender 20230912.R

Ed Merkle

unread,
Sep 12, 2023, 10:07:53 AM9/12/23
to Yuanyuan Hu, blavaan
Yuan,

Regarding this error:

On Mon, 2023-09-11 at 06:53 -0700, Yuanyuan Hu wrote:
Chain 1: Exception: Exception: invese_spd: LDLT factor failed   (in 'model_stanmarg' at line 384)
  (in 'model_stanmarg' at line 1835)

I recently made an improvement on github so that you should see fewer of these messages. If you only see this during the burnin/warmup period, you should have nothing to worry about. It can happen when the sampler has not yet converged to the posterior distribution and is currently evaluating the model at "bad" parameter values. Though it is also possible after burnin/warmup, possibly due to lack of model convergence or to non-positive definite covariance matrices.

About the model code that you sent: I am not sure that the ":" syntax will work correctly in blavaan. I haven't tested that operator so much, though it might work ok...

Ed

Yuanyuan Hu

unread,
Sep 24, 2023, 1:13:03 PM9/24/23
to blavaan
Thank you!

This error comes lines after lines forever, not in the burn-in stage. I think the model may not converge. Under lavaan, there is indeed warning about non-positive definite covariance matrices.  
":" is an example of adding moderation in lavaan. How to test whether ":" work in blavaan?

Ed Merkle

unread,
Sep 25, 2023, 6:32:31 PM9/25/23
to Yuanyuan Hu, blavaan
The ":" operator appears to work in blavaan for simple examples. I am suspecting that the model specification syntax is problematic here, especially because lavaan is also having non-positive definite covariance matrices. 

I would advise to fit simpler versions of the model and work your way up to the full model. For example, it seems that you could start with a measurement model that excludes some of the regressions and lagged effects and within-person centering. Then re-add them once you are happy that the simpler model is working ok. You might also be able to make use of the new two-level functionality in blavaan 0.5-1, because it looks like you are using a random intercept.

Ed
--
You received this message because you are subscribed to the Google Groups "blavaan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blavaan+u...@googlegroups.com.

Mauricio Garnier-Villarreal

unread,
Sep 28, 2023, 5:46:55 AM9/28/23
to blavaan
Yuan

would it make sense to run the analysis as a multiple group, instead if regression approach for the interaction tests? This could be done, and regularize it for smaller groups

Yuanyuan Hu

unread,
Oct 3, 2023, 8:32:30 AM10/3/23
to blavaan
Thanks Ed!
I updated to the latest version and those errors disappear 😊

For two-level functionality, the tutorials  suggest to add level = 1 or level 2. But where should I add them? 

Yuanyuan Hu

unread,
Oct 3, 2023, 8:36:54 AM10/3/23
to blavaan

Thanks Mauricio!

It makes sense but is not handy practically. Because I have three groups, it's difficult to test specific hypotheses with inequality constraints (e.g., group 1 > group 2 > group3).

Mauricio Garnier-Villarreal

unread,
Oct 4, 2023, 6:37:16 AM10/4/23
to blavaan
Yuan

Actually I think it is easier with multiple groups, but not with the same logic of testing as in frequentist methods. I guess you are thinking on adding the inequality constraints and then compared the models and see how much "better" a model with or without the constraints. This is the same logic as in frequentist methods.

But within Bayesian, we actually dont need to use constraints for hypothesis. Once you have a multiple group model, you can extract the posterior distributions of the groups means, and estimate the posterior distribution of the difference between them (leading to ordered constraints of how much "larger" is one group over another). The objective being to estimate proper distributions for the hypothesis of interest, and the "hypothesis" is done by inter[reting these posterior distributions

take care

Yuanyuan Hu

unread,
Mar 19, 2024, 11:00:05 PM3/19/24
to blavaan
Hi Mauricio, Ed, Terrence,

A following up question for RI-CLPMs: If I specify constraints on the standardized auto-regressive and cross-lagged relations over time, following the below website:

Then I got an error. I googled but couldn't find the solution...
SAMPLING FOR MODEL 'stanmarg' NOW (CHAIN 1).
Chain 1: Unrecoverable error evaluating the log probability at the initial value.
Chain 1: Exception: normal_lpdf: Random variable has size = 58, but Location parameter has size 14; and they must be the same size. (in 'stanmarg', line 1436, column 2 to column 48)
[1] "Error : Exception: normal_lpdf: Random variable has size = 58, but Location parameter has size 14; and they must be the same size. (in 'stanmarg', line 1436, column 2 to column 48)"
[2] "In addition: Warning message:"                                                                                                                                                      
[3] "In lav_data_full(data = data, group = group, cluster = cluster,  :"                                                                                                                  
[4] "  lavaan WARNING: 1 cases were deleted due to missing values in "                                                                                                                    
[5] "\t\t  exogenous variable(s), while fixed.x = TRUE."                                                                                                                                  
error occurred during calling 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




Below is my code:
fit.RICLPMConstraintsEnjMap <- '
RIEnj ~ a1*Manip1 + a2*Manip2

# direct Mapect
RIMap ~ c11*Manip1 + c12*Manip2

# add Manip (use Manip0 as reference)
preMap ~ f1*Manip1 + f2*Manip2
preEnj ~ e1*Manip1 + e2*Manip2


# add covariates z1
# 1b) Regression of random intercepts on time-invariant predictor z1
RIEnj ~ preEnj
RIMap ~ preMap


# Residual variance and covariance z1
preEnj ~~ preEnj
preMap ~~ preMap
preEnj ~~ preMap

# Create between components (random intercepts)
RIEnj =~ 1*Enj1+1*Enj2+1*Enj3+1*Enj4+1*Enj5+1*Enj6+1*Enj7+1*Enj8+1*Enj9+1*Enj10+1*Enj11+1*Enj12+1*Enj13
RIMap =~ 1*Map1+1*Map2+1*Map3+1*Map4+1*Map5+1*Map6+1*Map7+1*Map8+1*Map9+1*Map10+1*Map11+1*Map12+1*Map13

# Create within-components with freely estimated factor loadings
wEnj1 =~ NA*Enj1
wEnj2 =~ NA*Enj2
wEnj3 =~ NA*Enj3
wEnj4 =~ NA*Enj4
wEnj5 =~ NA*Enj5
wEnj6 =~ NA*Enj6
wEnj7 =~ NA*Enj7
wEnj8 =~ NA*Enj8
wEnj9 =~ NA*Enj9
wEnj10 =~ NA*Enj10
wEnj11 =~ NA*Enj11
wEnj12 =~ NA*Enj12
wEnj13 =~ NA*Enj13

wMap1 =~ NA*Map1
wMap2 =~ NA*Map2
wMap3 =~ NA*Map3
wMap4 =~ NA*Map4
wMap5 =~ NA*Map5
wMap6 =~ NA*Map6
wMap7 =~ NA*Map7
wMap8 =~ NA*Map8
wMap9 =~ NA*Map9
wMap10 =~ NA*Map10
wMap11 =~ NA*Map11
wMap12 =~ NA*Map12
wMap13 =~ NA*Map13

# Estimate lagged Mapects between within-person centered variables (constrained)
# auto-regression Mapect
wEnj2 ~ a*wEnj1
wEnj3 ~ a*wEnj2
wEnj4 ~ a*wEnj3
wEnj5 ~ a*wEnj4
wEnj6 ~ a*wEnj5
wEnj7 ~ a*wEnj6
wEnj8 ~ a*wEnj7
wEnj9 ~ a*wEnj8
wEnj10 ~ a*wEnj9
wEnj11 ~ a*wEnj10
wEnj12 ~ a*wEnj11
wEnj13 ~ a*wEnj12

wMap2 ~ b*wMap1
wMap3 ~ b*wMap2
wMap4 ~ b*wMap3
wMap5 ~ b*wMap4
wMap6 ~ b*wMap5
wMap7 ~ b*wMap6
wMap8 ~ b*wMap7
wMap9 ~ b*wMap8
wMap10 ~ b*wMap9
wMap11 ~ b*wMap10
wMap12 ~ b*wMap11
wMap13 ~ b*wMap12

# cross-lagged Mapects
wEnj2 ~ c*wMap1
wEnj3 ~ c*wMap2
wEnj4 ~ c*wMap3
wEnj5 ~ c*wMap4
wEnj6 ~ c*wMap5
wEnj7 ~ c*wMap6
wEnj8 ~ c*wMap7
wEnj9 ~ c*wMap8
wEnj10 ~ c*wMap9
wEnj11 ~ c*wMap10
wEnj12 ~ c*wMap11
wEnj13 ~ c*wMap12

wMap2 ~ d*wEnj1
wMap3 ~ d*wEnj2
wMap4 ~ d*wEnj3
wMap5 ~ d*wEnj4
wMap6 ~ d*wEnj5
wMap7 ~ d*wEnj6
wMap8 ~ d*wEnj7
wMap9 ~ d*wEnj8
wMap10 ~ d*wEnj9
wMap11 ~ d*wEnj10
wMap12 ~ d*wEnj11
wMap13 ~ d*wEnj12


# Estimate covariances between residuals of within-person centered variables
# (i.e., innovations, constrained)
wEnj2 ~~ rcov2*wMap2
wEnj3 ~~ rcov3*wMap3
wEnj4 ~~ rcov4*wMap4
wEnj5 ~~ rcov5*wMap5
wEnj6 ~~ rcov6*wMap6
wEnj7 ~~ rcov7*wMap7
wEnj8 ~~ rcov8*wMap8
wEnj9 ~~ rcov9*wMap9
wEnj10 ~~ rcov10*wMap10
wEnj11 ~~ rcov11*wMap11
wEnj12 ~~ rcov12*wMap12
wEnj13 ~~ rcov13*wMap13


# Estimate covariance between within-person centered variables at first wave
wEnj1 ~~ cor1*wMap1 # Covariance


# Estimate variance and covariance of random intercepts
RIEnj ~~ RIEnj
RIMap ~~ RIMap
RIMap ~~ RIEnj

# Set variances of within-components at first wave to 1
wEnj1 ~~ 1*wEnj1 # Variances
wMap1 ~~ 1*wMap1


# Estimate (residual) variance of within-person centered variables
wEnj2 ~~ rvEnj2*wEnj2 # Residual variances
wEnj3 ~~ rvEnj3*wEnj3
wEnj4 ~~ rvEnj4*wEnj4
wEnj5 ~~ rvEnj5*wEnj5
wEnj6 ~~ rvEnj6*wEnj6
wEnj7 ~~ rvEnj7*wEnj7
wEnj8 ~~ rvEnj8*wEnj8
wEnj9 ~~ rvEnj9*wEnj9
wEnj10 ~~ rvEnj10*wEnj10
wEnj11 ~~ rvEnj11*wEnj11
wEnj12 ~~ rvEnj12*wEnj12
wEnj13 ~~ rvEnj13*wEnj13

wMap2 ~~ rvMap2*wMap2
wMap3 ~~ rvMap3*wMap3
wMap4 ~~ rvMap4*wMap4
wMap5 ~~ rvMap5*wMap5
wMap6 ~~ rvMap6*wMap6
wMap7 ~~ rvMap7*wMap7
wMap8 ~~ rvMap8*wMap8
wMap9 ~~ rvMap9*wMap9
wMap10 ~~ rvMap10*wMap10
wMap11 ~~ rvMap11*wMap11
wMap12 ~~ rvMap12*wMap12
wMap13 ~~ rvMap13*wMap13

# Compute corEnjation of within-components at each wave
cor2 := b*d + a*d*cor1 + rcov2
cor3 := b*d + a*d*cor2 + rcov3
cor4 := b*d + a*d*cor3 + rcov4
cor5 := b*d + a*d*cor4 + rcov5
cor6 := b*d + a*d*cor5 + rcov6
cor7 := b*d + a*d*cor6 + rcov7
cor8 := b*d + a*d*cor7+ rcov8
cor9 := b*d + a*d*cor8 + rcov9
cor10 := b*d + a*d*cor9 + rcov10
cor11 := b*d + a*d*cor10 + rcov11
cor12 := b*d + a*d*cor11 + rcov12
cor13 := b*d + a*d*cor12 + rcov13

# Contrain residual variances of within-components such that variance of each
# within-component equals 1
rvEnj2 == 1 - (a*a + b*b + 2*a*b*cor1)
rvEnj3 == 1 - (a*a + b*b + 2*a*b*cor2)
rvEnj4 == 1 - (a*a + b*b + 2*a*b*cor3)
rvEnj5 == 1 - (a*a + b*b + 2*a*b*cor4)
rvEnj6 == 1 - (a*a + b*b + 2*a*b*cor5)
rvEnj7 == 1 - (a*a + b*b + 2*a*b*cor6)
rvEnj8 == 1 - (a*a + b*b + 2*a*b*cor7)
rvEnj9 == 1 - (a*a + b*b + 2*a*b*cor8)
rvEnj10 == 1 - (a*a + b*b + 2*a*b*cor9)
rvEnj11 == 1 - (a*a + b*b + 2*a*b*cor10)
rvEnj12 == 1 - (a*a + b*b + 2*a*b*cor11)
rvEnj13 == 1 - (a*a + b*b + 2*a*b*cor12)

rvMap2 == 1 - (d*d)
rvMap3 == 1 - (d*d)
rvMap4 == 1 - (d*d)
rvMap5 == 1 - (d*d)
rvMap6 == 1 - (d*d)
rvMap7 == 1 - (d*d)
rvMap8 == 1 - (d*d)
rvMap9 == 1 - (d*d)
rvMap10 == 1 - (d*d)
rvMap11 == 1 - (d*d)
rvMap12 == 1 - (d*d)
rvMap13 == 1 - (d*d)
'
fit.RICLPMConstraintsEnjMap <- blavaan(fit.RICLPMConstraintsEnjMap, data=dat,target = "stan",   meanstructure = T, # add the intercepts or means of the observed variables
                                       fixed.x = TRUE,int.ov.free = T,
                                       n.chains = 2, burnin = 200, sample = 2000, bcontrol = list(cores = 4), mcmcfile = TRUE)
summary(fit.RICLPMConstraintsEnjMap)

Best,
Yuan


Ed Merkle

unread,
Mar 20, 2024, 2:48:30 PM3/20/24
to Yuanyuan Hu, blavaan
Yuan,

I would guess that the "==" lines near the bottom are causing problems. target = "stan" cannot handle these sorts of parameter equality constraints. You might try target = "jags" here.

Ed

Yuanyuan Hu

unread,
Mar 20, 2024, 10:40:02 PM3/20/24
to blavaan
Thanks Ed!

Yes, it works! But I got new warnings. Any suggestions?

fit.RICLPMConstraintsEnjMap <- blavaan(fit.RICLPMConstraintsEnjMap, data=dat,target = "jags", test = "none",
                                       fixed.x = TRUE,int.ov.free = T, std.lv=TRUE,
                                       n.chains = 2, burnin = 200, sample = 2000, mcmcfile = TRUE)
summary(fit.RICLPMConstraintsEnjMap)

blavaan 0.5.3.1246 did NOT end normally after 2000 iterations
** WARNING ** Estimates below are most likely unreliable

# Warning messages:
  1: In lav_data_full(data = data, group = group, cluster = cluster,  :

                        lavaan WARNING: 1 cases were deleted due to missing values in
                      exogenous variable(s), while fixed.x = TRUE.
                      2: blavaan WARNING: at least one parameter has a rhat > 1.2.
                      3: blavaan WARNING: Small effective sample sizes (< 100) for some parameters. 

blavaan NOTE: The variance of variable Enj1 in group 1 has been fixed to .001 instead of 0 (necessary for conditional model specification).

blavaan NOTE: The variance of variable Enj2 in group 1 has been fixed to .001 instead of 0 (necessary for conditional model specification).

blavaan NOTE: The variance of variable Enj3 in group 1 has been fixed to .001 instead of 0 (necessary for conditional model specification).

blavaan NOTE: The variance of variable Enj4 in group 1 has been fixed to .001 instead of 0 (necessary for conditional model specification).

blavaan NOTE: The variance of variable Enj5 in group 1 has been fixed to .001 instead of 0 (necessary for conditional model specification).

blavaan NOTE: The variance of variable Enj6 in group 1 has been fixed to .001 instead of 0 (necessary for conditional model specification).

blavaan NOTE: The variance of variable Enj7 in group 1 has been fixed to .001 instead of 0 (necessary for conditional model specification).

blavaan NOTE: The variance of variable Enj8 in group 1 has been fixed to .001 instead of 0 (necessary for conditional model specification).

blavaan NOTE: The variance of variable Enj9 in group 1 has been fixed to .001 instead of 0 (necessary for conditional model specification).

blavaan NOTE: The variance of variable Enj10 in group 1 has been fixed to .001 instead of 0 (necessary for conditional model specification).

blavaan NOTE: The variance of variable Enj11 in group 1 has been fixed to .001 instead of 0 (necessary for conditional model specification).

blavaan NOTE: The variance of variable Enj12 in group 1 has been fixed to .001 instead of 0 (necessary for conditional model specification).

blavaan NOTE: The variance of variable Enj13 in group 1 has been fixed to .001 instead of 0 (necessary for conditional model specification).

blavaan NOTE: The variance of variable Map1 in group 1 has been fixed to .001 instead of 0 (necessary for conditional model specification).

blavaan NOTE: The variance of variable Map2 in group 1 has been fixed to .001 instead of 0 (necessary for conditional model specification).

blavaan NOTE: The variance of variable Map3 in group 1 has been fixed to .001 instead of 0 (necessary for conditional model specification).

blavaan NOTE: The variance of variable Map4 in group 1 has been fixed to .001 instead of 0 (necessary for conditional model specification).

blavaan NOTE: The variance of variable Map5 in group 1 has been fixed to .001 instead of 0 (necessary for conditional model specification).

blavaan NOTE: The variance of variable Map6 in group 1 has been fixed to .001 instead of 0 (necessary for conditional model specification).

blavaan NOTE: The variance of variable Map7 in group 1 has been fixed to .001 instead of 0 (necessary for conditional model specification).

blavaan NOTE: The variance of variable Map8 in group 1 has been fixed to .001 instead of 0 (necessary for conditional model specification).

blavaan NOTE: The variance of variable Map9 in group 1 has been fixed to .001 instead of 0 (necessary for conditional model specification).

blavaan NOTE: The variance of variable Map10 in group 1 has been fixed to .001 instead of 0 (necessary for conditional model specification).

blavaan NOTE: The variance of variable Map11 in group 1 has been fixed to .001 instead of 0 (necessary for conditional model specification).

blavaan NOTE: The variance of variable Map12 in group 1 has been fixed to .001 instead of 0 (necessary for conditional model specification).

blavaan NOTE: The variance of variable Map13 in group 1 has been fixed to .001 instead of 0 (necessary for conditional model specification).

Best,
Yuan

Ed Merkle

unread,
Mar 20, 2024, 11:00:51 PM3/20/24
to Yuanyuan Hu, blavaan
The notes about "variance fixed to .001" should not be a problem, so long as the variance of each of your variables is not close to 0.

The other warnings say that the model did not converge. The first thing I would do is consider the prior distributions that you are using by looking at the dpriors(target = "jags") command. Those are fairly uninformative, and I would tailor those priors to be mildly informative for your dataset. Some further information is here:


Ed
Reply all
Reply to author
Forward
0 new messages