Se hará uso de la base de datos la cual consta de de 80 observaciones y 105 variables de mujeres con cancer de mama en la ciudad de Cali, concretando algunos parámetrospara las simulaciones y el MCMC para obtener la convergencia de los parámetros esperados.
options(mc.cores = parallel::detectCores())
datos <- readRDS("data/datos.RDS")
set.seed(535535)
BURNIN1 = 3000
SAMPLE1 = 6500
NCHAINS1 = 6
BURNIN = 2000 # 2500
SAMPLE = 3000 # 6500
CHAINS = 4 # 6
Se establece despues de las prueba de modelos frecuentistas y sus efectos indirectos, finalmente con la investigacion en la literatura, el modelo bayesiano con sus variables latentes.
model_bayesianoref <- '
# measurement model
funcionalidad =~
prior("normal(0,15)")*F_br23 + prior("normal(0,15)")*F_c30
sintomas =~
prior("normal(0,15)")*S_br23 + prior("normal(0,15)")*S_c30
# regressions
funcionalidad ~ sintomas
CV_Gral ~ Salud + sintomas + prior("normal(0,15)")*funcionalidad
Salud ~ prior("normal(-10,10)")*sintomas + funcionalidad
# residual correlations
'
Del paquete Blavaan que ayuda a ejecutar modelos bayesianos para ecuaciones de modelos estructurales.
#codigo para funcion sem
fitref <- bsem(
model = model_bayesianoref,
data = datos,
auto.var = TRUE,
auto.fix.first = TRUE,
auto.cov.lv.x = TRUE,
inits = "prior",
sample = BURNIN1,
burnin = SAMPLE1,
n.chains = NCHAINS1)
## Computing posterior predictives...
summary(fitref,standardized = TRUE)
## blavaan (0.4-1) results of 3000 samples after 6500 adapt/burnin iterations
##
## Number of observations 80
##
## Number of missing patterns 1
##
## Statistic MargLogLik PPP
## Value -520.168 0.203
##
## Latent Variables:
## Estimate Post.SD pi.lower pi.upper Std.lv Std.all
## funcionalidad =~
## F_br23 1.000 0.536 0.811
## F_c30 1.436 0.157 1.169 1.780 0.769 0.938
## sintomas =~
## S_br23 1.000 0.330 0.588
## S_c30 2.351 0.473 1.670 3.500 0.776 0.930
## Rhat Prior
##
##
## 1.001 normal(0,15)
##
##
## 1.002 normal(0,15)
##
## Regressions:
## Estimate Post.SD pi.lower pi.upper Std.lv Std.all
## funcionalidad ~
## sintomas -1.606 0.337 -2.415 -1.094 -0.989 -0.989
## CV_Gral ~
## Salud 0.750 0.085 0.576 0.902 0.750 0.763
## sintomas -0.774 7.746 -16.995 15.433 -0.255 -0.140
## funcionalidad 0.251 4.940 -9.985 10.682 0.135 0.074
## Salud ~
## sintomas -5.678 8.142 -22.767 9.073 -1.873 -1.012
## funcionalidad -0.950 5.187 -11.767 8.531 -0.509 -0.275
## Rhat Prior
##
## 1.001 normal(0,10)
##
## 1.001 normal(0,10)
## 1.002 normal(0,10)
## 1.002 normal(0,15)
##
## 1.000 normal(-10,10)
## 1.000 normal(0,10)
##
## Intercepts:
## Estimate Post.SD pi.lower pi.upper Std.lv Std.all
## .F_br23 2.342 0.071 2.201 2.480 2.342 3.544
## .F_c30 2.438 0.086 2.269 2.609 2.438 2.973
## .S_br23 1.765 0.063 1.644 1.889 1.765 3.143
## .S_c30 2.163 0.089 1.988 2.336 2.163 2.592
## .CV_Gral 0.847 0.380 0.168 1.611 0.847 0.466
## .Salud 4.338 0.206 3.934 4.751 4.338 2.344
## .funcionalidad 0.000 0.000 0.000
## sintomas 0.000 0.000 0.000
## Rhat Prior
## 1.001 normal(0,32)
## 1.001 normal(0,32)
## 1.000 normal(0,32)
## 1.001 normal(0,32)
## 1.001 normal(0,10)
## 1.000 normal(0,10)
##
##
##
## Variances:
## Estimate Post.SD pi.lower pi.upper Std.lv Std.all
## .F_br23 0.150 0.028 0.102 0.214 0.150 0.343
## .F_c30 0.080 0.027 0.030 0.137 0.080 0.119
## .S_br23 0.206 0.036 0.147 0.288 0.206 0.655
## .S_c30 0.095 0.033 0.019 0.160 0.095 0.136
## .CV_Gral 0.431 0.107 0.172 0.630 0.431 0.130
## .Salud 1.542 0.325 0.933 2.218 1.542 0.450
## .funcionalidad 0.006 0.010 0.000 0.038 0.022 0.022
## sintomas 0.109 0.041 0.042 0.202 1.000 1.000
## Rhat Prior
## 1.000 gamma(1,.5)[sd]
## 1.000 gamma(1,.5)[sd]
## 1.000 gamma(1,.5)[sd]
## 1.001 gamma(1,.5)[sd]
## 1.001 gamma(1,.5)[sd]
## 1.000 gamma(1,.5)[sd]
## 1.003 gamma(1,.5)[sd]
## 1.001 gamma(1,.5)[sd]
blavFitIndices(fitref)
## Posterior mean (EAP) of devm-based fit indices:
##
## BRMSEA BGammaHat adjBGammaHat BMc
## 0.115 0.964 0.866 0.945
blavInspect(fitref, 'rhat')
## funcionalidad=~F_c30 sintomas=~S_c30
## 1.000550 1.002053
## funcionalidad~sintomas CV_Gral~Salud
## 1.001121 1.001226
## CV_Gral~sintomas CV_Gral~funcionalidad
## 1.001847 1.001802
## Salud~sintomas Salud~funcionalidad
## 1.000261 1.000286
## F_br23~~F_br23 F_c30~~F_c30
## 1.000498 1.000059
## S_br23~~S_br23 S_c30~~S_c30
## 1.000195 1.000819
## CV_Gral~~CV_Gral Salud~~Salud
## 1.001085 1.000386
## funcionalidad~~funcionalidad sintomas~~sintomas
## 1.002857 1.000698
## F_br23~1 F_c30~1
## 1.000564 1.000702
## S_br23~1 S_c30~1
## 1.000449 1.000627
## CV_Gral~1 Salud~1
## 1.001472 1.000366
blavInspect(fitref, 'neff')
## funcionalidad=~F_c30 sintomas=~S_c30
## 11317.401 4519.726
## funcionalidad~sintomas CV_Gral~Salud
## 5565.096 6191.490
## CV_Gral~sintomas CV_Gral~funcionalidad
## 4708.735 4471.471
## Salud~sintomas Salud~funcionalidad
## 5920.930 5724.018
## F_br23~~F_br23 F_c30~~F_c30
## 12320.793 9969.309
## S_br23~~S_br23 S_c30~~S_c30
## 14084.361 5064.923
## CV_Gral~~CV_Gral Salud~~Salud
## 5335.657 9197.620
## funcionalidad~~funcionalidad sintomas~~sintomas
## 2623.058 8383.939
## F_br23~1 F_c30~1
## 7505.849 7292.504
## S_br23~1 S_c30~1
## 10216.014 6894.895
## CV_Gral~1 Salud~1
## 6281.104 9249.827
semPaths(
fitref,
intercepts = FALSE,
residuals = TRUE,
edge.label.cex = 1.5,
intStyle = "multi",
optimizeLatRes = TRUE,
title.color = "black",
groups = "lat",
pastel = TRUE,
exoVar = FALSE,
sizeInt = 5,
edge.color = "black",
esize = 6,
label.prop = 2,
sizeLat = 6,
"std"
)
plot(fitref, par = 1:12, facet_args = list(ncol = 4))
plot(fitref, par = 13:22, facet_args = list(ncol = 4))
plot(fitref, par = 1:12, plot.type = "intervals")
plot(fitref, plot.type = "parcoord")
model_bayesiano1.0 <- '
# measurement model
funcionalidad =~
prior("normal(0,15)")*F_br23 + prior("normal(0,15)")*F_c30
sintomas =~
prior("normal(0,15)")*S_br23 + prior("normal(0,15)")*S_c30
# regressions
funcionalidad ~ sintomas
CV_Gral ~ Salud + sintomas + prior("normal(0,15)")*funcionalidad + Edad
Salud ~ prior("normal(-10,10)")*sintomas + funcionalidad
# residual correlations
'
fitedad1.0 <- bsem(
model = model_bayesiano1.0,
data = datos,
auto.var = TRUE,
auto.fix.first = TRUE,
auto.cov.lv.x = TRUE,
sample = SAMPLE,
burnin = BURNIN,
n.chains = CHAINS)
## Computing posterior predictives...
summary(fitedad1.0,standardized = TRUE)
## blavaan (0.4-1) results of 3000 samples after 2000 adapt/burnin iterations
##
## Number of observations 80
##
## Number of missing patterns 1
##
## Statistic MargLogLik PPP
## Value -526.797 0.035
##
## Latent Variables:
## Estimate Post.SD pi.lower pi.upper Std.lv Std.all
## funcionalidad =~
## F_br23 1.000 0.537 0.810
## F_c30 1.439 0.159 1.166 1.796 0.772 0.938
## sintomas =~
## S_br23 1.000 0.331 0.590
## S_c30 2.347 0.521 1.657 3.551 0.778 0.930
## Rhat Prior
##
##
## 1.000 normal(0,15)
##
##
## 1.000 normal(0,15)
##
## Regressions:
## Estimate Post.SD pi.lower pi.upper Std.lv Std.all
## funcionalidad ~
## sintomas -1.601 0.366 -2.436 -1.087 -0.989 -0.989
## CV_Gral ~
## Salud 0.739 0.092 0.553 0.904 0.739 0.754
## sintomas -1.460 7.801 -17.741 14.706 -0.484 -0.267
## funcionalidad -0.149 5.002 -10.593 10.073 -0.080 -0.044
## Edad -0.005 0.007 -0.018 0.008 -0.005 -0.033
## Salud ~
## sintomas -5.619 8.222 -22.588 9.265 -1.862 -1.009
## funcionalidad -0.934 5.298 -12.027 8.762 -0.501 -0.271
## Rhat Prior
##
## 1.000 normal(0,10)
##
## 1.000 normal(0,10)
## 1.002 normal(0,10)
## 1.002 normal(0,15)
## 1.000 normal(0,10)
##
## 1.001 normal(-10,10)
## 1.001 normal(0,10)
##
## Intercepts:
## Estimate Post.SD pi.lower pi.upper Std.lv Std.all
## .F_br23 2.342 0.071 2.204 2.483 2.342 3.537
## .F_c30 2.436 0.087 2.263 2.605 2.436 2.960
## .S_br23 1.765 0.063 1.641 1.890 1.765 3.139
## .S_c30 2.165 0.089 1.991 2.338 2.165 2.590
## .CV_Gral 1.157 0.585 0.031 2.333 1.157 0.639
## .Salud 4.334 0.205 3.933 4.730 4.334 2.349
## .funcionalidad 0.000 0.000 0.000
## sintomas 0.000 0.000 0.000
## Rhat Prior
## 1.000 normal(0,32)
## 1.000 normal(0,32)
## 1.000 normal(0,32)
## 1.000 normal(0,32)
## 1.000 normal(0,10)
## 1.000 normal(0,10)
##
##
##
## Variances:
## Estimate Post.SD pi.lower pi.upper Std.lv Std.all
## .F_br23 0.151 0.028 0.103 0.215 0.151 0.343
## .F_c30 0.081 0.027 0.031 0.140 0.081 0.119
## .S_br23 0.206 0.036 0.147 0.288 0.206 0.652
## .S_c30 0.094 0.033 0.018 0.160 0.094 0.134
## .CV_Gral 0.425 0.116 0.124 0.638 0.425 0.130
## .Salud 1.531 0.323 0.910 2.208 1.531 0.450
## .funcionalidad 0.006 0.010 0.000 0.037 0.022 0.022
## sintomas 0.110 0.041 0.043 0.203 1.000 1.000
## Rhat Prior
## 1.000 gamma(1,.5)[sd]
## 1.000 gamma(1,.5)[sd]
## 1.000 gamma(1,.5)[sd]
## 1.001 gamma(1,.5)[sd]
## 1.001 gamma(1,.5)[sd]
## 1.000 gamma(1,.5)[sd]
## 1.002 gamma(1,.5)[sd]
## 1.000 gamma(1,.5)[sd]
blavFitIndices(fitedad1.0, baseline.model = fitref)
## Posterior mean (EAP) of devm-based fit indices:
##
## BRMSEA BGammaHat adjBGammaHat BMc
## 0.129 0.936 0.840 0.887
blavCompare(fitref, fitedad1.0)
##
## WAIC estimates:
## object1: 913.738
## object2: 915.623
##
## WAIC difference & SE:
## -0.942 1.061
##
## LOO estimates:
## object1: 914.023
## object2: 915.941
##
## LOO difference & SE:
## -0.959 1.086
##
## Laplace approximation to the log-Bayes factor
## (experimental; positive values favor object1): 6.629
Gana modelo ref
model_bayesiano2.0 <- '
# measurement model
funcionalidad =~
prior("normal(0,15)")*F_br23 + prior("normal(0,15)")*F_c30
sintomas =~
prior("normal(0,15)")*S_br23 + prior("normal(0,15)")*S_c30
# regressions
funcionalidad ~ sintomas
CV_Gral ~ Salud + sintomas + prior("normal(0,15)")*funcionalidad + Edad + Estado_del_tumor
Salud ~ prior("normal(-10,10)")*sintomas + funcionalidad
# residual correlations
'
fit2.0 <- bsem(
model = model_bayesiano2.0,
data = datos,
auto.var = TRUE,
auto.fix.first = TRUE,
auto.cov.lv.x = TRUE,
sample = SAMPLE,
burnin = BURNIN,
n.chains = CHAINS)
## Computing posterior predictives...
summary(fit2.0,standardized = TRUE)
## blavaan (0.4-1) results of 3000 samples after 2000 adapt/burnin iterations
##
## Number of observations 80
##
## Number of missing patterns 1
##
## Statistic MargLogLik PPP
## Value -530.400 0.026
##
## Latent Variables:
## Estimate Post.SD pi.lower pi.upper Std.lv Std.all
## funcionalidad =~
## F_br23 1.000 0.539 0.812
## F_c30 1.437 0.156 1.168 1.775 0.775 0.939
## sintomas =~
## S_br23 1.000 0.331 0.588
## S_c30 2.361 0.559 1.664 3.608 0.781 0.931
## Rhat Prior
##
##
## 1.001 normal(0,15)
##
##
## 1.002 normal(0,15)
##
## Regressions:
## Estimate Post.SD pi.lower pi.upper Std.lv Std.all
## funcionalidad ~
## sintomas -1.612 0.384 -2.492 -1.095 -0.989 -0.989
## CV_Gral ~
## Salud 0.742 0.088 0.569 0.909 0.742 0.748
## sintomas -1.696 7.918 -17.939 14.876 -0.561 -0.306
## funcionalidad -0.254 5.065 -10.617 10.372 -0.137 -0.074
## Edad -0.005 0.007 -0.018 0.008 -0.005 -0.033
## Estado_del_tmr -0.159 0.168 -0.492 0.165 -0.159 -0.041
## Salud ~
## sintomas -5.644 8.142 -22.865 9.238 -1.866 -1.009
## funcionalidad -0.933 5.178 -11.848 8.540 -0.503 -0.272
## Rhat Prior
##
## 1.001 normal(0,10)
##
## 1.000 normal(0,10)
## 1.001 normal(0,10)
## 1.001 normal(0,15)
## 1.000 normal(0,10)
## 1.001 normal(0,10)
##
## 1.000 normal(-10,10)
## 1.000 normal(0,10)
##
## Intercepts:
## Estimate Post.SD pi.lower pi.upper Std.lv Std.all
## .F_br23 2.340 0.071 2.201 2.480 2.340 3.524
## .F_c30 2.435 0.087 2.266 2.604 2.435 2.952
## .S_br23 1.767 0.063 1.643 1.890 1.767 3.142
## .S_c30 2.167 0.089 1.994 2.341 2.167 2.583
## .CV_Gral 1.356 0.622 0.149 2.624 1.356 0.739
## .Salud 4.330 0.204 3.929 4.727 4.330 2.340
## .funcionalidad 0.000 0.000 0.000
## sintomas 0.000 0.000 0.000
## Rhat Prior
## 1.000 normal(0,32)
## 1.000 normal(0,32)
## 1.000 normal(0,32)
## 1.000 normal(0,32)
## 1.000 normal(0,10)
## 1.000 normal(0,10)
##
##
##
## Variances:
## Estimate Post.SD pi.lower pi.upper Std.lv Std.all
## .F_br23 0.150 0.029 0.102 0.215 0.150 0.341
## .F_c30 0.080 0.027 0.030 0.139 0.080 0.118
## .S_br23 0.207 0.036 0.146 0.287 0.207 0.654
## .S_c30 0.094 0.032 0.020 0.156 0.094 0.133
## .CV_Gral 0.423 0.118 0.109 0.633 0.423 0.126
## .Salud 1.543 0.314 0.975 2.221 1.543 0.451
## .funcionalidad 0.006 0.010 0.000 0.037 0.021 0.021
## sintomas 0.109 0.042 0.041 0.204 1.000 1.000
## Rhat Prior
## 1.000 gamma(1,.5)[sd]
## 1.000 gamma(1,.5)[sd]
## 1.000 gamma(1,.5)[sd]
## 1.001 gamma(1,.5)[sd]
## 1.002 gamma(1,.5)[sd]
## 1.000 gamma(1,.5)[sd]
## 1.002 gamma(1,.5)[sd]
## 1.000 gamma(1,.5)[sd]
blavCompare(fitref, fit2.0)
##
## WAIC estimates:
## object1: 913.738
## object2: 916.837
##
## WAIC difference & SE:
## -1.550 1.649
##
## LOO estimates:
## object1: 914.023
## object2: 917.113
##
## LOO difference & SE:
## -1.545 1.645
##
## Laplace approximation to the log-Bayes factor
## (experimental; positive values favor object1): 10.232
model_bayesiano3.0 <- '
# measurement model
funcionalidad =~
prior("normal(0,15)")*F_br23 + prior("normal(0,15)")*F_c30
sintomas =~
prior("normal(0,15)")*S_br23 + prior("normal(0,15)")*S_c30
# regressions
funcionalidad ~ sintomas + Comorbilidad
CV_Gral ~ Salud + sintomas + prior("normal(0,15)")*funcionalidad + Edad + Estado_del_tumor
Salud ~ prior("normal(-10,10)")*sintomas + funcionalidad
# residual correlations
'
fit3.0 <- bsem(
model = model_bayesiano3.0,
data = datos,
auto.var = TRUE,
auto.fix.first = TRUE,
auto.cov.lv.x = TRUE,
sample = SAMPLE,
burnin = BURNIN,
n.chains = CHAINS)
## Computing posterior predictives...
summary(fit3.0,standardized = TRUE)
## blavaan (0.4-1) results of 3000 samples after 2000 adapt/burnin iterations
##
## Number of observations 80
##
## Number of missing patterns 1
##
## Statistic MargLogLik PPP
## Value -572.734 0.036
##
## Latent Variables:
## Estimate Post.SD pi.lower pi.upper Std.lv Std.all
## funcionalidad =~
## F_br23 1.000 0.540 0.813
## F_c30 1.408 0.150 1.148 1.736 0.760 0.930
## sintomas =~
## S_br23 1.000 0.340 0.602
## S_c30 2.268 0.425 1.644 3.324 0.772 0.929
## Rhat Prior
##
##
## 1.000 normal(0,15)
##
##
## 1.000 normal(0,15)
##
## Regressions:
## Estimate Post.SD pi.lower pi.upper Std.lv Std.all
## funcionalidad ~
## sintomas -1.574 0.312 -2.331 -1.102 -0.992 -0.992
## Comorbilidad 0.026 0.091 -0.126 0.180 0.047 0.022
## CV_Gral ~
## Salud 0.674 0.122 0.391 0.860 0.674 0.683
## sintomas -0.804 7.428 -15.978 12.320 -0.274 -0.150
## funcionalidad 0.502 4.828 -9.198 9.341 0.271 0.149
## Edad -0.001 0.007 -0.015 0.014 -0.001 -0.007
## Estado_del_tmr -0.174 0.169 -0.502 0.161 -0.174 -0.045
## Salud ~
## sintomas -2.955 11.571 -24.634 13.897 -1.005 -0.545
## funcionalidad 0.799 7.479 -13.124 11.965 0.431 0.234
## Rhat Prior
##
## 1.000 normal(0,10)
## 1.006 normal(0,10)
##
## 1.002 normal(0,10)
## 1.004 normal(0,10)
## 1.004 normal(0,15)
## 1.000 normal(0,10)
## 1.000 normal(0,10)
##
## 1.007 normal(-10,10)
## 1.007 normal(0,10)
##
## Intercepts:
## Estimate Post.SD pi.lower pi.upper Std.lv Std.all
## .F_br23 2.300 0.168 1.998 2.606 2.300 3.461
## .F_c30 2.376 0.230 1.974 2.780 2.376 2.906
## .S_br23 1.765 0.063 1.641 1.888 1.765 3.123
## .S_c30 2.164 0.090 1.986 2.342 2.164 2.606
## .CV_Gral 0.989 0.707 -0.396 2.381 0.989 0.544
## .Salud 3.432 0.593 2.210 4.489 3.432 1.861
## .funcionalidad 0.000 0.000 0.000
## sintomas 0.000 0.000 0.000
## Rhat Prior
## 1.005 normal(0,32)
## 1.005 normal(0,32)
## 1.000 normal(0,32)
## 1.000 normal(0,32)
## 1.001 normal(0,10)
## 1.001 normal(0,10)
##
##
##
## Variances:
## Estimate Post.SD pi.lower pi.upper Std.lv Std.all
## .F_br23 0.150 0.029 0.101 0.216 0.150 0.340
## .F_c30 0.090 0.027 0.042 0.150 0.090 0.135
## .S_br23 0.204 0.035 0.145 0.282 0.204 0.638
## .S_c30 0.094 0.033 0.026 0.159 0.094 0.136
## .CV_Gral 0.411 0.107 0.159 0.612 0.411 0.124
## .Salud 1.344 0.342 0.607 2.008 1.344 0.395
## .funcionalidad 0.004 0.007 0.000 0.022 0.015 0.015
## sintomas 0.116 0.042 0.048 0.211 1.000 1.000
## Rhat Prior
## 1.000 gamma(1,.5)[sd]
## 1.001 gamma(1,.5)[sd]
## 1.000 gamma(1,.5)[sd]
## 1.003 gamma(1,.5)[sd]
## 1.001 gamma(1,.5)[sd]
## 1.001 gamma(1,.5)[sd]
## 1.002 gamma(1,.5)[sd]
## 1.000 gamma(1,.5)[sd]
blavCompare(fitref, fit3.0)
##
## WAIC estimates:
## object1: 913.738
## object2: 914.414
##
## WAIC difference & SE:
## -0.338 2.867
##
## LOO estimates:
## object1: 914.023
## object2: 914.782
##
## LOO difference & SE:
## -0.379 2.885
##
## Laplace approximation to the log-Bayes factor
## (experimental; positive values favor object1): 52.566
model_bayesiano4.0 <- '
# measurement model
funcionalidad =~
prior("normal(0,15)")*F_br23 + prior("normal(0,15)")*F_c30
sintomas =~
prior("normal(0,15)")*S_br23 + prior("normal(0,15)")*S_c30
# regressions
funcionalidad ~ sintomas + Comorbilidad
CV_Gral ~ Salud + sintomas + prior("normal(0,15)")*funcionalidad + Edad + Estado_del_tumor + Con_companero_permanente
Salud ~ prior("normal(-10,10)")*sintomas + funcionalidad
# residual correlations
'
fit4.0 <- bsem(
model = model_bayesiano4.0,
data = datos,
auto.var = TRUE,
auto.fix.first = TRUE,
auto.cov.lv.x = TRUE,
sample = SAMPLE,
burnin = BURNIN,
n.chains = CHAINS)
## Computing posterior predictives...
summary(fit4.0,standardized = TRUE)
## blavaan (0.4-1) results of 3000 samples after 2000 adapt/burnin iterations
##
## Number of observations 80
##
## Number of missing patterns 1
##
## Statistic MargLogLik PPP
## Value -580.723 0.063
##
## Latent Variables:
## Estimate Post.SD pi.lower pi.upper Std.lv Std.all
## funcionalidad =~
## F_br23 1.000 0.540 0.813
## F_c30 1.405 0.151 1.143 1.743 0.759 0.930
## sintomas =~
## S_br23 1.000 0.340 0.601
## S_c30 2.268 0.420 1.641 3.266 0.771 0.929
## Rhat Prior
##
##
## 1.000 normal(0,15)
##
##
## 1.001 normal(0,15)
##
## Regressions:
## Estimate Post.SD pi.lower pi.upper Std.lv Std.all
## funcionalidad ~
## sintomas -1.578 0.308 -2.295 -1.096 -0.992 -0.992
## Comorbilidad 0.020 0.092 -0.127 0.178 0.037 0.018
## CV_Gral ~
## Salud 0.668 0.129 0.342 0.854 0.668 0.675
## sintomas -1.213 7.729 -16.511 12.790 -0.412 -0.226
## funcionalidad 0.278 4.998 -9.326 9.832 0.150 0.082
## Edad -0.001 0.007 -0.016 0.013 -0.001 -0.007
## Estado_del_tmr -0.172 0.172 -0.507 0.164 -0.172 -0.045
## Cn_cmpnr_prmnn -0.043 0.164 -0.368 0.274 -0.043 -0.012
## Salud ~
## sintomas -3.513 11.638 -24.517 14.396 -1.194 -0.648
## funcionalidad 0.448 7.522 -13.145 12.290 0.242 0.131
## Rhat Prior
##
## 1.001 normal(0,10)
## 1.021 normal(0,10)
##
## 1.004 normal(0,10)
## 1.015 normal(0,10)
## 1.015 normal(0,15)
## 1.000 normal(0,10)
## 1.000 normal(0,10)
## 1.000 normal(0,10)
##
## 1.021 normal(-10,10)
## 1.020 normal(0,10)
##
## Intercepts:
## Estimate Post.SD pi.lower pi.upper Std.lv Std.all
## .F_br23 2.309 0.170 1.998 2.610 2.309 3.475
## .F_c30 2.389 0.231 1.966 2.793 2.389 2.926
## .S_br23 1.766 0.064 1.641 1.892 1.766 3.124
## .S_c30 2.165 0.091 1.988 2.342 2.165 2.608
## .CV_Gral 1.056 0.768 -0.421 2.616 1.056 0.579
## .Salud 3.433 0.598 2.181 4.486 3.433 1.863
## .funcionalidad 0.000 0.000 0.000
## sintomas 0.000 0.000 0.000
## Rhat Prior
## 1.018 normal(0,32)
## 1.018 normal(0,32)
## 1.000 normal(0,32)
## 1.000 normal(0,32)
## 1.001 normal(0,10)
## 1.002 normal(0,10)
##
##
##
## Variances:
## Estimate Post.SD pi.lower pi.upper Std.lv Std.all
## .F_br23 0.150 0.029 0.100 0.215 0.150 0.339
## .F_c30 0.090 0.027 0.041 0.150 0.090 0.136
## .S_br23 0.204 0.036 0.145 0.284 0.204 0.639
## .S_c30 0.095 0.033 0.026 0.162 0.095 0.138
## .CV_Gral 0.412 0.115 0.126 0.625 0.412 0.124
## .Salud 1.339 0.347 0.594 2.026 1.339 0.394
## .funcionalidad 0.004 0.007 0.000 0.022 0.015 0.015
## sintomas 0.115 0.042 0.049 0.210 1.000 1.000
## Rhat Prior
## 1.000 gamma(1,.5)[sd]
## 1.001 gamma(1,.5)[sd]
## 1.000 gamma(1,.5)[sd]
## 1.003 gamma(1,.5)[sd]
## 1.003 gamma(1,.5)[sd]
## 1.001 gamma(1,.5)[sd]
## 1.001 gamma(1,.5)[sd]
## 1.001 gamma(1,.5)[sd]
blavCompare(fitref, fit4.0)
##
## WAIC estimates:
## object1: 913.738
## object2: 916.894
##
## WAIC difference & SE:
## -1.578 2.893
##
## LOO estimates:
## object1: 914.023
## object2: 917.471
##
## LOO difference & SE:
## -1.724 2.906
##
## Laplace approximation to the log-Bayes factor
## (experimental; positive values favor object1): 60.555
model_bayesiano5.0 <- '
# measurement model
funcionalidad =~
prior("normal(0,15)")*F_br23 + prior("normal(0,15)")*F_c30
sintomas =~
prior("normal(0,15)")*S_br23 + prior("normal(0,15)")*S_c30
# regressions
funcionalidad ~ sintomas + Comorbilidad
CV_Gral ~ Salud + sintomas + prior("normal(0,15)")*funcionalidad + Edad + Estado_del_tumor + Con_companero_permanente
Salud ~ prior("normal(-10,10)")*sintomas + funcionalidad + regimensalud
# residual correlations
'
fit5.0 <- bsem(
model = model_bayesiano5.0,
data = datos,
auto.var = TRUE,
auto.fix.first = TRUE,
auto.cov.lv.x = TRUE,
sample = SAMPLE,
burnin = BURNIN,
n.chains = CHAINS)
## Computing posterior predictives...
summary(fit5.0,standardized = TRUE)
## blavaan (0.4-1) results of 3000 samples after 2000 adapt/burnin iterations
##
## Number of observations 80
##
## Number of missing patterns 1
##
## Statistic MargLogLik PPP
## Value -576.999 0.050
##
## Latent Variables:
## Estimate Post.SD pi.lower pi.upper Std.lv Std.all
## funcionalidad =~
## F_br23 1.000 0.540 0.813
## F_c30 1.411 0.151 1.145 1.744 0.763 0.932
## sintomas =~
## S_br23 1.000 0.339 0.599
## S_c30 2.281 0.447 1.645 3.376 0.773 0.929
## Rhat Prior
##
##
## 1.000 normal(0,15)
##
##
## 1.001 normal(0,15)
##
## Regressions:
## Estimate Post.SD pi.lower pi.upper Std.lv Std.all
## funcionalidad ~
## sintomas -1.582 0.328 -2.366 -1.097 -0.992 -0.992
## Comorbilidad 0.017 0.090 -0.127 0.175 0.031 0.015
## CV_Gral ~
## Salud 0.688 0.121 0.413 0.881 0.688 0.696
## sintomas -1.506 7.635 -17.098 12.376 -0.510 -0.278
## funcionalidad 0.021 4.892 -9.719 9.250 0.011 0.006
## Edad -0.001 0.007 -0.016 0.013 -0.001 -0.009
## Estado_del_tmr -0.174 0.169 -0.513 0.157 -0.174 -0.045
## Cn_cmpnr_prmnn -0.039 0.167 -0.366 0.290 -0.039 -0.011
## Salud ~
## sintomas -4.221 11.603 -25.236 13.902 -1.431 -0.771
## funcionalidad 0.007 7.505 -13.816 11.883 0.004 0.002
## regimensalud 0.233 0.308 -0.359 0.841 0.233 0.060
## Rhat Prior
##
## 1.000 normal(0,10)
## 1.019 normal(0,10)
##
## 1.002 normal(0,10)
## 1.019 normal(0,10)
## 1.018 normal(0,15)
## 1.000 normal(0,10)
## 1.000 normal(0,10)
## 1.000 normal(0,10)
##
## 1.019 normal(-10,10)
## 1.019 normal(0,10)
## 1.000 normal(0,10)
##
## Intercepts:
## Estimate Post.SD pi.lower pi.upper Std.lv Std.all
## .F_br23 2.316 0.165 2.009 2.604 2.316 3.485
## .F_c30 2.398 0.226 1.991 2.781 2.398 2.930
## .S_br23 1.765 0.063 1.640 1.891 1.765 3.121
## .S_c30 2.163 0.090 1.987 2.337 2.163 2.599
## .CV_Gral 1.035 0.738 -0.355 2.523 1.035 0.565
## .Salud 3.103 0.747 1.599 4.501 3.103 1.673
## .funcionalidad 0.000 0.000 0.000
## sintomas 0.000 0.000 0.000
## Rhat Prior
## 1.016 normal(0,32)
## 1.017 normal(0,32)
## 1.000 normal(0,32)
## 1.000 normal(0,32)
## 1.002 normal(0,10)
## 1.001 normal(0,10)
##
##
##
## Variances:
## Estimate Post.SD pi.lower pi.upper Std.lv Std.all
## .F_br23 0.150 0.029 0.102 0.214 0.150 0.339
## .F_c30 0.088 0.027 0.038 0.147 0.088 0.131
## .S_br23 0.205 0.036 0.146 0.286 0.205 0.641
## .S_c30 0.095 0.032 0.028 0.160 0.095 0.138
## .CV_Gral 0.423 0.113 0.147 0.631 0.423 0.126
## .Salud 1.369 0.353 0.612 2.069 1.369 0.398
## .funcionalidad 0.004 0.007 0.000 0.024 0.015 0.015
## sintomas 0.115 0.042 0.045 0.208 1.000 1.000
## Rhat Prior
## 1.001 gamma(1,.5)[sd]
## 1.000 gamma(1,.5)[sd]
## 1.000 gamma(1,.5)[sd]
## 1.004 gamma(1,.5)[sd]
## 1.001 gamma(1,.5)[sd]
## 1.001 gamma(1,.5)[sd]
## 1.001 gamma(1,.5)[sd]
## 1.001 gamma(1,.5)[sd]
blavCompare(fitref, fit5.0)
##
## WAIC estimates:
## object1: 913.738
## object2: 918.254
##
## WAIC difference & SE:
## -2.258 2.900
##
## LOO estimates:
## object1: 914.023
## object2: 918.868
##
## LOO difference & SE:
## -2.422 2.895
##
## Laplace approximation to the log-Bayes factor
## (experimental; positive values favor object1): 56.831
model_bayesiano6.0 <- '
# measurement model
funcionalidad =~
prior("normal(0,15)")*F_br23 + prior("normal(0,15)")*F_c30
sintomas =~
prior("normal(0,15)")*S_br23 + prior("normal(0,15)")*S_c30
# regressions
funcionalidad ~ sintomas + Comorbilidad
CV_Gral ~ Salud + sintomas + prior("normal(0,15)")*funcionalidad + Edad + Estado_del_tumor + Con_companero_permanente + niveleducativo
Salud ~ prior("normal(-10,10)")*sintomas + funcionalidad + regimensalud
# residual correlations
'
fit6.0 <- bsem(
model = model_bayesiano6.0,
data = datos,
auto.var = TRUE,
auto.fix.first = TRUE,
auto.cov.lv.x = TRUE,
sample = SAMPLE,
burnin = BURNIN,
n.chains = CHAINS)
## Computing posterior predictives...
summary(fit6.0,standardized = TRUE)
## ** WARNING ** blavaan (0.4-1) did NOT converge after 2000 adapt+burnin iterations
## ** WARNING ** Proceed with caution
##
## Number of observations 80
##
## Number of missing patterns 1
##
## Statistic MargLogLik PPP
## Value -1109.908 0.031
##
## Latent Variables:
## Estimate Post.SD pi.lower pi.upper Std.lv Std.all
## funcionalidad =~
## F_br23 1.000 0.385 0.626
## F_c30 -3.554 9.346 -28.045 1.737 -1.367 -0.978
## sintomas =~
## S_br23 1.000 0.332 0.590
## S_c30 2.379 0.538 1.663 3.703 0.789 0.939
## Rhat Prior
##
##
## 2.732 normal(0,15)
##
##
## 1.054 normal(0,15)
##
## Regressions:
## Estimate Post.SD pi.lower pi.upper Std.lv Std.all
## funcionalidad ~
## sintomas -1.145 0.802 -2.272 0.245 -0.987 -0.987
## Comorbilidad 0.028 0.079 -0.115 0.174 0.072 0.034
## CV_Gral ~
## Salud 0.707 0.107 0.459 0.880 0.707 0.760
## sintomas -0.107 6.252 -13.881 11.997 -0.035 -0.029
## funcionalidad 0.398 7.494 -18.073 14.185 0.153 0.126
## Edad -0.002 0.008 -0.017 0.014 -0.002 -0.016
## Estado_del_tmr -0.166 0.173 -0.510 0.176 -0.166 -0.065
## Cn_cmpnr_prmnn -0.045 0.167 -0.374 0.282 -0.045 -0.018
## niveleducativo 0.049 0.189 -0.321 0.419 0.049 0.019
## Salud ~
## sintomas -1.808 9.576 -22.419 13.778 -0.600 -0.459
## funcionalidad -0.264 9.023 -20.016 13.157 -0.101 -0.078
## regimensalud 0.254 0.308 -0.349 0.869 0.254 0.094
## Rhat Prior
##
## 2.982 normal(0,10)
## 1.037 normal(0,10)
##
## 1.041 normal(0,10)
## 1.008 normal(0,10)
## 1.017 normal(0,15)
## 1.021 normal(0,10)
## 1.000 normal(0,10)
## 1.000 normal(0,10)
## 1.001 normal(0,10)
##
## 1.007 normal(-10,10)
## 1.120 normal(0,10)
## 1.003 normal(0,10)
##
## Intercepts:
## Estimate Post.SD pi.lower pi.upper Std.lv Std.all
## .F_br23 2.296 0.151 2.009 2.578 2.296 3.740
## .F_c30 2.339 0.222 1.947 2.761 2.339 1.673
## .S_br23 1.765 0.063 1.641 1.887 1.765 3.137
## .S_c30 2.163 0.090 1.982 2.338 2.163 2.573
## .CV_Gral 0.977 0.818 -0.645 2.585 0.977 0.803
## .Salud 3.220 0.788 1.577 4.672 3.220 2.465
## .funcionalidad 0.000 0.000 0.000
## sintomas 0.000 0.000 0.000
## Rhat Prior
## 1.028 normal(0,32)
## 1.004 normal(0,32)
## 1.000 normal(0,32)
## 1.000 normal(0,32)
## 1.010 normal(0,10)
## 1.091 normal(0,10)
##
##
##
## Variances:
## Estimate Post.SD pi.lower pi.upper Std.lv Std.all
## .F_br23 0.229 0.142 0.106 0.564 0.229 0.608
## .F_c30 0.085 0.034 0.006 0.153 0.085 0.043
## .S_br23 0.206 0.037 0.146 0.289 0.206 0.652
## .S_c30 0.084 0.038 0.004 0.156 0.084 0.119
## .CV_Gral 0.446 0.107 0.206 0.654 0.446 0.301
## .Salud 1.441 0.361 0.724 2.178 1.441 0.845
## .funcionalidad 0.004 0.007 0.000 0.023 0.024 0.024
## sintomas 0.110 0.043 0.040 0.207 1.000 1.000
## Rhat Prior
## 3.278 gamma(1,.5)[sd]
## 1.023 gamma(1,.5)[sd]
## 1.008 gamma(1,.5)[sd]
## 1.096 gamma(1,.5)[sd]
## 1.023 gamma(1,.5)[sd]
## 1.075 gamma(1,.5)[sd]
## 1.050 gamma(1,.5)[sd]
## 1.025 gamma(1,.5)[sd]
blavCompare(fitref, fit6.0)
##
## WAIC estimates:
## object1: 913.738
## object2: 956.03
##
## WAIC difference & SE:
## -21.146 3.529
##
## LOO estimates:
## object1: 914.023
## object2: 955.969
##
## LOO difference & SE:
## -20.973 3.545
##
## Laplace approximation to the log-Bayes factor
## (experimental; positive values favor object1): 589.739
model_bayesiano7.0 <- '
# measurement model
funcionalidad =~
prior("normal(0,15)")*F_br23 + prior("normal(0,15)")*F_c30
sintomas =~
prior("normal(0,15)")*S_br23 + prior("normal(0,15)")*S_c30
# regressions
funcionalidad ~ sintomas + Comorbilidad + Estrato
CV_Gral ~ Salud + sintomas + prior("normal(0,15)")*funcionalidad + Edad + Estado_del_tumor + Con_companero_permanente + niveleducativo
Salud ~ prior("normal(-10,10)")*sintomas + funcionalidad + regimensalud
# residual correlations
'
fit7.0 <- bsem(
model = model_bayesiano7.0,
data = datos,
auto.var = TRUE,
auto.fix.first = TRUE,
auto.cov.lv.x = TRUE,
sample = SAMPLE,
burnin = BURNIN,
n.chains = CHAINS)
## Computing posterior predictives...
summary(fit7.0,standardized = TRUE)
## blavaan (0.4-1) results of 3000 samples after 2000 adapt/burnin iterations
##
## Number of observations 80
##
## Number of missing patterns 1
##
## Statistic MargLogLik PPP
## Value -560.710 0.032
##
## Latent Variables:
## Estimate Post.SD pi.lower pi.upper Std.lv Std.all
## funcionalidad =~
## F_br23 1.000 0.545 0.814
## F_c30 1.416 0.153 1.151 1.752 0.772 0.937
## sintomas =~
## S_br23 1.000 0.331 0.590
## S_c30 2.374 0.491 1.681 3.580 0.785 0.938
## Rhat Prior
##
##
## 1.001 normal(0,15)
##
##
## 1.000 normal(0,15)
##
## Regressions:
## Estimate Post.SD pi.lower pi.upper Std.lv Std.all
## funcionalidad ~
## sintomas -1.621 0.351 -2.467 -1.104 -0.983 -0.983
## Comorbilidad 0.051 0.091 -0.121 0.203 0.093 0.044
## Estrato 0.071 0.060 -0.024 0.205 0.130 0.064
## CV_Gral ~
## Salud 0.718 0.107 0.505 0.880 0.718 0.721
## sintomas -0.930 4.963 -12.676 8.679 -0.308 -0.163
## funcionalidad 0.325 3.137 -6.865 6.450 0.177 0.094
## Edad -0.002 0.008 -0.017 0.013 -0.002 -0.015
## Estado_del_tmr -0.156 0.175 -0.498 0.191 -0.156 -0.039
## Cn_cmpnr_prmnn -0.034 0.172 -0.374 0.307 -0.034 -0.009
## niveleducativo 0.061 0.198 -0.331 0.455 0.061 0.015
## Salud ~
## sintomas -1.260 7.883 -19.344 11.527 -0.417 -0.220
## funcionalidad 1.907 4.943 -9.295 10.097 1.039 0.548
## regimensalud 0.248 0.320 -0.376 0.887 0.248 0.063
## Rhat Prior
##
## 1.001 normal(0,10)
## 1.007 normal(0,10)
## 1.002 normal(0,10)
##
## 1.003 normal(0,10)
## 1.009 normal(0,10)
## 1.008 normal(0,15)
## 1.000 normal(0,10)
## 1.000 normal(0,10)
## 1.000 normal(0,10)
## 1.000 normal(0,10)
##
## 1.007 normal(-10,10)
## 1.007 normal(0,10)
## 1.000 normal(0,10)
##
## Intercepts:
## Estimate Post.SD pi.lower pi.upper Std.lv Std.all
## .F_br23 2.155 0.199 1.785 2.539 2.155 3.217
## .F_c30 2.173 0.274 1.675 2.692 2.173 2.637
## .S_br23 1.766 0.061 1.645 1.888 1.766 3.152
## .S_c30 2.165 0.089 1.991 2.341 2.165 2.588
## .CV_Gral 0.976 0.821 -0.619 2.577 0.976 0.517
## .Salud 3.030 0.887 1.176 4.615 3.030 1.598
## .funcionalidad 0.000 0.000 0.000
## sintomas 0.000 0.000 0.000
## Rhat Prior
## 1.006 normal(0,32)
## 1.007 normal(0,32)
## 1.000 normal(0,32)
## 1.000 normal(0,32)
## 1.000 normal(0,10)
## 1.001 normal(0,10)
##
##
##
## Variances:
## Estimate Post.SD pi.lower pi.upper Std.lv Std.all
## .F_br23 0.152 0.030 0.102 0.218 0.152 0.338
## .F_c30 0.083 0.027 0.033 0.140 0.083 0.122
## .S_br23 0.204 0.035 0.145 0.283 0.204 0.652
## .S_c30 0.084 0.036 0.007 0.153 0.084 0.120
## .CV_Gral 0.456 0.109 0.222 0.660 0.456 0.128
## .Salud 1.473 0.330 0.842 2.144 1.473 0.410
## .funcionalidad 0.008 0.011 0.000 0.042 0.028 0.028
## sintomas 0.109 0.041 0.042 0.202 1.000 1.000
## Rhat Prior
## 1.001 gamma(1,.5)[sd]
## 1.000 gamma(1,.5)[sd]
## 1.000 gamma(1,.5)[sd]
## 1.002 gamma(1,.5)[sd]
## 1.003 gamma(1,.5)[sd]
## 1.001 gamma(1,.5)[sd]
## 1.002 gamma(1,.5)[sd]
## 1.000 gamma(1,.5)[sd]
blavCompare(fitref, fit7.0)
##
## WAIC estimates:
## object1: 913.738
## object2: 922.518
##
## WAIC difference & SE:
## -4.390 2.986
##
## LOO estimates:
## object1: 914.023
## object2: 923.234
##
## LOO difference & SE:
## -4.605 3.006
##
## Laplace approximation to the log-Bayes factor
## (experimental; positive values favor object1): 40.542
model_bayesiano8.0 <- '
# measurement model
funcionalidad =~
prior("normal(0,15)")*F_br23 + prior("normal(0,15)")*F_c30
sintomas =~
prior("normal(0,15)")*S_br23 + prior("normal(0,15)")*S_c30
# regressions
funcionalidad ~ sintomas + Comorbilidad + Estrato + Situacion_laboral
CV_Gral ~ Salud + sintomas + prior("normal(0,15)")*funcionalidad + Edad + Estado_del_tumor + Con_companero_permanente + niveleducativo
Salud ~ prior("normal(-10,10)")*sintomas + funcionalidad + regimensalud
# residual correlations
'
fit8.0 <- bsem(
model = model_bayesiano8.0,
data = datos,
auto.var = TRUE,
auto.fix.first = TRUE,
auto.cov.lv.x = TRUE,
sample = SAMPLE,
burnin = BURNIN,
n.chains = CHAINS)
## Computing posterior predictives...
summary(fit8.0,standardized = TRUE)
## blavaan (0.4-1) results of 3000 samples after 2000 adapt/burnin iterations
##
## Number of observations 80
##
## Number of missing patterns 1
##
## Statistic MargLogLik PPP
## Value -558.725 0.027
##
## Latent Variables:
## Estimate Post.SD pi.lower pi.upper Std.lv Std.all
## funcionalidad =~
## F_br23 1.000 0.548 0.815
## F_c30 1.404 0.147 1.149 1.723 0.769 0.937
## sintomas =~
## S_br23 1.000 0.330 0.590
## S_c30 2.368 0.476 1.691 3.517 0.782 0.938
## Rhat Prior
##
##
## 1.000 normal(0,15)
##
##
## 1.000 normal(0,15)
##
## Regressions:
## Estimate Post.SD pi.lower pi.upper Std.lv Std.all
## funcionalidad ~
## sintomas -1.627 0.345 -2.455 -1.123 -0.980 -0.980
## Comorbilidad 0.059 0.091 -0.122 0.211 0.107 0.051
## Estrato 0.076 0.062 -0.026 0.210 0.139 0.069
## Situacion_lbrl -0.005 0.056 -0.121 0.108 -0.009 -0.004
## CV_Gral ~
## Salud 0.729 0.092 0.545 0.886 0.729 0.731
## sintomas -0.541 4.257 -10.129 7.670 -0.178 -0.094
## funcionalidad 0.526 2.611 -5.233 5.683 0.288 0.152
## Edad -0.003 0.008 -0.017 0.012 -0.003 -0.017
## Estado_del_tmr -0.165 0.177 -0.515 0.189 -0.165 -0.041
## Cn_cmpnr_prmnn -0.031 0.167 -0.355 0.298 -0.031 -0.008
## niveleducativo 0.046 0.198 -0.337 0.436 0.046 0.012
## Salud ~
## sintomas -1.022 6.707 -17.138 9.878 -0.338 -0.178
## funcionalidad 2.024 4.153 -8.030 8.964 1.109 0.585
## regimensalud 0.251 0.318 -0.373 0.883 0.251 0.064
## Rhat Prior
##
## 1.000 normal(0,10)
## 1.006 normal(0,10)
## 1.001 normal(0,10)
## 1.000 normal(0,10)
##
## 1.001 normal(0,10)
## 1.004 normal(0,10)
## 1.003 normal(0,15)
## 1.000 normal(0,10)
## 1.000 normal(0,10)
## 1.000 normal(0,10)
## 1.000 normal(0,10)
##
## 1.006 normal(-10,10)
## 1.006 normal(0,10)
## 1.000 normal(0,10)
##
## Intercepts:
## Estimate Post.SD pi.lower pi.upper Std.lv Std.all
## .F_br23 2.144 0.209 1.739 2.544 2.144 3.188
## .F_c30 2.158 0.289 1.602 2.705 2.158 2.629
## .S_br23 1.765 0.063 1.643 1.887 1.765 3.153
## .S_c30 2.164 0.090 1.989 2.342 2.164 2.595
## .CV_Gral 1.085 0.832 -0.529 2.698 1.085 0.573
## .Salud 3.113 0.931 1.067 4.695 3.113 1.641
## .funcionalidad 0.000 0.000 0.000
## sintomas 0.000 0.000 0.000
## Rhat Prior
## 1.005 normal(0,32)
## 1.005 normal(0,32)
## 1.000 normal(0,32)
## 1.000 normal(0,32)
## 1.000 normal(0,10)
## 1.002 normal(0,10)
##
##
##
## Variances:
## Estimate Post.SD pi.lower pi.upper Std.lv Std.all
## .F_br23 0.152 0.030 0.102 0.218 0.152 0.336
## .F_c30 0.082 0.028 0.027 0.141 0.082 0.122
## .S_br23 0.204 0.035 0.147 0.282 0.204 0.652
## .S_c30 0.084 0.035 0.009 0.154 0.084 0.120
## .CV_Gral 0.462 0.098 0.282 0.662 0.462 0.129
## .Salud 1.502 0.337 0.891 2.183 1.502 0.417
## .funcionalidad 0.010 0.013 0.000 0.046 0.032 0.032
## sintomas 0.109 0.040 0.043 0.201 1.000 1.000
## Rhat Prior
## 1.000 gamma(1,.5)[sd]
## 1.000 gamma(1,.5)[sd]
## 1.000 gamma(1,.5)[sd]
## 1.002 gamma(1,.5)[sd]
## 1.001 gamma(1,.5)[sd]
## 1.004 gamma(1,.5)[sd]
## 1.002 gamma(1,.5)[sd]
## 1.000 gamma(1,.5)[sd]
blavCompare(fitref, fit8.0)
##
## WAIC estimates:
## object1: 913.738
## object2: 924.023
##
## WAIC difference & SE:
## -5.142 2.854
##
## LOO estimates:
## object1: 914.023
## object2: 924.886
##
## LOO difference & SE:
## -5.431 2.868
##
## Laplace approximation to the log-Bayes factor
## (experimental; positive values favor object1): 38.557
comparison <- bayesfactor_models(fitedad1.0,fit2.0,fit3.0,fit4.0,fit5.0,fit6.0,fit7.0,fit8.0, denominator = fitref)
comparison
## Bayes Factors for Model Comparison
##
## Model BF
## [1] fitedad1.0 0.001
## [2] fit2.0 3.60e-05
## [3] fit3.0 1.48e-23
## [4] fit4.0 5.03e-27
## [5] fit5.0 2.08e-25
## [6] fit6.0 7.58e-257
## [7] fit7.0 2.47e-18
## [8] fit8.0 1.80e-17
##
## * Against Denominator: [9] fitref
## * Bayes Factor Type: marginal likelihoods (Laplace approximation)
as.matrix(comparison)
## # Bayes Factors for Model Comparison
##
## Numerator
## Denominator
##
## | [1] | [2] | [3] | [4] | [5] | [6] | [7] | [8] | [9]
## --------------------------------------------------------------------------------------------------------------------------
## [1] fitedad1.0 | 1 | 0.027 | 1.12e-20 | 3.80e-24 | 1.58e-22 | 5.73e-254 | 1.87e-15 | 1.36e-14 | 756.62
## [2] fit2.0 | 36.72 | 1 | 4.12e-19 | 1.40e-22 | 5.79e-21 | 2.10e-252 | 6.87e-14 | 5.00e-13 | 2.78e+04
## [3] fit3.0 | 8.92e+19 | 2.43e+18 | 1 | 3.39e-04 | 0.014 | 5.11e-234 | 1.67e+05 | 1.21e+06 | 6.75e+22
## [4] fit4.0 | 2.63e+23 | 7.16e+21 | 2.95e+03 | 1 | 41.43 | 1.51e-230 | 4.91e+08 | 3.58e+09 | 1.99e+26
## [5] fit5.0 | 6.35e+21 | 1.73e+20 | 71.13 | 0.024 | 1 | 3.64e-232 | 1.19e+07 | 8.64e+07 | 4.80e+24
## [6] fit6.0 | 1.74e+253 | 4.75e+251 | 1.96e+233 | 6.64e+229 | 2.75e+231 | 1 | 3.26e+238 | 2.37e+239 | 1.32e+256
## [7] fit7.0 | 5.35e+14 | 1.46e+13 | 6.00e-06 | 2.03e-09 | 8.43e-08 | 3.07e-239 | 1 | 7.28 | 4.05e+17
## [8] fit8.0 | 7.35e+13 | 2.00e+12 | 8.24e-07 | 2.80e-10 | 1.16e-08 | 4.21e-240 | 0.137 | 1 | 5.56e+16
## [9] fitref | 0.001 | 3.60e-05 | 1.48e-23 | 5.03e-27 | 2.08e-25 | 7.58e-257 | 2.47e-18 | 1.80e-17 | 1