Paquetes utilizados

Se hará uso de la base de datos recolectada la cual consta de 80 observaciones y 105 variables de mujeres con cáncer de mama en la ciudad de Cali, concretando algunos parámetros para las simulaciones y el MCMC para obtener la convergencia de los parámetros esperados. Donde se parametrizara el numero de muestras de calentamiento (BURNIN1), el número de iteraciones(SAMPLE1) y el numero de cadenas (NCHAINS1).

options(mc.cores = parallel::detectCores())
datos2 <- readRDS("data/datos2.RDS")
datos <- datos2

set.seed(535535)
BURNIN1 = 8000 #3000
SAMPLE1 = 16000 #6500
NCHAINS1 =  10  #6

BURNIN = 3000 # 2500
SAMPLE = 7000 # 6500 
CHAINS = 6    # 6

MODELOS PLANTEADOS

A partir del analisis de los modelos propuestos por Wilson & Cleary se tienen en cuenta para el planteamento de un modelo base y los modelos mas completos donde final se obtiene el modelo final.

Se establece después de las prueba de modelos frecuentistas y sus efectos indirectos, finalmente con la investigación en la literatura, el modelo bayesiano con sus variables latentes.

Modelo base: primer modelo planteado. Modelo base bio: modelo base mas la variable latente biologica. Modelo base bio ind: modelo base mas la variable latente biologica y sus respectivas variables moderadoras. model_base_bio_ind_econ: modelo base mas la variable latente biologica,con sus respectivas variables moderadoras y variable latente ecnomica. MODELO DE REFENCIA: modelo final planteado a partir de los resultados que se observaron. Modelo indic: Modelo final con efectos indirectos

model_base <- '
    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
    cv_gral ~ salud
    salud   ~ funcionalidad
    funcionalidad ~ sintomas

  # residual correlations

'


model_base_bio <- '
  # 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
    
    biologicas =~ her2_pos + edad + comorb + estadio_avz

  # regressions
    cv_gral ~ salud
    salud   ~ funcionalidad
    funcionalidad ~ sintomas
    sintomas ~ biologicas

  # residual correlations

'

model_base_bio_ind <- '
  # 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
    
    biologicas =~ her2_pos + edad + comorb + estadio_avz

  # regressions
    cv_gral ~ salud + sintomas + funcionalidad
    salud   ~ funcionalidad
    funcionalidad ~ sintomas
    sintomas ~ biologicas

  # residual correlations

'

model_base_bio_ind_econ <- '
  # 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
        
    biologicas =~ her2_pos + edad + comorb + estadio_avz
    
    socioeconom =~ estr_bajo + rs_subsid + hasta_sec  + trabaja 
 
  # regressions
    cv_gral ~ salud + sintomas + funcionalidad + companero
    salud   ~ funcionalidad
    funcionalidad ~ sintomas
    sintomas ~ biologicas

  # residual correlations

'



model_ref_bio_ind_sinedad <- '
  # 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
    
    biologicas =~ her2_pos + comorb + estadio_avz

  # regressions
    cv_gral ~ salud + sintomas + funcionalidad
    salud   ~ funcionalidad
    funcionalidad ~ sintomas
    sintomas ~ biologicas

  # residual correlations

'


model_ref_bio_ind_sinedad_indi <- '
  # 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
    
    biologicas =~ her2_pos + comorb + estadio_avz

  # regressions
    cv_gral ~ d*salud + e*sintomas + c*funcionalidad
    salud   ~ funcionalidad
    funcionalidad ~ b*sintomas
    sintomas ~ a*biologicas
    
  # indirect effect
  ab:= a*b
  abc:= a*b*c
  abcd:=a*b*c*d
  bc:= b*c
  
  # total effect
  indtot := ab + abc + abcd 
  tot := indtot + e

'

Exploracion de funcion bsem

De el paquete Blavaan que ayuda a ejecutar la estimacion de los modelos bayesianos para ecuaciones de modelos estructurales, por medio Markov Chain Monte Carlo (MCMC) el cual es un metodo de simulacion para generar muestras de las distribuciones a posteriori y estimar cantidades de interes a posteriori.

#codigo para funcion sem
set.seed(535535)
fitbase <- bsem(
  model = model_base,
  data = datos,
  auto.var = TRUE,
  auto.fix.first = TRUE,
  auto.cov.lv.x = TRUE,
  save.lvs = TRUE,
  inits = "prior", 
  sample = BURNIN1,
  burnin = SAMPLE1,
  n.chains = NCHAINS1)
## Computing posterior predictives...
set.seed(535535)
fitbase_bio <- bsem(
  model = model_base_bio,
  data = datos,
  auto.var = TRUE,
  auto.fix.first = TRUE,
  auto.cov.lv.x = TRUE,
  save.lvs = TRUE,
  inits = "prior", 
  sample = BURNIN1,
  burnin = SAMPLE1,
  n.chains = NCHAINS1)  #estable en el otro
## Computing posterior predictives...
set.seed(535535)
fitbase_bio_ind <- bsem(
  model = model_base_bio_ind,
  data = datos,
  auto.var = TRUE,
  auto.fix.first = TRUE,
  auto.cov.lv.x = TRUE,
  save.lvs = TRUE,
  inits = "prior", 
  sample = BURNIN1,
  burnin = SAMPLE1,
  n.chains = NCHAINS1)
## Computing posterior predictives...
#save(fitbase_bio_ind, file = "data/fitbase_bio_ind.Rdata") #Modelo que esta estable
#load("data/fitbase_bio_ind.Rdata")# para cargar

set.seed(535535)
fitbase_bio_ind_econ <- bsem(
  model = model_base_bio_ind_econ,
  data = datos,
  auto.var = TRUE,
  auto.fix.first = TRUE,
  auto.cov.lv.x = TRUE,
  save.lvs = TRUE,
  inits = "prior", 
  sample = BURNIN1,
  burnin = SAMPLE1,
  n.chains = NCHAINS1)
## Computing posterior predictives...
set.seed(535535)
fitref_bio_ind_sinedad <- bsem(
  model = model_ref_bio_ind_sinedad,
  data = datos,
  auto.var = TRUE,
  auto.fix.first = TRUE,
  auto.cov.lv.x = TRUE,
  save.lvs = TRUE,
  inits = "prior", 
  sample = BURNIN1,
  burnin = SAMPLE1,
  n.chains = NCHAINS1)
## Computing posterior predictives...
set.seed(535535)
fit_ref_bio_ind_sinedad_indi <- bsem(
  model = model_ref_bio_ind_sinedad_indi,
  data = datos,
  auto.var = TRUE,
  auto.fix.first = TRUE,
  auto.cov.lv.x = TRUE,
  save.lvs = TRUE,
  inits = "prior", 
  sample = BURNIN1,
  burnin = SAMPLE1,
  n.chains = NCHAINS1)
## Computing posterior predictives...

El resumen del modelo el cual nos indica diferentes resultados de interes

summary(fitbase,standardized = TRUE, rsquare=TRUE)
## ** WARNING ** blavaan (0.4-1) did NOT converge after 16000 adapt+burnin iterations
## ** WARNING ** Proceed with caution
## 
##   Number of observations                            80
## 
##   Number of missing patterns                         1
## 
##   Statistic                                 MargLogLik         PPP
##   Value                                      -1011.635       0.064
## 
## Latent Variables:
##                    Estimate  Post.SD pi.lower pi.upper   Std.lv  Std.all
##   funcionalidad =~                                                      
##     f_br23            1.000                               0.169    0.393
##     f_c30             1.478    0.163    1.201    1.840    0.250    0.709
##   sintomas =~                                                           
##     s_br23            1.000                               0.322    0.565
##     s_c30            -0.005    7.417  -25.352    3.435   -0.002   -0.007
##      Rhat    Prior       
##                          
##                          
##     1.007    normal(0,15)
##                          
##                          
##     3.644    normal(0,15)
## 
## Regressions:
##                    Estimate  Post.SD pi.lower pi.upper   Std.lv  Std.all
##   cv_gral ~                                                             
##     salud             0.899    0.046    0.809    0.988    0.899    0.857
##   salud ~                                                               
##     funcionalidad     2.612    0.392    1.909    3.446    0.442    0.328
##   funcionalidad ~                                                       
##     sintomas         -0.008    4.599   -2.198   15.700   -0.015   -0.015
##      Rhat    Prior       
##                          
##     1.000    normal(0,10)
##                          
##     1.002    normal(0,10)
##                          
##     3.554    normal(0,10)
## 
## Intercepts:
##                    Estimate  Post.SD pi.lower pi.upper   Std.lv  Std.all
##    .f_br23            2.342    0.072    2.200    2.485    2.342    5.436
##    .f_c30             2.437    0.088    2.263    2.609    2.437    6.914
##    .s_br23            1.765    0.064    1.639    1.892    1.765    3.096
##    .s_c30             2.164    0.090    1.989    2.342    2.164    9.343
##    .cv_gral           0.200    0.214   -0.217    0.625    0.200    0.142
##    .salud             4.336    0.206    3.930    4.741    4.336    3.220
##    .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.157    0.029    0.108    0.222    0.157    0.846
##    .f_c30             0.062    0.028    0.009    0.120    0.062    0.497
##    .s_br23            0.221    0.059    0.149    0.390    0.221    0.681
##    .s_c30             0.054    0.041    0.000    0.141    0.054    1.000
##    .cv_gral           0.530    0.087    0.386    0.726    0.530    0.266
##    .salud             1.617    0.283    1.147    2.250    1.617    0.892
##    .funcionalidad     0.029    0.020    0.000    0.070    1.000    1.000
##     sintomas          0.104    0.053    0.001    0.209    1.000    1.000
##      Rhat    Prior       
##     1.002 gamma(1,.5)[sd]
##     1.009 gamma(1,.5)[sd]
##     1.547 gamma(1,.5)[sd]
##     1.008 gamma(1,.5)[sd]
##     1.000 gamma(1,.5)[sd]
##     1.000 gamma(1,.5)[sd]
##     1.002 gamma(1,.5)[sd]
##     1.327 gamma(1,.5)[sd]
## 
## R-Square:
##                    Estimate
##     f_br23            0.154
##     f_c30             0.503
##     s_br23            0.319
##     s_c30             0.000
##     cv_gral           0.734
##     salud             0.108
##     funcionalidad     0.000
summary(fitbase_bio,standardized = TRUE, rsquare=TRUE)
## ** WARNING ** blavaan (0.4-1) did NOT converge after 16000 adapt+burnin iterations
## ** WARNING ** Proceed with caution
## 
##   Number of observations                            80
## 
##   Number of missing patterns                         1
## 
##   Statistic                                 MargLogLik         PPP
##   Value                                      -1597.464       0.000
## 
## Latent Variables:
##                    Estimate  Post.SD pi.lower pi.upper   Std.lv  Std.all
##   funcionalidad =~                                                      
##     f_br23            1.000                               0.177    0.406
##     f_c30             1.482    0.164    1.205    1.847    0.262    0.730
##   sintomas =~                                                           
##     s_br23            1.000                               0.280    0.510
##     s_c30             0.127    6.997  -23.834    3.394    0.036    0.159
##   biologicas =~                                                         
##     her2_pos          1.000                               0.039    0.076
##     edad             -0.355   10.487  -20.744   20.314   -0.014   -0.001
##     comorb            0.067    6.077  -13.299   13.541    0.003    0.005
##     estadio_avz      -1.051    9.638  -19.433   18.196   -0.041   -0.092
##      Rhat    Prior       
##                          
##                          
##     1.004    normal(0,15)
##                          
##                          
##     3.620    normal(0,15)
##                          
##                          
##     1.001    normal(0,10)
##     1.000    normal(0,10)
##     1.001    normal(0,10)
## 
## Regressions:
##                    Estimate  Post.SD pi.lower pi.upper   Std.lv  Std.all
##   cv_gral ~                                                             
##     salud             0.899    0.046    0.810    0.989    0.899    0.858
##   salud ~                                                               
##     funcionalidad     2.614    0.395    1.902    3.453    0.462    0.341
##   funcionalidad ~                                                       
##     sintomas         -0.081    4.315   -2.147   14.665   -0.128   -0.128
##   sintomas ~                                                            
##     biologicas        0.600    8.589  -17.028   17.528    0.083    0.083
##      Rhat    Prior       
##                          
##     1.001    normal(0,10)
##                          
##     1.001    normal(0,10)
##                          
##     3.546    normal(0,10)
##                          
##     1.001    normal(0,10)
## 
## Intercepts:
##                    Estimate  Post.SD pi.lower pi.upper   Std.lv  Std.all
##    .f_br23            2.342    0.073    2.199    2.483    2.342    5.378
##    .f_c30             2.436    0.088    2.263    2.609    2.436    6.790
##    .s_br23            1.765    0.064    1.640    1.891    1.765    3.218
##    .s_c30             2.165    0.091    1.988    2.344    2.165    9.668
##    .her2_pos          0.439    0.057    0.328    0.550    0.439    0.861
##    .edad             53.711    1.341   51.073   56.341   53.711    4.479
##    .comorb            0.337    0.055    0.227    0.445    0.337    0.707
##    .estadio_avz       0.337    0.054    0.229    0.443    0.337    0.759
##    .cv_gral           0.203    0.216   -0.218    0.637    0.203    0.143
##    .salud             4.334    0.204    3.931    4.733    4.334    3.202
##    .funcionalidad     0.000                               0.000    0.000
##    .sintomas          0.000                               0.000    0.000
##     biologicas        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,32)
##     1.000    normal(0,32)
##     1.001    normal(0,32)
##     1.000    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.158    0.030    0.109    0.225    0.158    0.835
##    .f_c30             0.060    0.028    0.007    0.119    0.060    0.467
##    .s_br23            0.222    0.059    0.149    0.393    0.222    0.739
##    .s_c30             0.049    0.040    0.000    0.138    0.049    0.975
##    .her2_pos          0.258    0.043    0.188    0.354    0.258    0.994
##    .edad            143.820   22.332  106.365  193.318  143.820    1.000
##    .comorb            0.228    0.046    0.144    0.318    0.228    1.000
##    .estadio_avz       0.195    0.063    0.027    0.300    0.195    0.992
##    .cv_gral           0.530    0.088    0.384    0.726    0.530    0.264
##    .salud             1.619    0.285    1.147    2.247    1.619    0.884
##    .funcionalidad     0.031    0.020    0.000    0.071    0.984    0.984
##    .sintomas          0.078    0.053    0.000    0.187    0.993    0.993
##     biologicas        0.002    0.004    0.000    0.011    1.000    1.000
##      Rhat    Prior       
##     1.003 gamma(1,.5)[sd]
##     1.008 gamma(1,.5)[sd]
##     1.561 gamma(1,.5)[sd]
##     1.009 gamma(1,.5)[sd]
##     1.000 gamma(1,.5)[sd]
##     1.000 gamma(1,.5)[sd]
##     1.002 gamma(1,.5)[sd]
##     1.006 gamma(1,.5)[sd]
##     1.000 gamma(1,.5)[sd]
##     1.001 gamma(1,.5)[sd]
##     1.003 gamma(1,.5)[sd]
##     1.152 gamma(1,.5)[sd]
##     1.026 gamma(1,.5)[sd]
## 
## R-Square:
##                    Estimate
##     f_br23            0.165
##     f_c30             0.533
##     s_br23            0.261
##     s_c30             0.025
##     her2_pos          0.006
##     edad              0.000
##     comorb            0.000
##     estadio_avz       0.008
##     cv_gral           0.736
##     salud             0.116
##     funcionalidad     0.016
##     sintomas          0.007
summary(fitbase_bio_ind,standardized = TRUE, rsquare=TRUE)
## blavaan (0.4-1) results of 8000 samples after 16000 adapt/burnin iterations
## 
##   Number of observations                            80
## 
##   Number of missing patterns                         1
## 
##   Statistic                                 MargLogLik         PPP
##   Value                                      -1105.048       0.001
## 
## Latent Variables:
##                    Estimate  Post.SD pi.lower pi.upper   Std.lv  Std.all
##   funcionalidad =~                                                      
##     f_br23            1.000                               0.472    0.770
##     f_c30             1.450    0.159    1.179    1.803    0.684    0.927
##   sintomas =~                                                           
##     s_br23            1.000                               0.296    0.546
##     s_c30             2.352    0.482    1.670    3.506    0.695    0.931
##   biologicas =~                                                         
##     her2_pos          1.000                               0.038    0.075
##     edad             -0.429   10.589  -21.351   20.336   -0.016   -0.001
##     comorb            0.032    6.246  -13.823   13.933    0.001    0.003
##     estadio_avz      -0.995    9.439  -19.044   18.068   -0.038   -0.085
##      Rhat    Prior       
##                          
##                          
##     1.000    normal(0,15)
##                          
##                          
##     1.001    normal(0,15)
##                          
##                          
##     1.000    normal(0,10)
##     1.000    normal(0,10)
##     1.001    normal(0,10)
## 
## Regressions:
##                    Estimate  Post.SD pi.lower pi.upper   Std.lv  Std.all
##   cv_gral ~                                                             
##     salud             0.758    0.067    0.625    0.889    0.758    0.778
##     sintomas         -0.521    5.646  -13.383   12.266   -0.154   -0.089
##     funcionalidad     0.385    3.709   -8.026    8.780    0.181    0.105
##   salud ~                                                               
##     funcionalidad     2.603    0.391    1.901    3.441    1.228    0.695
##   funcionalidad ~                                                       
##     sintomas         -1.540    0.336   -2.335   -1.041   -0.965   -0.965
##   sintomas ~                                                            
##     biologicas        0.462    8.827  -17.665   17.872    0.059    0.059
##      Rhat    Prior       
##                          
##     1.000    normal(0,10)
##     1.000    normal(0,10)
##     1.000    normal(0,10)
##                          
##     1.000    normal(0,10)
##                          
##     1.001    normal(0,10)
##                          
##     1.001    normal(0,10)
## 
## Intercepts:
##                    Estimate  Post.SD pi.lower pi.upper   Std.lv  Std.all
##    .f_br23            2.343    0.072    2.203    2.486    2.343    3.828
##    .f_c30             2.438    0.088    2.265    2.611    2.438    3.305
##    .s_br23            1.765    0.062    1.641    1.887    1.765    3.258
##    .s_c30             2.163    0.090    1.986    2.340    2.163    2.899
##    .her2_pos          0.438    0.057    0.327    0.549    0.438    0.860
##    .edad             53.716    1.340   51.091   56.337   53.716    4.483
##    .comorb            0.338    0.055    0.231    0.445    0.338    0.712
##    .estadio_avz       0.338    0.054    0.231    0.444    0.338    0.759
##    .cv_gral           0.811    0.305    0.218    1.418    0.811    0.472
##    .salud             4.338    0.205    3.934    4.742    4.338    2.456
##    .funcionalidad     0.000                               0.000    0.000
##    .sintomas          0.000                               0.000    0.000
##     biologicas        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,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.152    0.029    0.104    0.217    0.152    0.406
##    .f_c30             0.077    0.028    0.026    0.135    0.077    0.141
##    .s_br23            0.206    0.036    0.147    0.286    0.206    0.702
##    .s_c30             0.074    0.040    0.001    0.149    0.074    0.133
##    .her2_pos          0.258    0.043    0.188    0.355    0.258    0.994
##    .edad            143.585   22.424  105.817  193.123  143.585    1.000
##    .comorb            0.225    0.050    0.110    0.318    0.225    1.000
##    .estadio_avz       0.196    0.064    0.020    0.302    0.196    0.993
##    .cv_gral           0.443    0.103    0.212    0.639    0.443    0.150
##    .salud             1.613    0.286    1.138    2.258    1.613    0.517
##    .funcionalidad     0.015    0.017    0.000    0.058    0.069    0.069
##    .sintomas          0.087    0.048    0.002    0.189    0.996    0.996
##     biologicas        0.001    0.004    0.000    0.010    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.000 gamma(1,.5)[sd]
##     1.000 gamma(1,.5)[sd]
##     1.000 gamma(1,.5)[sd]
##     1.002 gamma(1,.5)[sd]
##     1.000 gamma(1,.5)[sd]
##     1.001 gamma(1,.5)[sd]
##     1.000 gamma(1,.5)[sd]
##     1.000 gamma(1,.5)[sd]
##     1.000 gamma(1,.5)[sd]
##     1.001 gamma(1,.5)[sd]
## 
## R-Square:
##                    Estimate
##     f_br23            0.594
##     f_c30             0.859
##     s_br23            0.298
##     s_c30             0.867
##     her2_pos          0.006
##     edad              0.000
##     comorb            0.000
##     estadio_avz       0.007
##     cv_gral           0.850
##     salud             0.483
##     funcionalidad     0.931
##     sintomas          0.004
summary(fitbase_bio_ind_econ,standardized = TRUE, rsquare=TRUE)
## ** WARNING ** blavaan (0.4-1) did NOT converge after 16000 adapt+burnin iterations
## ** WARNING ** Proceed with caution
## 
##   Number of observations                            80
## 
##   Number of missing patterns                         1
## 
##   Statistic                                 MargLogLik         PPP
##   Value                                      -1783.898       0.004
## 
## Latent Variables:
##                    Estimate  Post.SD pi.lower pi.upper   Std.lv  Std.all
##   funcionalidad =~                                                      
##     f_br23            1.000                               0.134    0.323
##     f_c30             1.462    0.163    1.187    1.824    0.196    0.584
##   sintomas =~                                                           
##     s_br23            1.000                               0.281    0.513
##     s_c30             0.071    7.153  -24.257    3.467    0.020    0.075
##   biologicas =~                                                         
##     her2_pos          1.000                               0.060    0.118
##     edad             -3.215   11.447  -25.686   18.838   -0.193   -0.016
##     comorb           -0.681    5.113  -11.480   10.678   -0.041   -0.085
##     estadio_avz      -1.651    8.680  -17.697   16.794   -0.099   -0.214
##   socioeconom =~                                                        
##     estr_bajo         1.000                               0.132    0.263
##     rs_subsid         3.248    2.512    0.928   10.219    0.427    0.719
##     hasta_sec         5.326    3.727    1.710   15.794    0.701    0.964
##     trabaja           0.423    0.966   -1.268    2.681    0.056    0.110
##      Rhat    Prior       
##                          
##                          
##     1.008    normal(0,15)
##                          
##                          
##     3.561    normal(0,15)
##                          
##                          
##     1.008    normal(0,10)
##     1.010    normal(0,10)
##     1.024    normal(0,10)
##                          
##                          
##     1.001    normal(0,10)
##     1.000    normal(0,10)
##     1.000    normal(0,10)
## 
## Regressions:
##                    Estimate  Post.SD pi.lower pi.upper   Std.lv  Std.all
##   cv_gral ~                                                             
##     salud             0.759    0.068    0.624    0.893    0.759    0.816
##     sintomas         -0.111    5.777  -12.967   13.191   -0.031   -0.025
##     funcionalidad     0.503    3.388   -7.272    8.427    0.067    0.055
##     companero        -0.001    0.162   -0.320    0.318   -0.001   -0.000
##   salud ~                                                               
##     funcionalidad     2.617    0.395    1.915    3.463    0.351    0.266
##   funcionalidad ~                                                       
##     sintomas         -0.116    4.437   -2.290   14.993   -0.243   -0.243
##   sintomas ~                                                            
##     biologicas        1.162    8.348  -16.631   16.796    0.249    0.249
##      Rhat    Prior       
##                          
##     1.000    normal(0,10)
##     1.008    normal(0,10)
##     1.000    normal(0,10)
##     1.000    normal(0,10)
##                          
##     1.002    normal(0,10)
##                          
##     3.543    normal(0,10)
##                          
##     1.030    normal(0,10)
## 
## Covariances:
##                    Estimate  Post.SD pi.lower pi.upper   Std.lv  Std.all
##   biologicas ~~                                                         
##     socioeconom      -0.002    0.005   -0.016    0.003   -0.262   -0.262
##      Rhat    Prior       
##                          
##     1.015       beta(1,1)
## 
## Intercepts:
##                    Estimate  Post.SD pi.lower pi.upper   Std.lv  Std.all
##    .f_br23            2.343    0.072    2.201    2.486    2.343    5.647
##    .f_c30             2.438    0.088    2.264    2.612    2.438    7.264
##    .s_br23            1.765    0.064    1.641    1.890    1.765    3.225
##    .s_c30             2.163    0.091    1.986    2.342    2.163    8.090
##    .her2_pos          0.437    0.057    0.325    0.549    0.437    0.859
##    .edad             53.717    1.341   51.072   56.339   53.717    4.505
##    .comorb            0.338    0.055    0.230    0.446    0.338    0.703
##    .estadio_avz       0.338    0.054    0.231    0.445    0.338    0.729
##    .estr_bajo         0.562    0.056    0.453    0.671    0.562    1.126
##    .rs_subsid         0.363    0.056    0.254    0.471    0.363    0.610
##    .hasta_sec         0.650    0.055    0.542    0.759    0.650    0.894
##    .trabaja           0.600    0.057    0.489    0.712    0.600    1.185
##    .cv_gral           0.809    0.311    0.202    1.423    0.809    0.660
##    .salud             4.337    0.206    3.934    4.745    4.337    3.291
##    .funcionalidad     0.000                               0.000    0.000
##    .sintomas          0.000                               0.000    0.000
##     biologicas        0.000                               0.000    0.000
##     socioeconom       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,32)
##     1.000    normal(0,32)
##     1.000    normal(0,32)
##     1.000    normal(0,32)
##     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.154    0.029    0.106    0.220    0.154    0.896
##    .f_c30             0.074    0.028    0.021    0.133    0.074    0.659
##    .s_br23            0.221    0.059    0.147    0.390    0.221    0.737
##    .s_c30             0.071    0.040    0.001    0.147    0.071    0.994
##    .her2_pos          0.256    0.043    0.185    0.352    0.256    0.986
##    .edad            142.133   22.795  103.315  192.056  142.133    1.000
##    .comorb            0.229    0.039    0.164    0.316    0.229    0.993
##    .estadio_avz       0.205    0.043    0.126    0.293    0.205    0.954
##    .estr_bajo         0.232    0.039    0.167    0.320    0.232    0.931
##    .rs_subsid         0.171    0.037    0.099    0.244    0.171    0.483
##    .hasta_sec         0.038    0.040    0.000    0.141    0.038    0.071
##    .trabaja           0.253    0.042    0.185    0.347    0.253    0.988
##    .cv_gral           0.455    0.100    0.245    0.652    0.455    0.303
##    .salud             1.614    0.285    1.139    2.254    1.614    0.929
##    .funcionalidad     0.017    0.018    0.000    0.060    0.941    0.941
##    .sintomas          0.074    0.045    0.000    0.167    0.938    0.938
##     biologicas        0.004    0.009    0.000    0.033    1.000    1.000
##     socioeconom       0.017    0.017    0.001    0.062    1.000    1.000
##      Rhat    Prior       
##     1.003 gamma(1,.5)[sd]
##     1.014 gamma(1,.5)[sd]
##     1.555 gamma(1,.5)[sd]
##     1.002 gamma(1,.5)[sd]
##     1.000 gamma(1,.5)[sd]
##     1.001 gamma(1,.5)[sd]
##     1.000 gamma(1,.5)[sd]
##     1.001 gamma(1,.5)[sd]
##     1.000 gamma(1,.5)[sd]
##     1.000 gamma(1,.5)[sd]
##     1.001 gamma(1,.5)[sd]
##     1.000 gamma(1,.5)[sd]
##     1.004 gamma(1,.5)[sd]
##     1.000 gamma(1,.5)[sd]
##     1.007 gamma(1,.5)[sd]
##     1.200 gamma(1,.5)[sd]
##     1.008 gamma(1,.5)[sd]
##     1.000 gamma(1,.5)[sd]
## 
## R-Square:
##                    Estimate
##     f_br23            0.104
##     f_c30             0.341
##     s_br23            0.263
##     s_c30             0.006
##     her2_pos          0.014
##     edad              0.000
##     comorb            0.007
##     estadio_avz       0.046
##     estr_bajo         0.069
##     rs_subsid         0.517
##     hasta_sec         0.929
##     trabaja           0.012
##     cv_gral           0.697
##     salud             0.071
##     funcionalidad     0.059
##     sintomas          0.062
summary(fitref_bio_ind_sinedad,standardized = TRUE, rsquare=TRUE)
## ** WARNING ** blavaan (0.4-1) did NOT converge after 16000 adapt+burnin iterations
## ** WARNING ** Proceed with caution
## 
##   Number of observations                            80
## 
##   Number of missing patterns                         1
## 
##   Statistic                                 MargLogLik         PPP
##   Value                                      -1000.025       0.061
## 
## Latent Variables:
##                    Estimate  Post.SD pi.lower pi.upper   Std.lv  Std.all
##   funcionalidad =~                                                      
##     f_br23            1.000                               0.419    0.698
##     f_c30            -0.029    4.582  -15.522    1.793   -0.012   -0.044
##   sintomas =~                                                           
##     s_br23            1.000                               0.294    0.543
##     s_c30             2.368    0.481    1.681    3.513    0.696    0.935
##   biologicas =~                                                         
##     her2_pos          1.000                               0.033    0.066
##     comorb            0.058    6.131  -13.571   13.574    0.002    0.004
##     estadio_avz      -1.196    9.650  -19.334   18.397   -0.040   -0.091
##      Rhat    Prior       
##                          
##                          
##     4.142    normal(0,15)
##                          
##                          
##     1.006    normal(0,15)
##                          
##                          
##     1.000    normal(0,10)
##     1.000    normal(0,10)
## 
## Regressions:
##                    Estimate  Post.SD pi.lower pi.upper   Std.lv  Std.all
##   cv_gral ~                                                             
##     salud             0.760    0.068    0.625    0.890    0.760    0.788
##     sintomas         -0.546    5.340  -12.663   11.900   -0.160   -0.131
##     funcionalidad     0.354    4.098   -8.697    9.466    0.148    0.121
##   salud ~                                                               
##     funcionalidad     0.173    7.502  -25.186    3.413    0.073    0.057
##   funcionalidad ~                                                       
##     sintomas         -1.367    0.604   -2.286    0.210   -0.960   -0.960
##   sintomas ~                                                            
##     biologicas        0.656    8.916  -17.613   17.937    0.075    0.075
##      Rhat    Prior       
##                          
##     1.005    normal(0,10)
##     1.002    normal(0,10)
##     1.002    normal(0,10)
##                          
##     4.392    normal(0,10)
##                          
##     1.955    normal(0,10)
##                          
##     1.001    normal(0,10)
## 
## Intercepts:
##                    Estimate  Post.SD pi.lower pi.upper   Std.lv  Std.all
##    .f_br23            2.343    0.073    2.200    2.485    2.343    3.902
##    .f_c30             2.438    0.088    2.265    2.610    2.438    8.832
##    .s_br23            1.765    0.063    1.641    1.889    1.765    3.261
##    .s_c30             2.164    0.090    1.988    2.340    2.164    2.906
##    .her2_pos          0.438    0.057    0.326    0.549    0.438    0.860
##    .comorb            0.337    0.055    0.231    0.446    0.337    0.704
##    .estadio_avz       0.338    0.055    0.231    0.445    0.338    0.765
##    .cv_gral           0.806    0.306    0.214    1.420    0.806    0.656
##    .salud             4.337    0.204    3.937    4.740    4.337    3.408
##    .funcionalidad     0.000                               0.000    0.000
##    .sintomas          0.000                               0.000    0.000
##     biologicas        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,32)
##     1.000    normal(0,32)
##     1.000    normal(0,32)
##     1.005    normal(0,10)
##     1.000    normal(0,10)
##                          
##                          
##                          
## 
## Variances:
##                    Estimate  Post.SD pi.lower pi.upper   Std.lv  Std.all
##    .f_br23            0.185    0.105    0.106    0.526    0.185    0.513
##    .f_c30             0.076    0.030    0.018    0.138    0.076    0.998
##    .s_br23            0.207    0.036    0.147    0.288    0.207    0.705
##    .s_c30             0.070    0.040    0.001    0.147    0.070    0.126
##    .her2_pos          0.258    0.042    0.188    0.353    0.258    0.996
##    .comorb            0.230    0.042    0.157    0.319    0.230    1.000
##    .estadio_avz       0.193    0.065    0.016    0.300    0.193    0.992
##    .cv_gral           0.445    0.103    0.220    0.639    0.445    0.296
##    .salud             1.615    0.286    1.140    2.255    1.615    0.997
##    .funcionalidad     0.014    0.017    0.000    0.057    0.079    0.079
##    .sintomas          0.086    0.047    0.002    0.186    0.994    0.994
##     biologicas        0.001    0.003    0.000    0.007    1.000    1.000
##      Rhat    Prior       
##     2.858 gamma(1,.5)[sd]
##     1.004 gamma(1,.5)[sd]
##     1.001 gamma(1,.5)[sd]
##     1.041 gamma(1,.5)[sd]
##     1.000 gamma(1,.5)[sd]
##     1.000 gamma(1,.5)[sd]
##     1.001 gamma(1,.5)[sd]
##     1.007 gamma(1,.5)[sd]
##     1.002 gamma(1,.5)[sd]
##     1.040 gamma(1,.5)[sd]
##     1.001 gamma(1,.5)[sd]
##     1.000 gamma(1,.5)[sd]
## 
## R-Square:
##                    Estimate
##     f_br23            0.487
##     f_c30             0.002
##     s_br23            0.295
##     s_c30             0.874
##     her2_pos          0.004
##     comorb            0.000
##     estadio_avz       0.008
##     cv_gral           0.704
##     salud             0.003
##     funcionalidad     0.921
##     sintomas          0.006
summary(fit_ref_bio_ind_sinedad_indi,standardized = TRUE, rsquare=TRUE)
## ** WARNING ** blavaan (0.4-1) did NOT converge after 16000 adapt+burnin iterations
## ** WARNING ** Proceed with caution
## 
##   Number of observations                            80
## 
##   Number of missing patterns                         1
## 
##   Statistic                                 MargLogLik         PPP
##   Value                                      -1000.025       0.061
## 
## Latent Variables:
##                    Estimate  Post.SD pi.lower pi.upper   Std.lv  Std.all
##   funcionalidad =~                                                      
##     f_br23            1.000                               0.419    0.698
##     f_c30            -0.029    4.582  -15.522    1.793   -0.012   -0.044
##   sintomas =~                                                           
##     s_br23            1.000                               0.294    0.543
##     s_c30             2.368    0.481    1.681    3.513    0.696    0.935
##   biologicas =~                                                         
##     her2_pos          1.000                               0.033    0.066
##     comorb            0.058    6.131  -13.571   13.574    0.002    0.004
##     estadio_avz      -1.196    9.650  -19.334   18.397   -0.040   -0.091
##      Rhat    Prior       
##                          
##                          
##     4.142    normal(0,15)
##                          
##                          
##     1.006    normal(0,15)
##                          
##                          
##     1.000    normal(0,10)
##     1.000    normal(0,10)
## 
## Regressions:
##                    Estimate  Post.SD pi.lower pi.upper   Std.lv  Std.all
##   cv_gral ~                                                             
##     salud      (d)    0.760    0.068    0.625    0.890    0.760    0.788
##     sintomas   (e)   -0.546    5.340  -12.663   11.900   -0.160   -0.131
##     funcionldd (c)    0.354    4.098   -8.697    9.466    0.148    0.121
##   salud ~                                                               
##     funcionldd        0.173    7.502  -25.186    3.413    0.073    0.057
##   funcionalidad ~                                                       
##     sintomas   (b)   -1.367    0.604   -2.286    0.210   -0.960   -0.960
##   sintomas ~                                                            
##     biologicas (a)    0.656    8.916  -17.613   17.937    0.075    0.075
##      Rhat    Prior       
##                          
##     1.005    normal(0,10)
##     1.002    normal(0,10)
##     1.002    normal(0,10)
##                          
##     4.392    normal(0,10)
##                          
##     1.955    normal(0,10)
##                          
##     1.001    normal(0,10)
## 
## Intercepts:
##                    Estimate  Post.SD pi.lower pi.upper   Std.lv  Std.all
##    .f_br23            2.343    0.073    2.200    2.485    2.343    3.902
##    .f_c30             2.438    0.088    2.265    2.610    2.438    8.832
##    .s_br23            1.765    0.063    1.641    1.889    1.765    3.261
##    .s_c30             2.164    0.090    1.988    2.340    2.164    2.906
##    .her2_pos          0.438    0.057    0.326    0.549    0.438    0.860
##    .comorb            0.337    0.055    0.231    0.446    0.337    0.704
##    .estadio_avz       0.338    0.055    0.231    0.445    0.338    0.765
##    .cv_gral           0.806    0.306    0.214    1.420    0.806    0.656
##    .salud             4.337    0.204    3.937    4.740    4.337    3.408
##    .funcionalidad     0.000                               0.000    0.000
##    .sintomas          0.000                               0.000    0.000
##     biologicas        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,32)
##     1.000    normal(0,32)
##     1.000    normal(0,32)
##     1.005    normal(0,10)
##     1.000    normal(0,10)
##                          
##                          
##                          
## 
## Variances:
##                    Estimate  Post.SD pi.lower pi.upper   Std.lv  Std.all
##    .f_br23            0.185    0.105    0.106    0.526    0.185    0.513
##    .f_c30             0.076    0.030    0.018    0.138    0.076    0.998
##    .s_br23            0.207    0.036    0.147    0.288    0.207    0.705
##    .s_c30             0.070    0.040    0.001    0.147    0.070    0.126
##    .her2_pos          0.258    0.042    0.188    0.353    0.258    0.996
##    .comorb            0.230    0.042    0.157    0.319    0.230    1.000
##    .estadio_avz       0.193    0.065    0.016    0.300    0.193    0.992
##    .cv_gral           0.445    0.103    0.220    0.639    0.445    0.296
##    .salud             1.615    0.286    1.140    2.255    1.615    0.997
##    .funcionalidad     0.014    0.017    0.000    0.057    0.079    0.079
##    .sintomas          0.086    0.047    0.002    0.186    0.994    0.994
##     biologicas        0.001    0.003    0.000    0.007    1.000    1.000
##      Rhat    Prior       
##     2.858 gamma(1,.5)[sd]
##     1.004 gamma(1,.5)[sd]
##     1.001 gamma(1,.5)[sd]
##     1.041 gamma(1,.5)[sd]
##     1.000 gamma(1,.5)[sd]
##     1.000 gamma(1,.5)[sd]
##     1.001 gamma(1,.5)[sd]
##     1.007 gamma(1,.5)[sd]
##     1.002 gamma(1,.5)[sd]
##     1.040 gamma(1,.5)[sd]
##     1.001 gamma(1,.5)[sd]
##     1.000 gamma(1,.5)[sd]
## 
## R-Square:
##                    Estimate
##     f_br23            0.487
##     f_c30             0.002
##     s_br23            0.295
##     s_c30             0.874
##     her2_pos          0.004
##     comorb            0.000
##     estadio_avz       0.008
##     cv_gral           0.704
##     salud             0.003
##     funcionalidad     0.921
##     sintomas          0.006
## 
## Defined Parameters:
##                    Estimate  Post.SD pi.lower pi.upper   Std.lv  Std.all
##     ab               -0.897   13.235  -26.837   25.043   -0.072   -0.072
##     abc              -0.317   47.722  -93.850   93.216   -0.011   -0.009
##     abcd             -0.241   36.039  -70.876   70.394   -0.008   -0.007
##     bc               -0.483    5.346  -10.961    9.994   -0.142   -0.116
##     indtot           -1.455   86.058 -170.125  167.215   -0.090   -0.087
##     tot              -2.001   86.055 -170.666  166.664   -0.251   -0.218
##      Rhat    Prior       
##                          
##                          
##                          
##                          
##                          
## 

Informacion del BRMSEA

blavFitIndices(fitbase)
## Posterior mean (EAP) of devm-based fit indices:
## 
##       BRMSEA    BGammaHat adjBGammaHat          BMc 
##        0.196        0.927        0.659        0.888
blavFitIndices(fitbase_bio)
## Posterior mean (EAP) of devm-based fit indices:
## 
##       BRMSEA    BGammaHat adjBGammaHat          BMc 
##        0.144        0.870        0.764        0.689
blavFitIndices(fitbase_bio_ind) #Estable
## Posterior mean (EAP) of devm-based fit indices:
## 
##       BRMSEA    BGammaHat adjBGammaHat          BMc 
##        0.129        0.890        0.808        0.735
blavFitIndices(fitbase_bio_ind_econ)
## Posterior mean (EAP) of devm-based fit indices:
## 
##       BRMSEA    BGammaHat adjBGammaHat          BMc 
##        0.095        0.898        0.852        0.656
blavFitIndices(fitref_bio_ind_sinedad)
## Posterior mean (EAP) of devm-based fit indices:
## 
##       BRMSEA    BGammaHat adjBGammaHat          BMc 
##        0.123        0.925        0.819        0.834
blavFitIndices(fit_ref_bio_ind_sinedad_indi)
## Posterior mean (EAP) of devm-based fit indices:
## 
##       BRMSEA    BGammaHat adjBGammaHat          BMc 
##        0.123        0.925        0.819        0.834

Informacion de R hat modelo de referencia

blavInspect(fitref_bio_ind_sinedad, 'rhat')
##         funcionalidad=~f_c30              sintomas=~s_c30 
##                    4.1416945                    1.0057563 
##           biologicas=~comorb      biologicas=~estadio_avz 
##                    1.0003526                    1.0004456 
##                cv_gral~salud             cv_gral~sintomas 
##                    1.0050586                    1.0017878 
##        cv_gral~funcionalidad          salud~funcionalidad 
##                    1.0019100                    4.3917103 
##       funcionalidad~sintomas          sintomas~biologicas 
##                    1.9549747                    1.0007313 
##               f_br23~~f_br23                 f_c30~~f_c30 
##                    2.8578249                    1.0035277 
##               s_br23~~s_br23                 s_c30~~s_c30 
##                    1.0010867                    1.0408338 
##           her2_pos~~her2_pos               comorb~~comorb 
##                    0.9999434                    1.0001239 
##     estadio_avz~~estadio_avz             cv_gral~~cv_gral 
##                    1.0012542                    1.0070653 
##                 salud~~salud funcionalidad~~funcionalidad 
##                    1.0015160                    1.0397867 
##           sintomas~~sintomas       biologicas~~biologicas 
##                    1.0014242                    1.0003310 
##                     f_br23~1                      f_c30~1 
##                    1.0001414                    1.0002870 
##                     s_br23~1                      s_c30~1 
##                    1.0001496                    1.0003307 
##                   her2_pos~1                     comorb~1 
##                    0.9999232                    0.9999847 
##                estadio_avz~1                    cv_gral~1 
##                    1.0000231                    1.0046053 
##                      salud~1 
##                    1.0001564

Informacion del neff modelo de referencia

blavInspect(fitref_bio_ind_sinedad, 'neff')
##         funcionalidad=~f_c30              sintomas=~s_c30 
##                 5.310336e+00                 8.986759e+03 
##           biologicas=~comorb      biologicas=~estadio_avz 
##                 3.703932e+04                 1.516862e+04 
##                cv_gral~salud             cv_gral~sintomas 
##                 1.100330e+04                 8.925498e+03 
##        cv_gral~funcionalidad          salud~funcionalidad 
##                 1.069878e+04                 5.271663e+00 
##       funcionalidad~sintomas          sintomas~biologicas 
##                 6.725866e+00                 1.720989e+04 
##               f_br23~~f_br23                 f_c30~~f_c30 
##                 5.674639e+00                 1.574809e+04 
##               s_br23~~s_br23                 s_c30~~s_c30 
##                 7.836849e+04                 7.781605e+01 
##           her2_pos~~her2_pos               comorb~~comorb 
##                 9.652116e+04                 3.892976e+04 
##     estadio_avz~~estadio_avz             cv_gral~~cv_gral 
##                 1.348066e+04                 3.996257e+03 
##                 salud~~salud funcionalidad~~funcionalidad 
##                 7.760741e+04                 8.548301e+01 
##           sintomas~~sintomas       biologicas~~biologicas 
##                 2.966903e+04                 3.775208e+04 
##                     f_br23~1                      f_c30~1 
##                 3.770940e+04                 3.139352e+04 
##                     s_br23~1                      s_c30~1 
##                 4.904776e+04                 3.152051e+04 
##                   her2_pos~1                     comorb~1 
##                 1.030892e+05                 1.024333e+05 
##                estadio_avz~1                    cv_gral~1 
##                 9.705563e+04                 2.165530e+04 
##                      salud~1 
##                 4.087441e+04

Graficos de modelos sem bayesiano con la funcion semplot

semPaths(
  fitbase,
  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"
)

semPaths(
  fitbase_bio,
  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"
)

semPaths(
  fitbase_bio_ind,
  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"
)

semPaths(
  fitbase_bio_ind_econ,
  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"
)

semPaths(
  fitref_bio_ind_sinedad,
  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"
)

graficos de mcmc

plot(fitbase, par = 1:12,  facet_args = list(ncol = 4))

plot(fitbase_bio, par = 1:12,  facet_args = list(ncol = 4))

plot(fitbase_bio_ind, par = 1:12,  facet_args = list(ncol = 4))

plot(fitbase_bio_ind_econ, par = 1:12,  facet_args = list(ncol = 4))

plot(fitref_bio_ind_sinedad, par = 1:12,  facet_args = list(ncol = 4))

continuacion de graficos mcmc modelos ref

plot(fitbase, facet_args = list(ncol = 4))

plot(fitbase_bio, facet_args = list(ncol = 4))

plot(fitbase_bio_ind, facet_args = list(ncol = 4))

plot(fitbase_bio_ind_econ, facet_args = list(ncol = 4))

plot(fitref_bio_ind_sinedad, facet_args = list(ncol = 4))

Grafico de intervalos todo modelos ref

plot(fitbase,  plot.type = "intervals")

plot(fitbase_bio,  plot.type = "intervals")

plot(fitbase_bio_ind,  plot.type = "intervals")

plot(fitbase_bio_ind_econ,  plot.type = "intervals")

plot(fitref_bio_ind_sinedad,  plot.type = "intervals")

Gráfico de coordenas paralelas de todos modelos ref

plot(fitbase, plot.type = "parcoord")

plot(fitbase_bio, plot.type = "parcoord")

plot(fitbase_bio_ind, plot.type = "parcoord")

plot(fitbase_bio_ind_econ, plot.type = "parcoord")

plot(fitref_bio_ind_sinedad, plot.type = "parcoord")

Tabla de indices relevantes para describir el SEM

describe_posterior(fitref_bio_ind_sinedad)
## Summary of Posterior Distribution
## 
## Parameter                    |  Component |   Median |          95% CI |     pd |          ROPE | % in ROPE |  Rhat |      ESS
## ------------------------------------------------------------------------------------------------------------------------------
## funcionalidad=~f_c30         |     latent |     1.42 | [-13.08,  2.10] | 90.00% | [-0.10, 0.10] |        0% | 4.142 |     5.00
## sintomas=~s_c30              |     latent |     2.29 | [  1.57,  3.29] |   100% | [-0.10, 0.10] |        0% | 1.006 |  8987.00
## biologicas=~comorb           |     latent |     0.09 | [-13.79, 13.32] | 51.15% | [-0.10, 0.10] |     2.60% | 1.000 | 37039.00
## biologicas=~estadio_avz      |     latent |    -2.13 | [-19.56, 18.12] | 57.39% | [-0.10, 0.10] |     0.54% | 1.000 | 15169.00
## cv_gral~salud                | regression |     0.76 | [  0.63,  0.89] |   100% | [-0.10, 0.10] |        0% | 1.005 | 11003.00
## cv_gral~sintomas             | regression |    -0.60 | [-12.76, 11.77] | 61.33% | [-0.10, 0.10] |     3.54% | 1.002 |  8925.00
## cv_gral~funcionalidad        | regression |     0.37 | [ -8.88,  9.25] | 58.80% | [-0.10, 0.10] |     4.83% | 1.002 | 10699.00
## salud~funcionalidad          | regression |     2.53 | [-21.40,  4.04] | 90.00% | [-0.10, 0.10] |        0% | 4.392 |     5.00
## funcionalidad~sintomas       | regression |    -1.45 | [ -2.15,  0.27] | 90.00% | [-0.10, 0.10] |     0.49% | 1.955 |     7.00
## sintomas~biologicas          | regression |     1.41 | [-17.01, 18.50] | 56.93% | [-0.10, 0.10] |     0.77% | 1.001 | 17210.00
## f_br23~~f_br23               |   residual |     0.15 | [  0.09,  0.47] |   100% | [-0.10, 0.10] |     0.99% | 2.858 |     6.00
## f_c30~~f_c30                 |   residual |     0.08 | [  0.02,  0.14] |   100% | [-0.10, 0.10] |    82.20% | 1.004 | 15748.00
## s_br23~~s_br23               |   residual |     0.20 | [  0.14,  0.28] |   100% | [-0.10, 0.10] |        0% | 1.001 | 78368.00
## s_c30~~s_c30                 |   residual |     0.07 | [  0.00,  0.13] |   100% | [-0.10, 0.10] |    80.10% | 1.041 |    78.00
## her2_pos~~her2_pos           |   residual |     0.25 | [  0.18,  0.34] |   100% | [-0.10, 0.10] |        0% | 1.000 | 96521.00
## comorb~~comorb               |   residual |     0.23 | [  0.16,  0.32] |   100% | [-0.10, 0.10] |        0% | 1.000 | 38930.00
## estadio_avz~~estadio_avz     |   residual |     0.20 | [  0.00,  0.28] |   100% | [-0.10, 0.10] |     9.88% | 1.001 | 13481.00
## cv_gral~~cv_gral             |   residual |     0.45 | [  0.26,  0.66] |   100% | [-0.10, 0.10] |        0% | 1.007 |  3996.00
## salud~~salud                 |   residual |     1.59 | [  1.10,  2.19] |   100% | [-0.10, 0.10] |        0% | 1.002 | 77607.00
## funcionalidad~~funcionalidad |   residual | 6.22e-03 | [  0.00,  0.05] |   100% | [-0.10, 0.10] |      100% | 1.040 |    85.00
## sintomas~~sintomas           |   residual |     0.08 | [  0.00,  0.17] |   100% | [-0.10, 0.10] |    67.01% | 1.001 | 29669.00
## biologicas~~biologicas       |   residual | 3.99e-04 | [  0.00,  0.00] |   100% | [-0.10, 0.10] |      100% | 1.000 | 37752.00
## f_br23~1                     |  intercept |     2.34 | [  2.20,  2.49] |   100% | [-0.10, 0.10] |        0% | 1.000 | 37709.00
## f_c30~1                      |  intercept |     2.44 | [  2.27,  2.61] |   100% | [-0.10, 0.10] |        0% | 1.000 | 31394.00
## s_br23~1                     |  intercept |     1.77 | [  1.64,  1.89] |   100% | [-0.10, 0.10] |        0% | 1.000 | 49048.00
## s_c30~1                      |  intercept |     2.16 | [  1.99,  2.34] |   100% | [-0.10, 0.10] |        0% | 1.000 | 31521.00
## her2_pos~1                   |  intercept |     0.44 | [  0.33,  0.55] |   100% | [-0.10, 0.10] |        0% | 1.000 | 1.03e+05
## comorb~1                     |  intercept |     0.34 | [  0.23,  0.44] |   100% | [-0.10, 0.10] |        0% | 1.000 | 1.02e+05
## estadio_avz~1                |  intercept |     0.34 | [  0.23,  0.44] |   100% | [-0.10, 0.10] |        0% | 1.000 | 97056.00
## cv_gral~1                    |  intercept |     0.80 | [  0.22,  1.43] | 99.62% | [-0.10, 0.10] |        0% | 1.005 | 21655.00
## salud~1                      |  intercept |     4.34 | [  3.94,  4.74] |   100% | [-0.10, 0.10] |        0% | 1.000 | 40874.00
sexit(fitref_bio_ind_sinedad)
## # Following the Sequential Effect eXistence and sIgnificance Testing (SEXIT) framework, we report the median of the posterior distribution and its 95% CI (Highest Density Interval), along the probability of direction (pd), the probability of significance and the probability of being large. The thresholds beyond which the effect is considered as significant (i.e., non-negligible) and large are |0.05| and |0.30|.
## 
## - funcionalidad=~f_c30 (Median = 1.42, 95% CI [-13.08, 2.10]) has a 90.00% probability of being positive (> 0), 90.00% of being significant (> 0.05), and 90.00% of being large (> 0.30)
## - sintomas=~s_c30 (Median = 2.29, 95% CI [1.57, 3.29]) has a 100.00% probability of being positive (> 0), 100.00% of being significant (> 0.05), and 100.00% of being large (> 0.30)
## - biologicas=~comorb (Median = 0.09, 95% CI [-13.79, 13.32]) has a 51.15% probability of being positive (> 0), 50.50% of being significant (> 0.05), and 47.39% of being large (> 0.30)
## - biologicas=~estadio_avz (Median = -2.13, 95% CI [-19.56, 18.12]) has a 57.39% probability of being negative (< 0), 57.24% of being significant (< -0.05), and 56.59% of being large (< -0.30)
## - cv_gral~salud (Median = 0.76, 95% CI [0.63, 0.89]) has a 100.00% probability of being positive (> 0), 100.00% of being significant (> 0.05), and 100.00% of being large (> 0.30)
## - cv_gral~sintomas (Median = -0.60, 95% CI [-12.76, 11.77]) has a 61.33% probability of being negative (< 0), 60.48% of being significant (< -0.05), and 55.95% of being large (< -0.30)
## - cv_gral~funcionalidad (Median = 0.37, 95% CI [-8.88, 9.25]) has a 58.80% probability of being positive (> 0), 57.67% of being significant (> 0.05), and 51.54% of being large (> 0.30)
## - salud~funcionalidad (Median = 2.53, 95% CI [-21.40, 4.04]) has a 90.00% probability of being positive (> 0), 90.00% of being significant (> 0.05), and 90.00% of being large (> 0.30)
## - funcionalidad~sintomas (Median = -1.45, 95% CI [-2.15, 0.27]) has a 90.00% probability of being negative (< 0), 90.00% of being significant (< -0.05), and 90.00% of being large (< -0.30)
## - sintomas~biologicas (Median = 1.41, 95% CI [-17.01, 18.50]) has a 56.93% probability of being positive (> 0), 56.75% of being significant (> 0.05), and 55.82% of being large (> 0.30)
## - f_br23~~f_br23 (Median = 0.15, 95% CI [0.09, 0.47]) has a 100.00% probability of being positive (> 0), 100.00% of being significant (> 0.05), and 10.00% of being large (> 0.30)
## - f_c30~~f_c30 (Median = 0.08, 95% CI [0.02, 0.14]) has a 100.00% probability of being positive (> 0), 82.18% of being significant (> 0.05), and 0.00% of being large (> 0.30)
## - s_br23~~s_br23 (Median = 0.20, 95% CI [0.14, 0.28]) has a 100.00% probability of being positive (> 0), 100.00% of being significant (> 0.05), and 1.47% of being large (> 0.30)
## - s_c30~~s_c30 (Median = 0.07, 95% CI [5.58e-10, 0.13]) has a 100.00% probability of being positive (> 0), 68.52% of being significant (> 0.05), and 0.00% of being large (> 0.30)
## - her2_pos~~her2_pos (Median = 0.25, 95% CI [0.18, 0.34]) has a 100.00% probability of being positive (> 0), 100.00% of being significant (> 0.05), and 15.33% of being large (> 0.30)
## - comorb~~comorb (Median = 0.23, 95% CI [0.16, 0.32]) has a 100.00% probability of being positive (> 0), 99.78% of being significant (> 0.05), and 5.38% of being large (> 0.30)
## - estadio_avz~~estadio_avz (Median = 0.20, 95% CI [1.20e-10, 0.28]) has a 100.00% probability of being positive (> 0), 94.98% of being significant (> 0.05), and 2.53% of being large (> 0.30)
## - cv_gral~~cv_gral (Median = 0.45, 95% CI [0.26, 0.66]) has a 100.00% probability of being positive (> 0), 99.16% of being significant (> 0.05), and 94.34% of being large (> 0.30)
## - salud~~salud (Median = 1.59, 95% CI [1.10, 2.19]) has a 100.00% probability of being positive (> 0), 100.00% of being significant (> 0.05), and 100.00% of being large (> 0.30)
## - funcionalidad~~funcionalidad (Median = 6.22e-03, 95% CI [1.92e-13, 0.05]) has a 100.00% probability of being positive (> 0), 4.66% of being significant (> 0.05), and 0.00% of being large (> 0.30)
## - sintomas~~sintomas (Median = 0.08, 95% CI [2.82e-10, 0.17]) has a 100.00% probability of being positive (> 0), 77.12% of being significant (> 0.05), and 0.03% of being large (> 0.30)
## - biologicas~~biologicas (Median = 3.99e-04, 95% CI [8.84e-13, 4.37e-03]) has a 100.00% probability of being positive (> 0), 0.03% of being significant (> 0.05), and 0.00% of being large (> 0.30)
## - f_br23~1 (Median = 2.34, 95% CI [2.20, 2.49]) has a 100.00% probability of being positive (> 0), 100.00% of being significant (> 0.05), and 100.00% of being large (> 0.30)
## - f_c30~1 (Median = 2.44, 95% CI [2.27, 2.61]) has a 100.00% probability of being positive (> 0), 100.00% of being significant (> 0.05), and 100.00% of being large (> 0.30)
## - s_br23~1 (Median = 1.77, 95% CI [1.64, 1.89]) has a 100.00% probability of being positive (> 0), 100.00% of being significant (> 0.05), and 100.00% of being large (> 0.30)
## - s_c30~1 (Median = 2.16, 95% CI [1.99, 2.34]) has a 100.00% probability of being positive (> 0), 100.00% of being significant (> 0.05), and 100.00% of being large (> 0.30)
## - her2_pos~1 (Median = 0.44, 95% CI [0.33, 0.55]) has a 100.00% probability of being positive (> 0), 100.00% of being significant (> 0.05), and 99.19% of being large (> 0.30)
## - comorb~1 (Median = 0.34, 95% CI [0.23, 0.44]) has a 100.00% probability of being positive (> 0), 100.00% of being significant (> 0.05), and 75.20% of being large (> 0.30)
## - estadio_avz~1 (Median = 0.34, 95% CI [0.23, 0.44]) has a 100.00% probability of being positive (> 0), 100.00% of being significant (> 0.05), and 75.72% of being large (> 0.30)
## - cv_gral~1 (Median = 0.80, 95% CI [0.22, 1.43]) has a 99.62% probability of being positive (> 0), 99.38% of being significant (> 0.05), and 95.33% of being large (> 0.30)
## - salud~1 (Median = 4.34, 95% CI [3.94, 4.74]) has a 100.00% probability of being positive (> 0), 100.00% of being significant (> 0.05), and 100.00% of being large (> 0.30)
## 
## Parameter                    |   Median |               95% CI | Direction | Significance (> |0.05|) | Large (> |0.30|)
## -----------------------------------------------------------------------------------------------------------------------
## funcionalidad=~f_c30         |     1.42 |       [-13.08, 2.10] |      0.90 |                    0.90 |             0.90
## sintomas=~s_c30              |     2.29 |         [1.57, 3.29] |      1.00 |                    1.00 |             1.00
## biologicas=~comorb           |     0.09 |      [-13.79, 13.32] |      0.51 |                    0.50 |             0.47
## biologicas=~estadio_avz      |    -2.13 |      [-19.56, 18.12] |      0.57 |                    0.57 |             0.57
## cv_gral~salud                |     0.76 |         [0.63, 0.89] |      1.00 |                    1.00 |             1.00
## cv_gral~sintomas             |    -0.60 |      [-12.76, 11.77] |      0.61 |                    0.60 |             0.56
## cv_gral~funcionalidad        |     0.37 |        [-8.88, 9.25] |      0.59 |                    0.58 |             0.52
## salud~funcionalidad          |     2.53 |       [-21.40, 4.04] |      0.90 |                    0.90 |             0.90
## funcionalidad~sintomas       |    -1.45 |        [-2.15, 0.27] |      0.90 |                    0.90 |             0.90
## sintomas~biologicas          |     1.41 |      [-17.01, 18.50] |      0.57 |                    0.57 |             0.56
## f_br23~~f_br23               |     0.15 |         [0.09, 0.47] |      1.00 |                    1.00 |             0.10
## f_c30~~f_c30                 |     0.08 |         [0.02, 0.14] |      1.00 |                    0.82 |             0.00
## s_br23~~s_br23               |     0.20 |         [0.14, 0.28] |      1.00 |                    1.00 |             0.01
## s_c30~~s_c30                 |     0.07 |     [5.58e-10, 0.13] |      1.00 |                    0.69 |             0.00
## her2_pos~~her2_pos           |     0.25 |         [0.18, 0.34] |      1.00 |                    1.00 |             0.15
## comorb~~comorb               |     0.23 |         [0.16, 0.32] |      1.00 |                    1.00 |             0.05
## estadio_avz~~estadio_avz     |     0.20 |     [1.20e-10, 0.28] |      1.00 |                    0.95 |             0.03
## cv_gral~~cv_gral             |     0.45 |         [0.26, 0.66] |      1.00 |                    0.99 |             0.94
## salud~~salud                 |     1.59 |         [1.10, 2.19] |      1.00 |                    1.00 |             1.00
## funcionalidad~~funcionalidad | 6.22e-03 |     [1.92e-13, 0.05] |      1.00 |                    0.05 |             0.00
## sintomas~~sintomas           |     0.08 |     [2.82e-10, 0.17] |      1.00 |                    0.77 |         3.38e-04
## biologicas~~biologicas       | 3.99e-04 | [8.84e-13, 4.37e-03] |      1.00 |                2.75e-04 |             0.00
## f_br23~1                     |     2.34 |         [2.20, 2.49] |      1.00 |                    1.00 |             1.00
## f_c30~1                      |     2.44 |         [2.27, 2.61] |      1.00 |                    1.00 |             1.00
## s_br23~1                     |     1.77 |         [1.64, 1.89] |      1.00 |                    1.00 |             1.00
## s_c30~1                      |     2.16 |         [1.99, 2.34] |      1.00 |                    1.00 |             1.00
## her2_pos~1                   |     0.44 |         [0.33, 0.55] |      1.00 |                    1.00 |             0.99
## comorb~1                     |     0.34 |         [0.23, 0.44] |      1.00 |                    1.00 |             0.75
## estadio_avz~1                |     0.34 |         [0.23, 0.44] |      1.00 |                    1.00 |             0.76
## cv_gral~1                    |     0.80 |         [0.22, 1.43] |      1.00 |                    0.99 |             0.95
## salud~1                      |     4.34 |         [3.94, 4.74] |      1.00 |                    1.00 |             1.00

Comparacion de todos los modelos vs modelo de referencia

comparison <- bayesfactor_models(fitbase,fitbase_bio,fitbase_bio_ind,fitbase_bio_ind_econ,  denominator = fitref_bio_ind_sinedad)

comparison
## Bayes Factors for Model Comparison
## 
##     Model                       BF
## [1] fitbase               9.08e-06
## [2] fitbase_bio          3.43e-260
## [3] fitbase_bio_ind       2.45e-46
## [4] fitbase_bio_ind_econ  0.00e+00
## 
## * Against Denominator: [5] fitref_bio_ind_sinedad
## *   Bayes Factor Type: marginal likelihoods (Laplace approximation)
mat_comp <- as.matrix(comparison)

heatmap(mat_comp)