1
$\begingroup$

I have a blavaan object such that

fit <- blavaan(semmodel, data, prior)

how to get BCFI and BRMSEA of fit??

I can get

>>fitMeasures(fit)

  npar       logl        ppp        bic        dic      p_dic       waic     p_waic    se_waic      looic 
40.000  -1180.071      0.000   2539.688   2424.244     32.051   2452.604     55.668    104.197   2454.368 
 p_loo     se_loo margloglik 
56.551    104.638  -1296.886 

these kind of things. but i need to get cfi and rmsea.. plz help me.

$\endgroup$

1 Answer 1

1
$\begingroup$

You will get the BRMSEA and the BCFI. You must fit the null model:

Example:

## Not run: 
HS.model <- ' visual  =~ x1 + x2 + x3
              textual =~ x4 + x5 + x6
              speed   =~ x7 + x8 + x9 '
## fit target model
fit1 <- bcfa(HS.model, data = HolzingerSwineford1939, cp = "fa",
             n.chains = 2, burnin = 1000, sample = 1000)

## fit null model to calculate CFI, TLI, and NFI
null.model <- c(paste0("x", 1:9, " ~~ x", 1:9), paste0("x", 1:9, " ~ 1"))
fit0 <- bcfa(null.model, data = HolzingerSwineford1939, cp = "fa",
             n.chains = 2, burnin = 1000, sample = 1000)

## The default method mimics fit indices derived from ML estimation
blavFitIndices(fit1, baseline.model = fit0)

Warning messages:
1: 
10 (3.3%) p_waic estimates greater than 0.4. We recommend trying loo instead. 
2: 
3 (1.0%) p_waic estimates greater than 0.4. We recommend trying loo instead. 

Posterior mean (EAP) of devm-based fit indices:

      BRMSEA    BGammaHat adjBGammaHat          BMc         BCFI         BTLI         BNFI 
       0.098        0.957        0.890        0.903        0.930        0.884        0.910 
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.