Hello all,
I am currently running a regression model with 4 exogenous observed variables and 1 observed endogenous outcome. To check Bayesian fit indices I came across the following error/warning when running the code of the fit-object for the null model.
Error in
blavaan(B_NullModel, data = DataWiL_Gr3_merged, fixed.x = TRUE, :
Error
in stanmarg_data(Ng = 1L, ord = 0, multilev = FALSE, N = 84L, miss = 1L,
:
blavaan ERROR: nrow(YX) != Ntot.
In
addition: Warning message:
lavaan->lav_data_full():
some
cases are empty and will be ignored: 1 3 4 9 12 13 23 30 32 34 44 51 58 74 76
79 83 86 88 90
91 92 107 108 109 110 111 112 113 114.
These cases indeed have missing values for the outcome variable, thus that part I understand.
What I am wondering is whether the calculation of the Bayesian fit indices is influenced by the fact that the regression model is ran on 113 observations, while the null model is ran on 83. So, can I trust these fit indices or should I run the regression model on the 83 cases for which I have complete data (a.k.a. remove all cases with missing data) to have the exact same sample for the null model and the main regression model?
I used the following code to compute the fit indices:
ff_dv <- blavFitIndices(fitBayesMod, baseline.model = fit_nullMod, pD = "loo", rescale = "devM")
ff_dv
summary(ff_dv)
sm_dv <- summary(ff_dv, central.tendency = "mean")
sm_dv
The fit measures look as follows:
Posterior summary statistics and highest posterior density (HPD)
90% credible intervals for devm-based fit indices:
EAP Median MAP SD lower upper
BRMSEA 0.000 0.000 -0.001 0.000 0.000 0.000
BGammaHat 1.000 1.000 0.999 0.000 1.000 1.000
adjBGammaHat 1.000 1.000 0.999 0.000 1.000 1.000
BMc 1.000 1.000 0.999 0.000 1.000 1.000
BCFI 1.000 1.000 0.999 0.000 1.000 1.000
BTLI 0.013 -0.003 -0.028 0.178 -0.243 0.304
BNFI 0.882 0.780 0.062 43.982 -9.723 12.099
Many thanks for the response!
Kind regards,
Sanne Appels