#Teoría Los Modelos de Ecuaciones Estructurales (SEM) es una técnica de análisis de estadística multicariada, que permite analizar patrones complejos de relaciones entre variables, realizar copraciones entre intragrupos, y validar modelos teoricos y empiricos.

Ejemplo 1. Estudio de Holzinger y Swinefor (1939)

##Contexto Holzimger y Swineford realizaron examenes de habilidad mental a adolescentes de 7 y 8vo de dos escuela (Pateur y Grand-White)

La base de datos esta incluida comp paquete en R, e incluye las siguientes columnas:

  • sex: Género (1=male, 2=female) x1: Percepción visual x2: Juegos con cubos x3: Juego con pastillas/espacial x4: Comprensión de parrafos x5: Completar oraciones x6: Significado de palabras x7: Percepción Sumas aceleradas x8: Percepción Conteo acelerado de puntos *x9: Discriminación acelerada de mayusculos rectas y curvas

Se busca identificar las relaciones entre habilidades visual (x1,x2,x3), textual (x4, x5, x6) y velocidad (x7, x8, x9) de los adolescentes.

Instalar paquetes y llamar librerias

#install.packages ("lavaan") #Latent Variable Analysis
library(lavaan)
#install.packages("lavaanPlot")
library(lavaanPlot)

Importar la base de datos

df1 <- HolzingerSwineford1939

Entender la base de datos

summary(df1)
##        id             sex            ageyr        agemo       
##  Min.   :  1.0   Min.   :1.000   Min.   :11   Min.   : 0.000  
##  1st Qu.: 82.0   1st Qu.:1.000   1st Qu.:12   1st Qu.: 2.000  
##  Median :163.0   Median :2.000   Median :13   Median : 5.000  
##  Mean   :176.6   Mean   :1.515   Mean   :13   Mean   : 5.375  
##  3rd Qu.:272.0   3rd Qu.:2.000   3rd Qu.:14   3rd Qu.: 8.000  
##  Max.   :351.0   Max.   :2.000   Max.   :16   Max.   :11.000  
##                                                               
##          school        grade             x1               x2       
##  Grant-White:145   Min.   :7.000   Min.   :0.6667   Min.   :2.250  
##  Pasteur    :156   1st Qu.:7.000   1st Qu.:4.1667   1st Qu.:5.250  
##                    Median :7.000   Median :5.0000   Median :6.000  
##                    Mean   :7.477   Mean   :4.9358   Mean   :6.088  
##                    3rd Qu.:8.000   3rd Qu.:5.6667   3rd Qu.:6.750  
##                    Max.   :8.000   Max.   :8.5000   Max.   :9.250  
##                    NA's   :1                                       
##        x3              x4              x5              x6        
##  Min.   :0.250   Min.   :0.000   Min.   :1.000   Min.   :0.1429  
##  1st Qu.:1.375   1st Qu.:2.333   1st Qu.:3.500   1st Qu.:1.4286  
##  Median :2.125   Median :3.000   Median :4.500   Median :2.0000  
##  Mean   :2.250   Mean   :3.061   Mean   :4.341   Mean   :2.1856  
##  3rd Qu.:3.125   3rd Qu.:3.667   3rd Qu.:5.250   3rd Qu.:2.7143  
##  Max.   :4.500   Max.   :6.333   Max.   :7.000   Max.   :6.1429  
##                                                                  
##        x7              x8               x9       
##  Min.   :1.304   Min.   : 3.050   Min.   :2.778  
##  1st Qu.:3.478   1st Qu.: 4.850   1st Qu.:4.750  
##  Median :4.087   Median : 5.500   Median :5.417  
##  Mean   :4.186   Mean   : 5.527   Mean   :5.374  
##  3rd Qu.:4.913   3rd Qu.: 6.100   3rd Qu.:6.083  
##  Max.   :7.435   Max.   :10.000   Max.   :9.250  
## 
str(df1)
## 'data.frame':    301 obs. of  15 variables:
##  $ id    : int  1 2 3 4 5 6 7 8 9 11 ...
##  $ sex   : int  1 2 2 1 2 2 1 2 2 2 ...
##  $ ageyr : int  13 13 13 13 12 14 12 12 13 12 ...
##  $ agemo : int  1 7 1 2 2 1 1 2 0 5 ...
##  $ school: Factor w/ 2 levels "Grant-White",..: 2 2 2 2 2 2 2 2 2 2 ...
##  $ grade : int  7 7 7 7 7 7 7 7 7 7 ...
##  $ x1    : num  3.33 5.33 4.5 5.33 4.83 ...
##  $ x2    : num  7.75 5.25 5.25 7.75 4.75 5 6 6.25 5.75 5.25 ...
##  $ x3    : num  0.375 2.125 1.875 3 0.875 ...
##  $ x4    : num  2.33 1.67 1 2.67 2.67 ...
##  $ x5    : num  5.75 3 1.75 4.5 4 3 6 4.25 5.75 5 ...
##  $ x6    : num  1.286 1.286 0.429 2.429 2.571 ...
##  $ x7    : num  3.39 3.78 3.26 3 3.7 ...
##  $ x8    : num  5.75 6.25 3.9 5.3 6.3 6.65 6.2 5.15 4.65 4.55 ...
##  $ x9    : num  6.36 7.92 4.42 4.86 5.92 ...
head(df1)
##   id sex ageyr agemo  school grade       x1   x2    x3       x4   x5        x6
## 1  1   1    13     1 Pasteur     7 3.333333 7.75 0.375 2.333333 5.75 1.2857143
## 2  2   2    13     7 Pasteur     7 5.333333 5.25 2.125 1.666667 3.00 1.2857143
## 3  3   2    13     1 Pasteur     7 4.500000 5.25 1.875 1.000000 1.75 0.4285714
## 4  4   1    13     2 Pasteur     7 5.333333 7.75 3.000 2.666667 4.50 2.4285714
## 5  5   2    12     2 Pasteur     7 4.833333 4.75 0.875 2.666667 4.00 2.5714286
## 6  6   2    14     1 Pasteur     7 5.333333 5.00 2.250 1.000000 3.00 0.8571429
##         x7   x8       x9
## 1 3.391304 5.75 6.361111
## 2 3.782609 6.25 7.916667
## 3 3.260870 3.90 4.416667
## 4 3.000000 5.30 4.861111
## 5 3.695652 6.30 5.916667
## 6 4.347826 6.65 7.500000

##Tipos de formulas 1.Regresión (~) Variable que depende de otras. 2.Variables latentes (=~) No se observa, se infiere. 3.Varianza y covarianza(~~) Relaciones entre variables latentes y observada (Varianza: Entre si misma, Covarianza: Entre otras) 4. Intercepto (~1) Valor esperado cuando las demas variables son cero.

Estructurar el modelo

modelo1 <- ' #Regresiones 
             #Variables Latantes 
             visual =~ x1 + x2 + x3
             textual =~ x4 + x5 + x6
             velocidad =~ x7+ x8 + x9
             # Varianza y Covarianza
             visual ~~ visual
             textual ~~ textual 
             velocidad ~~ velocidad 
             visual ~~ textual + velocidad 
             textual ~~ velocidad
             # Intercepto
            ' 

Generar analisis factorial confirmatorio

cfa1 <- sem(modelo1, data=df1)
summary(cfa1)
## lavaan 0.6-19 ended normally after 35 iterations
## 
##   Estimator                                         ML
##   Optimization method                           NLMINB
##   Number of model parameters                        21
## 
##   Number of observations                           301
## 
## Model Test User Model:
##                                                       
##   Test statistic                                85.306
##   Degrees of freedom                                24
##   P-value (Chi-square)                           0.000
## 
## Parameter Estimates:
## 
##   Standard errors                             Standard
##   Information                                 Expected
##   Information saturated (h1) model          Structured
## 
## Latent Variables:
##                    Estimate  Std.Err  z-value  P(>|z|)
##   visual =~                                           
##     x1                1.000                           
##     x2                0.554    0.100    5.554    0.000
##     x3                0.729    0.109    6.685    0.000
##   textual =~                                          
##     x4                1.000                           
##     x5                1.113    0.065   17.014    0.000
##     x6                0.926    0.055   16.703    0.000
##   velocidad =~                                        
##     x7                1.000                           
##     x8                1.180    0.165    7.152    0.000
##     x9                1.082    0.151    7.155    0.000
## 
## Covariances:
##                    Estimate  Std.Err  z-value  P(>|z|)
##   visual ~~                                           
##     textual           0.408    0.074    5.552    0.000
##     velocidad         0.262    0.056    4.660    0.000
##   textual ~~                                          
##     velocidad         0.173    0.049    3.518    0.000
## 
## Variances:
##                    Estimate  Std.Err  z-value  P(>|z|)
##     visual            0.809    0.145    5.564    0.000
##     textual           0.979    0.112    8.737    0.000
##     velocidad         0.384    0.086    4.451    0.000
##    .x1                0.549    0.114    4.833    0.000
##    .x2                1.134    0.102   11.146    0.000
##    .x3                0.844    0.091    9.317    0.000
##    .x4                0.371    0.048    7.779    0.000
##    .x5                0.446    0.058    7.642    0.000
##    .x6                0.356    0.043    8.277    0.000
##    .x7                0.799    0.081    9.823    0.000
##    .x8                0.488    0.074    6.573    0.000
##    .x9                0.566    0.071    8.003    0.000
lavaanPlot(cfa1, coef=TRUE, cov=TRUE)

Evaluar el modelo

summary(cfa1,  fit.measures=TRUE)
## lavaan 0.6-19 ended normally after 35 iterations
## 
##   Estimator                                         ML
##   Optimization method                           NLMINB
##   Number of model parameters                        21
## 
##   Number of observations                           301
## 
## Model Test User Model:
##                                                       
##   Test statistic                                85.306
##   Degrees of freedom                                24
##   P-value (Chi-square)                           0.000
## 
## Model Test Baseline Model:
## 
##   Test statistic                               918.852
##   Degrees of freedom                                36
##   P-value                                        0.000
## 
## User Model versus Baseline Model:
## 
##   Comparative Fit Index (CFI)                    0.931
##   Tucker-Lewis Index (TLI)                       0.896
## 
## Loglikelihood and Information Criteria:
## 
##   Loglikelihood user model (H0)              -3737.745
##   Loglikelihood unrestricted model (H1)      -3695.092
##                                                       
##   Akaike (AIC)                                7517.490
##   Bayesian (BIC)                              7595.339
##   Sample-size adjusted Bayesian (SABIC)       7528.739
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.092
##   90 Percent confidence interval - lower         0.071
##   90 Percent confidence interval - upper         0.114
##   P-value H_0: RMSEA <= 0.050                    0.001
##   P-value H_0: RMSEA >= 0.080                    0.840
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.065
## 
## Parameter Estimates:
## 
##   Standard errors                             Standard
##   Information                                 Expected
##   Information saturated (h1) model          Structured
## 
## Latent Variables:
##                    Estimate  Std.Err  z-value  P(>|z|)
##   visual =~                                           
##     x1                1.000                           
##     x2                0.554    0.100    5.554    0.000
##     x3                0.729    0.109    6.685    0.000
##   textual =~                                          
##     x4                1.000                           
##     x5                1.113    0.065   17.014    0.000
##     x6                0.926    0.055   16.703    0.000
##   velocidad =~                                        
##     x7                1.000                           
##     x8                1.180    0.165    7.152    0.000
##     x9                1.082    0.151    7.155    0.000
## 
## Covariances:
##                    Estimate  Std.Err  z-value  P(>|z|)
##   visual ~~                                           
##     textual           0.408    0.074    5.552    0.000
##     velocidad         0.262    0.056    4.660    0.000
##   textual ~~                                          
##     velocidad         0.173    0.049    3.518    0.000
## 
## Variances:
##                    Estimate  Std.Err  z-value  P(>|z|)
##     visual            0.809    0.145    5.564    0.000
##     textual           0.979    0.112    8.737    0.000
##     velocidad         0.384    0.086    4.451    0.000
##    .x1                0.549    0.114    4.833    0.000
##    .x2                1.134    0.102   11.146    0.000
##    .x3                0.844    0.091    9.317    0.000
##    .x4                0.371    0.048    7.779    0.000
##    .x5                0.446    0.058    7.642    0.000
##    .x6                0.356    0.043    8.277    0.000
##    .x7                0.799    0.081    9.823    0.000
##    .x8                0.488    0.074    6.573    0.000
##    .x9                0.566    0.071    8.003    0.000
# Revisar los valores de Comparative Fit Index (CFI) y Tucker-Lewis Index (TLI)
#Excelente si es >= 0.95, Aceptable entre 0.90 y 0.95, Deficiente <0.90

Conclusión: Modelo aceptado

Ejercicio 1. Democracia Politica e Industralización

##Contexto La base de datos contiene distintos mediciones sobre democracia politica e industralización en paises en desarrollo durante 1960 y 1965

La tabla incluye los siguientes datos * y1: Calificaciones sobre libertad de prensa en 1960 * y2: Libertad de la oposición política en 1960 * y3: Imparcialidad de elecciones en 1960 * y4: Eficacia de la legislatura electa en 1960 * y5: Calificaciones sobre libertad de prensa en 1965 * y6: Libertad de la oposición política en 1965 * y7: Imparcialidad de elecciones en 1965 * y8: Eficacia de la legislatura electa en 1965 * x1: PIB per cápita en 1960 * x2: Consumo de energía inanimada per cápita en 1960 * x3: Porcentaje de la fuerza laboral en la industria en 1960)

##Importar la base de datos

df2 <- PoliticalDemocracy       

##Entender la base de datos

summary(df2)
##        y1               y2               y3               y4        
##  Min.   : 1.250   Min.   : 0.000   Min.   : 0.000   Min.   : 0.000  
##  1st Qu.: 2.900   1st Qu.: 0.000   1st Qu.: 3.767   1st Qu.: 1.581  
##  Median : 5.400   Median : 3.333   Median : 6.667   Median : 3.333  
##  Mean   : 5.465   Mean   : 4.256   Mean   : 6.563   Mean   : 4.453  
##  3rd Qu.: 7.500   3rd Qu.: 8.283   3rd Qu.:10.000   3rd Qu.: 6.667  
##  Max.   :10.000   Max.   :10.000   Max.   :10.000   Max.   :10.000  
##        y5               y6               y7               y8        
##  Min.   : 0.000   Min.   : 0.000   Min.   : 0.000   Min.   : 0.000  
##  1st Qu.: 3.692   1st Qu.: 0.000   1st Qu.: 3.478   1st Qu.: 1.301  
##  Median : 5.000   Median : 2.233   Median : 6.667   Median : 3.333  
##  Mean   : 5.136   Mean   : 2.978   Mean   : 6.196   Mean   : 4.043  
##  3rd Qu.: 7.500   3rd Qu.: 4.207   3rd Qu.:10.000   3rd Qu.: 6.667  
##  Max.   :10.000   Max.   :10.000   Max.   :10.000   Max.   :10.000  
##        x1              x2              x3       
##  Min.   :3.784   Min.   :1.386   Min.   :1.002  
##  1st Qu.:4.477   1st Qu.:3.663   1st Qu.:2.300  
##  Median :5.075   Median :4.963   Median :3.568  
##  Mean   :5.054   Mean   :4.792   Mean   :3.558  
##  3rd Qu.:5.515   3rd Qu.:5.830   3rd Qu.:4.523  
##  Max.   :6.737   Max.   :7.872   Max.   :6.425
str(df2)
## 'data.frame':    75 obs. of  11 variables:
##  $ y1: num  2.5 1.25 7.5 8.9 10 7.5 7.5 7.5 2.5 10 ...
##  $ y2: num  0 0 8.8 8.8 3.33 ...
##  $ y3: num  3.33 3.33 10 10 10 ...
##  $ y4: num  0 0 9.2 9.2 6.67 ...
##  $ y5: num  1.25 6.25 8.75 8.91 7.5 ...
##  $ y6: num  0 1.1 8.09 8.13 3.33 ...
##  $ y7: num  3.73 6.67 10 10 10 ...
##  $ y8: num  3.333 0.737 8.212 4.615 6.667 ...
##  $ x1: num  4.44 5.38 5.96 6.29 5.86 ...
##  $ x2: num  3.64 5.06 6.26 7.57 6.82 ...
##  $ x3: num  2.56 3.57 5.22 6.27 4.57 ...
head(df2)
##      y1       y2       y3       y4       y5       y6       y7       y8       x1
## 1  2.50 0.000000 3.333333 0.000000 1.250000 0.000000 3.726360 3.333333 4.442651
## 2  1.25 0.000000 3.333333 0.000000 6.250000 1.100000 6.666666 0.736999 5.384495
## 3  7.50 8.800000 9.999998 9.199991 8.750000 8.094061 9.999998 8.211809 5.961005
## 4  8.90 8.800000 9.999998 9.199991 8.907948 8.127979 9.999998 4.615086 6.285998
## 5 10.00 3.333333 9.999998 6.666666 7.500000 3.333333 9.999998 6.666666 5.863631
## 6  7.50 3.333333 6.666666 6.666666 6.250000 1.100000 6.666666 0.368500 5.533389
##         x2       x3
## 1 3.637586 2.557615
## 2 5.062595 3.568079
## 3 6.255750 5.224433
## 4 7.567863 6.267495
## 5 6.818924 4.573679
## 6 5.135798 3.892270

##Estructura del modelo

modelo2 <- ' # Regresiones
            
            # Variables Latentes
            Politica_60 =~ y1 + y2 + y3 + y4 
            Politica_65 =~ y5 + y6 + y7 + y8
            Industrializacion =~ x1 +x2 + x3
            # Varianzas y Covarianzas
            Politica_60 ~~ Politica_60
            Politica_65 ~~ Politica_65
            Industrializacion ~~ Industrializacion
            Politica_60 ~~ Politica_65 + Industrializacion
            Politica_65 ~~ Industrializacion
            # Intercepto
            '

##Generar analisis factorial confirmatorio

cfa2 <- sem(modelo2, data=df2)
summary(cfa2)
## lavaan 0.6-19 ended normally after 47 iterations
## 
##   Estimator                                         ML
##   Optimization method                           NLMINB
##   Number of model parameters                        25
## 
##   Number of observations                            75
## 
## Model Test User Model:
##                                                       
##   Test statistic                                72.462
##   Degrees of freedom                                41
##   P-value (Chi-square)                           0.002
## 
## Parameter Estimates:
## 
##   Standard errors                             Standard
##   Information                                 Expected
##   Information saturated (h1) model          Structured
## 
## Latent Variables:
##                        Estimate  Std.Err  z-value  P(>|z|)
##   Politica_60 =~                                          
##     y1                    1.000                           
##     y2                    1.354    0.175    7.755    0.000
##     y3                    1.044    0.150    6.961    0.000
##     y4                    1.300    0.138    9.412    0.000
##   Politica_65 =~                                          
##     y5                    1.000                           
##     y6                    1.258    0.164    7.651    0.000
##     y7                    1.282    0.158    8.137    0.000
##     y8                    1.310    0.154    8.529    0.000
##   Industrializacion =~                                    
##     x1                    1.000                           
##     x2                    2.182    0.139   15.714    0.000
##     x3                    1.819    0.152   11.956    0.000
## 
## Covariances:
##                    Estimate  Std.Err  z-value  P(>|z|)
##   Politica_60 ~~                                      
##     Politica_65       4.487    0.911    4.924    0.000
##     Industrializcn    0.660    0.206    3.202    0.001
##   Politica_65 ~~                                      
##     Industrializcn    0.774    0.208    3.715    0.000
## 
## Variances:
##                    Estimate  Std.Err  z-value  P(>|z|)
##     Politica_60       4.845    1.088    4.453    0.000
##     Politica_65       4.345    1.051    4.134    0.000
##     Industrializcn    0.448    0.087    5.169    0.000
##    .y1                1.942    0.395    4.910    0.000
##    .y2                6.490    1.185    5.479    0.000
##    .y3                5.340    0.943    5.662    0.000
##    .y4                2.887    0.610    4.731    0.000
##    .y5                2.390    0.447    5.351    0.000
##    .y6                4.343    0.796    5.456    0.000
##    .y7                3.510    0.668    5.252    0.000
##    .y8                2.940    0.586    5.019    0.000
##    .x1                0.082    0.020    4.180    0.000
##    .x2                0.118    0.070    1.689    0.091
##    .x3                0.467    0.090    5.174    0.000
lavaanPlot(cfa2, coef=TRUE, cov=TRUE)

##Evaluar el modelo

summary(cfa2,  fit.measures=TRUE)
## lavaan 0.6-19 ended normally after 47 iterations
## 
##   Estimator                                         ML
##   Optimization method                           NLMINB
##   Number of model parameters                        25
## 
##   Number of observations                            75
## 
## Model Test User Model:
##                                                       
##   Test statistic                                72.462
##   Degrees of freedom                                41
##   P-value (Chi-square)                           0.002
## 
## Model Test Baseline Model:
## 
##   Test statistic                               730.654
##   Degrees of freedom                                55
##   P-value                                        0.000
## 
## User Model versus Baseline Model:
## 
##   Comparative Fit Index (CFI)                    0.953
##   Tucker-Lewis Index (TLI)                       0.938
## 
## Loglikelihood and Information Criteria:
## 
##   Loglikelihood user model (H0)              -1564.959
##   Loglikelihood unrestricted model (H1)      -1528.728
##                                                       
##   Akaike (AIC)                                3179.918
##   Bayesian (BIC)                              3237.855
##   Sample-size adjusted Bayesian (SABIC)       3159.062
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.101
##   90 Percent confidence interval - lower         0.061
##   90 Percent confidence interval - upper         0.139
##   P-value H_0: RMSEA <= 0.050                    0.021
##   P-value H_0: RMSEA >= 0.080                    0.827
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.055
## 
## Parameter Estimates:
## 
##   Standard errors                             Standard
##   Information                                 Expected
##   Information saturated (h1) model          Structured
## 
## Latent Variables:
##                        Estimate  Std.Err  z-value  P(>|z|)
##   Politica_60 =~                                          
##     y1                    1.000                           
##     y2                    1.354    0.175    7.755    0.000
##     y3                    1.044    0.150    6.961    0.000
##     y4                    1.300    0.138    9.412    0.000
##   Politica_65 =~                                          
##     y5                    1.000                           
##     y6                    1.258    0.164    7.651    0.000
##     y7                    1.282    0.158    8.137    0.000
##     y8                    1.310    0.154    8.529    0.000
##   Industrializacion =~                                    
##     x1                    1.000                           
##     x2                    2.182    0.139   15.714    0.000
##     x3                    1.819    0.152   11.956    0.000
## 
## Covariances:
##                    Estimate  Std.Err  z-value  P(>|z|)
##   Politica_60 ~~                                      
##     Politica_65       4.487    0.911    4.924    0.000
##     Industrializcn    0.660    0.206    3.202    0.001
##   Politica_65 ~~                                      
##     Industrializcn    0.774    0.208    3.715    0.000
## 
## Variances:
##                    Estimate  Std.Err  z-value  P(>|z|)
##     Politica_60       4.845    1.088    4.453    0.000
##     Politica_65       4.345    1.051    4.134    0.000
##     Industrializcn    0.448    0.087    5.169    0.000
##    .y1                1.942    0.395    4.910    0.000
##    .y2                6.490    1.185    5.479    0.000
##    .y3                5.340    0.943    5.662    0.000
##    .y4                2.887    0.610    4.731    0.000
##    .y5                2.390    0.447    5.351    0.000
##    .y6                4.343    0.796    5.456    0.000
##    .y7                3.510    0.668    5.252    0.000
##    .y8                2.940    0.586    5.019    0.000
##    .x1                0.082    0.020    4.180    0.000
##    .x2                0.118    0.070    1.689    0.091
##    .x3                0.467    0.090    5.174    0.000
# Revisar los valores de Comparative Fit Index (CFI) y Tucker-Lewis Index (TLI)
#Excelente si es >= 0.95, Aceptable entre 0.90 y 0.95, Deficiente <0.90

#Actividad 3

##Importar y llamar librerias

#install.packages("readxl")
library(readxl)

##Importar la base de datos

df3 <- read_excel( "C:\\Users\\rodri\\Desktop\\Octavo\\Analitica\\Modulo 1\\Datos_SEM_Eng.xlsx")

##Entender la base de datos

summary(df3)
##        ID             GEN             EXPER            EDAD      
##  Min.   :  1.0   Min.   :0.0000   Min.   : 0.00   Min.   :22.00  
##  1st Qu.: 56.5   1st Qu.:0.0000   1st Qu.:15.00   1st Qu.:37.50  
##  Median :112.0   Median :1.0000   Median :20.00   Median :44.00  
##  Mean   :112.0   Mean   :0.5919   Mean   :21.05   Mean   :43.95  
##  3rd Qu.:167.5   3rd Qu.:1.0000   3rd Qu.:27.50   3rd Qu.:51.00  
##  Max.   :223.0   Max.   :1.0000   Max.   :50.00   Max.   :72.00  
##      RPD01           RPD02          RPD03           RPD05           RPD06      
##  Min.   :1.000   Min.   :1.00   Min.   :1.000   Min.   :1.000   Min.   :1.000  
##  1st Qu.:3.000   1st Qu.:3.00   1st Qu.:3.000   1st Qu.:3.000   1st Qu.:3.000  
##  Median :5.000   Median :4.00   Median :5.000   Median :5.000   Median :5.000  
##  Mean   :4.596   Mean   :4.09   Mean   :4.789   Mean   :4.327   Mean   :4.798  
##  3rd Qu.:6.000   3rd Qu.:6.00   3rd Qu.:7.000   3rd Qu.:6.000   3rd Qu.:7.000  
##  Max.   :7.000   Max.   :7.00   Max.   :7.000   Max.   :7.000   Max.   :7.000  
##      RPD07           RPD08           RPD09           RPD10      
##  Min.   :1.000   Min.   :1.000   Min.   :1.000   Min.   :1.000  
##  1st Qu.:2.000   1st Qu.:3.000   1st Qu.:3.000   1st Qu.:2.500  
##  Median :4.000   Median :5.000   Median :5.000   Median :5.000  
##  Mean   :3.794   Mean   :4.735   Mean   :4.466   Mean   :4.435  
##  3rd Qu.:5.500   3rd Qu.:7.000   3rd Qu.:6.000   3rd Qu.:6.000  
##  Max.   :7.000   Max.   :7.000   Max.   :7.000   Max.   :7.000  
##      RRE02           RRE03           RRE04           RRE05           RRE06    
##  Min.   :1.000   Min.   :1.000   Min.   :1.000   Min.   :1.000   Min.   :1.0  
##  1st Qu.:5.000   1st Qu.:5.000   1st Qu.:5.000   1st Qu.:5.000   1st Qu.:4.0  
##  Median :6.000   Median :6.000   Median :6.000   Median :6.000   Median :6.0  
##  Mean   :5.691   Mean   :5.534   Mean   :5.668   Mean   :5.623   Mean   :5.3  
##  3rd Qu.:7.000   3rd Qu.:7.000   3rd Qu.:7.000   3rd Qu.:7.000   3rd Qu.:7.0  
##  Max.   :7.000   Max.   :7.000   Max.   :7.000   Max.   :7.000   Max.   :7.0  
##      RRE07           RRE10           RMA02           RMA03      
##  Min.   :1.000   Min.   :1.000   Min.   :1.000   Min.   :1.000  
##  1st Qu.:4.000   1st Qu.:5.000   1st Qu.:3.000   1st Qu.:3.000  
##  Median :6.000   Median :6.000   Median :4.000   Median :5.000  
##  Mean   :5.305   Mean   :5.664   Mean   :4.215   Mean   :4.377  
##  3rd Qu.:7.000   3rd Qu.:7.000   3rd Qu.:6.000   3rd Qu.:6.000  
##  Max.   :7.000   Max.   :7.000   Max.   :7.000   Max.   :7.000  
##      RMA04           RMA05           RMA06           RMA07      
##  Min.   :1.000   Min.   :1.000   Min.   :1.000   Min.   :1.000  
##  1st Qu.:3.000   1st Qu.:3.000   1st Qu.:5.000   1st Qu.:4.000  
##  Median :5.000   Median :5.000   Median :6.000   Median :5.000  
##  Mean   :4.686   Mean   :4.637   Mean   :5.511   Mean   :4.767  
##  3rd Qu.:6.000   3rd Qu.:6.000   3rd Qu.:7.000   3rd Qu.:6.000  
##  Max.   :7.000   Max.   :7.000   Max.   :7.000   Max.   :7.000  
##      RMA08           RMA09           RMA10          RCO02           RCO03      
##  Min.   :1.000   Min.   :1.000   Min.   :1.00   Min.   :1.000   Min.   :1.000  
##  1st Qu.:4.000   1st Qu.:3.000   1st Qu.:3.00   1st Qu.:5.000   1st Qu.:5.000  
##  Median :5.000   Median :5.000   Median :5.00   Median :6.000   Median :6.000  
##  Mean   :4.942   Mean   :4.614   Mean   :4.43   Mean   :5.336   Mean   :5.574  
##  3rd Qu.:6.500   3rd Qu.:6.000   3rd Qu.:6.00   3rd Qu.:7.000   3rd Qu.:7.000  
##  Max.   :7.000   Max.   :7.000   Max.   :7.00   Max.   :7.000   Max.   :7.000  
##      RCO04           RCO05           RCO06           RCO07      
##  Min.   :1.000   Min.   :1.000   Min.   :1.000   Min.   :1.000  
##  1st Qu.:5.000   1st Qu.:5.000   1st Qu.:5.000   1st Qu.:5.000  
##  Median :6.000   Median :6.000   Median :6.000   Median :6.000  
##  Mean   :5.704   Mean   :5.668   Mean   :5.619   Mean   :5.632  
##  3rd Qu.:7.000   3rd Qu.:7.000   3rd Qu.:7.000   3rd Qu.:7.000  
##  Max.   :7.000   Max.   :7.000   Max.   :7.000   Max.   :7.000  
##       EN01            EN02            EN04            EN05      
##  Min.   :1.000   Min.   :1.000   Min.   :1.000   Min.   :1.000  
##  1st Qu.:3.000   1st Qu.:4.000   1st Qu.:4.000   1st Qu.:4.000  
##  Median :5.000   Median :6.000   Median :5.000   Median :5.000  
##  Mean   :4.717   Mean   :5.004   Mean   :4.883   Mean   :4.928  
##  3rd Qu.:6.000   3rd Qu.:7.000   3rd Qu.:6.000   3rd Qu.:6.000  
##  Max.   :7.000   Max.   :7.000   Max.   :7.000   Max.   :7.000  
##       EN06            EN07            EN08           EVI01      
##  Min.   :1.000   Min.   :1.000   Min.   :1.000   Min.   :0.000  
##  1st Qu.:3.000   1st Qu.:3.000   1st Qu.:4.000   1st Qu.:4.000  
##  Median :5.000   Median :5.000   Median :5.000   Median :5.000  
##  Mean   :4.767   Mean   :4.578   Mean   :4.776   Mean   :5.013  
##  3rd Qu.:6.000   3rd Qu.:6.000   3rd Qu.:6.000   3rd Qu.:6.000  
##  Max.   :7.000   Max.   :7.000   Max.   :7.000   Max.   :7.000  
##      EVI02           EVI03           EDE01           EDE02      
##  Min.   :0.000   Min.   :0.000   Min.   :0.000   Min.   :0.000  
##  1st Qu.:4.000   1st Qu.:4.000   1st Qu.:5.000   1st Qu.:5.000  
##  Median :6.000   Median :6.000   Median :6.000   Median :6.000  
##  Mean   :5.076   Mean   :4.973   Mean   :5.305   Mean   :5.543  
##  3rd Qu.:6.000   3rd Qu.:6.000   3rd Qu.:7.000   3rd Qu.:7.000  
##  Max.   :7.000   Max.   :7.000   Max.   :7.000   Max.   :7.000  
##      EDE03           EAB01           EAB02           EAB03      
##  Min.   :0.000   Min.   :0.000   Min.   :0.000   Min.   :0.000  
##  1st Qu.:6.000   1st Qu.:5.000   1st Qu.:5.000   1st Qu.:5.000  
##  Median :7.000   Median :6.000   Median :6.000   Median :6.000  
##  Mean   :6.135   Mean   :5.605   Mean   :5.821   Mean   :5.363  
##  3rd Qu.:7.000   3rd Qu.:7.000   3rd Qu.:7.000   3rd Qu.:7.000  
##  Max.   :7.000   Max.   :7.000   Max.   :7.000   Max.   :7.000
str(df3)
## tibble [223 × 51] (S3: tbl_df/tbl/data.frame)
##  $ ID   : num [1:223] 1 2 3 4 5 6 7 8 9 10 ...
##  $ GEN  : num [1:223] 1 1 1 1 1 0 0 1 1 1 ...
##  $ EXPER: num [1:223] 22 22 30 17 23 31 26 30 15 15 ...
##  $ EDAD : num [1:223] 45 44 52 41 51 52 53 48 40 38 ...
##  $ RPD01: num [1:223] 5 4 7 5 7 3 5 6 4 2 ...
##  $ RPD02: num [1:223] 1 4 7 5 6 4 5 7 4 3 ...
##  $ RPD03: num [1:223] 3 6 7 1 7 5 4 6 4 2 ...
##  $ RPD05: num [1:223] 2 5 7 1 6 4 4 7 4 3 ...
##  $ RPD06: num [1:223] 3 3 7 3 7 3 5 2 6 7 ...
##  $ RPD07: num [1:223] 1 2 6 5 6 5 6 5 4 1 ...
##  $ RPD08: num [1:223] 3 3 7 3 7 4 6 2 5 3 ...
##  $ RPD09: num [1:223] 2 4 7 2 6 4 7 4 4 2 ...
##  $ RPD10: num [1:223] 4 4 7 2 6 4 7 1 6 2 ...
##  $ RRE02: num [1:223] 6 6 7 6 7 5 7 5 6 7 ...
##  $ RRE03: num [1:223] 6 6 7 6 7 4 7 4 4 7 ...
##  $ RRE04: num [1:223] 6 6 7 6 7 4 7 4 6 7 ...
##  $ RRE05: num [1:223] 6 6 7 6 7 5 7 4 6 7 ...
##  $ RRE06: num [1:223] 6 6 7 6 7 4 7 4 6 7 ...
##  $ RRE07: num [1:223] 6 6 7 6 7 4 7 4 6 7 ...
##  $ RRE10: num [1:223] 6 6 7 6 7 4 7 4 6 7 ...
##  $ RMA02: num [1:223] 4 6 4 3 4 7 5 2 6 7 ...
##  $ RMA03: num [1:223] 5 6 5 4 4 7 5 1 2 7 ...
##  $ RMA04: num [1:223] 5 5 6 4 4 5 5 1 4 7 ...
##  $ RMA05: num [1:223] 5 5 6 4 4 6 5 3 4 7 ...
##  $ RMA06: num [1:223] 6 6 7 6 5 4 5 7 6 7 ...
##  $ RMA07: num [1:223] 4 6 6 5 4 5 7 4 6 7 ...
##  $ RMA08: num [1:223] 5 6 4 4 4 6 6 4 2 7 ...
##  $ RMA09: num [1:223] 3 5 4 3 5 4 5 2 4 7 ...
##  $ RMA10: num [1:223] 7 5 5 4 5 5 6 4 3 7 ...
##  $ RCO02: num [1:223] 7 7 7 5 7 6 7 7 3 7 ...
##  $ RCO03: num [1:223] 7 7 7 5 7 5 7 7 3 7 ...
##  $ RCO04: num [1:223] 7 7 7 6 7 4 7 7 3 7 ...
##  $ RCO05: num [1:223] 7 7 7 6 7 4 7 7 3 7 ...
##  $ RCO06: num [1:223] 7 7 7 6 7 4 7 7 4 7 ...
##  $ RCO07: num [1:223] 5 7 7 6 7 4 7 7 7 7 ...
##  $ EN01 : num [1:223] 6 6 7 4 6 4 7 7 4 7 ...
##  $ EN02 : num [1:223] 7 6 7 4 6 4 7 7 4 7 ...
##  $ EN04 : num [1:223] 6 6 7 4 6 4 7 6 4 7 ...
##  $ EN05 : num [1:223] 5 5 7 5 6 5 7 6 4 7 ...
##  $ EN06 : num [1:223] 5 5 7 5 6 3 7 5 5 7 ...
##  $ EN07 : num [1:223] 5 5 7 2 6 4 7 4 4 7 ...
##  $ EN08 : num [1:223] 6 5 7 5 6 4 7 4 4 7 ...
##  $ EVI01: num [1:223] 6 5 7 5 6 4 7 6 6 0 ...
##  $ EVI02: num [1:223] 6 5 7 6 6 4 6 5 5 1 ...
##  $ EVI03: num [1:223] 6 6 6 7 6 4 6 6 7 0 ...
##  $ EDE01: num [1:223] 6 6 6 5 7 6 7 7 7 1 ...
##  $ EDE02: num [1:223] 7 6 7 6 7 5 7 7 7 5 ...
##  $ EDE03: num [1:223] 7 7 7 7 7 5 7 7 7 6 ...
##  $ EAB01: num [1:223] 7 7 7 6 7 5 7 7 7 0 ...
##  $ EAB02: num [1:223] 7 7 7 6 7 5 7 2 5 1 ...
##  $ EAB03: num [1:223] 6 5 6 5 6 5 7 3 5 0 ...
head(df3)
## # A tibble: 6 × 51
##      ID   GEN EXPER  EDAD RPD01 RPD02 RPD03 RPD05 RPD06 RPD07 RPD08 RPD09 RPD10
##   <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1     1     1    22    45     5     1     3     2     3     1     3     2     4
## 2     2     1    22    44     4     4     6     5     3     2     3     4     4
## 3     3     1    30    52     7     7     7     7     7     6     7     7     7
## 4     4     1    17    41     5     5     1     1     3     5     3     2     2
## 5     5     1    23    51     7     6     7     6     7     6     7     6     6
## 6     6     0    31    52     3     4     5     4     3     5     4     4     4
## # ℹ 38 more variables: RRE02 <dbl>, RRE03 <dbl>, RRE04 <dbl>, RRE05 <dbl>,
## #   RRE06 <dbl>, RRE07 <dbl>, RRE10 <dbl>, RMA02 <dbl>, RMA03 <dbl>,
## #   RMA04 <dbl>, RMA05 <dbl>, RMA06 <dbl>, RMA07 <dbl>, RMA08 <dbl>,
## #   RMA09 <dbl>, RMA10 <dbl>, RCO02 <dbl>, RCO03 <dbl>, RCO04 <dbl>,
## #   RCO05 <dbl>, RCO06 <dbl>, RCO07 <dbl>, EN01 <dbl>, EN02 <dbl>, EN04 <dbl>,
## #   EN05 <dbl>, EN06 <dbl>, EN07 <dbl>, EN08 <dbl>, EVI01 <dbl>, EVI02 <dbl>,
## #   EVI03 <dbl>, EDE01 <dbl>, EDE02 <dbl>, EDE03 <dbl>, EAB01 <dbl>, …

##Parte 1.

modelo31 <- ' #Regresiones
            #Variables Latentes
            desapego =~ RPD01 + RPD02 + RPD03 + RPD05 + RPD06 + RPD07 + RPD08 + RPD09 + RPD10
            relajacion =~ RRE02 + RRE03 + RRE04 + RRE05 + RRE06 + RRE07 + RRE10
            dominio =~  RMA03 + RMA03 + RMA04 + RMA05 + RMA06 + RMA07 + RMA08 + RMA09 + RMA10
            control =~ RCO02 + RCO03 + RCO04 + RCO05 + RCO06 + RCO07
            recuperacion =~ desapego + relajacion + dominio + control
            #Varianzas y Covarianzas 
            desapego ~~ desapego 
            relajacion ~~ relajacion 
            dominio ~~ dominio 
            control ~~ control
            #Intercepto
          ' 

##Generar analisis factorial confirmatorio

cfa31 <- sem(modelo31, data=df3)
summary(cfa31)
## lavaan 0.6-19 ended normally after 45 iterations
## 
##   Estimator                                         ML
##   Optimization method                           NLMINB
##   Number of model parameters                        64
## 
##   Number of observations                           223
## 
## Model Test User Model:
##                                                       
##   Test statistic                              1132.779
##   Degrees of freedom                               401
##   P-value (Chi-square)                           0.000
## 
## Parameter Estimates:
## 
##   Standard errors                             Standard
##   Information                                 Expected
##   Information saturated (h1) model          Structured
## 
## Latent Variables:
##                    Estimate  Std.Err  z-value  P(>|z|)
##   desapego =~                                         
##     RPD01             1.000                           
##     RPD02             1.206    0.082   14.780    0.000
##     RPD03             1.143    0.085   13.375    0.000
##     RPD05             1.312    0.086   15.245    0.000
##     RPD06             1.088    0.089   12.266    0.000
##     RPD07             1.229    0.085   14.441    0.000
##     RPD08             1.163    0.087   13.446    0.000
##     RPD09             1.317    0.087   15.153    0.000
##     RPD10             1.346    0.088   15.257    0.000
##   relajacion =~                                       
##     RRE02             1.000                           
##     RRE03             1.120    0.065   17.221    0.000
##     RRE04             1.025    0.058   17.713    0.000
##     RRE05             1.055    0.056   18.758    0.000
##     RRE06             1.245    0.074   16.867    0.000
##     RRE07             1.117    0.071   15.689    0.000
##     RRE10             0.815    0.067   12.119    0.000
##   dominio =~                                          
##     RMA03             1.000                           
##     RMA04             1.048    0.071   14.760    0.000
##     RMA05             1.009    0.070   14.375    0.000
##     RMA06             0.579    0.064    9.060    0.000
##     RMA07             0.986    0.068   14.557    0.000
##     RMA08             0.993    0.068   14.512    0.000
##     RMA09             0.923    0.068   13.551    0.000
##     RMA10             0.934    0.072   13.029    0.000
##   control =~                                          
##     RCO02             1.000                           
##     RCO03             0.948    0.049   19.180    0.000
##     RCO04             0.796    0.044   18.110    0.000
##     RCO05             0.818    0.043   18.989    0.000
##     RCO06             0.834    0.046   18.213    0.000
##     RCO07             0.835    0.046   18.056    0.000
##   recuperacion =~                                     
##     desapego          1.000                           
##     relajacion        1.150    0.131    8.786    0.000
##     dominio           0.974    0.142    6.863    0.000
##     control           1.342    0.156    8.605    0.000
## 
## Variances:
##                    Estimate  Std.Err  z-value  P(>|z|)
##    .desapego          0.945    0.152    6.212    0.000
##    .relajacion        0.333    0.088    3.766    0.000
##    .dominio           1.582    0.246    6.442    0.000
##    .control           0.899    0.159    5.666    0.000
##    .RPD01             1.172    0.120    9.782    0.000
##    .RPD02             0.999    0.108    9.228    0.000
##    .RPD03             1.441    0.148    9.733    0.000
##    .RPD05             0.987    0.110    8.963    0.000
##    .RPD06             1.817    0.182    9.967    0.000
##    .RPD07             1.173    0.125    9.383    0.000
##    .RPD08             1.460    0.150    9.714    0.000
##    .RPD09             1.033    0.114    9.022    0.000
##    .RPD10             1.034    0.115    8.955    0.000
##    .RRE02             0.626    0.068    9.274    0.000
##    .RRE03             0.654    0.073    9.013    0.000
##    .RRE04             0.480    0.055    8.793    0.000
##    .RRE05             0.374    0.046    8.151    0.000
##    .RRE06             0.886    0.097    9.150    0.000
##    .RRE07             0.950    0.100    9.505    0.000
##    .RRE10             1.137    0.113   10.093    0.000
##    .RMA03             1.619    0.168    9.653    0.000
##    .RMA04             0.851    0.098    8.651    0.000
##    .RMA05             0.924    0.103    8.933    0.000
##    .RMA06             1.614    0.157   10.255    0.000
##    .RMA07             0.819    0.093    8.808    0.000
##    .RMA08             0.847    0.096    8.841    0.000
##    .RMA09             1.050    0.112    9.364    0.000
##    .RMA10             1.279    0.134    9.558    0.000
##    .RCO02             0.983    0.105    9.380    0.000
##    .RCO03             0.484    0.058    8.392    0.000
##    .RCO04             0.462    0.052    8.962    0.000
##    .RCO05             0.382    0.045    8.513    0.000
##    .RCO06             0.494    0.055    8.917    0.000
##    .RCO07             0.515    0.057    8.985    0.000
##     recuperacion      0.976    0.202    4.831    0.000
lavaanPlot(cfa1, coef=TRUE, cov=TRUE)

##Evaluar el modelo

summary (cfa31, fit.measures=TRUE)
## lavaan 0.6-19 ended normally after 45 iterations
## 
##   Estimator                                         ML
##   Optimization method                           NLMINB
##   Number of model parameters                        64
## 
##   Number of observations                           223
## 
## Model Test User Model:
##                                                       
##   Test statistic                              1132.779
##   Degrees of freedom                               401
##   P-value (Chi-square)                           0.000
## 
## Model Test Baseline Model:
## 
##   Test statistic                              7278.538
##   Degrees of freedom                               435
##   P-value                                        0.000
## 
## User Model versus Baseline Model:
## 
##   Comparative Fit Index (CFI)                    0.893
##   Tucker-Lewis Index (TLI)                       0.884
## 
## Loglikelihood and Information Criteria:
## 
##   Loglikelihood user model (H0)             -10230.913
##   Loglikelihood unrestricted model (H1)      -9664.524
##                                                       
##   Akaike (AIC)                               20589.826
##   Bayesian (BIC)                             20807.885
##   Sample-size adjusted Bayesian (SABIC)      20605.061
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.090
##   90 Percent confidence interval - lower         0.084
##   90 Percent confidence interval - upper         0.097
##   P-value H_0: RMSEA <= 0.050                    0.000
##   P-value H_0: RMSEA >= 0.080                    0.997
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.075
## 
## Parameter Estimates:
## 
##   Standard errors                             Standard
##   Information                                 Expected
##   Information saturated (h1) model          Structured
## 
## Latent Variables:
##                    Estimate  Std.Err  z-value  P(>|z|)
##   desapego =~                                         
##     RPD01             1.000                           
##     RPD02             1.206    0.082   14.780    0.000
##     RPD03             1.143    0.085   13.375    0.000
##     RPD05             1.312    0.086   15.245    0.000
##     RPD06             1.088    0.089   12.266    0.000
##     RPD07             1.229    0.085   14.441    0.000
##     RPD08             1.163    0.087   13.446    0.000
##     RPD09             1.317    0.087   15.153    0.000
##     RPD10             1.346    0.088   15.257    0.000
##   relajacion =~                                       
##     RRE02             1.000                           
##     RRE03             1.120    0.065   17.221    0.000
##     RRE04             1.025    0.058   17.713    0.000
##     RRE05             1.055    0.056   18.758    0.000
##     RRE06             1.245    0.074   16.867    0.000
##     RRE07             1.117    0.071   15.689    0.000
##     RRE10             0.815    0.067   12.119    0.000
##   dominio =~                                          
##     RMA03             1.000                           
##     RMA04             1.048    0.071   14.760    0.000
##     RMA05             1.009    0.070   14.375    0.000
##     RMA06             0.579    0.064    9.060    0.000
##     RMA07             0.986    0.068   14.557    0.000
##     RMA08             0.993    0.068   14.512    0.000
##     RMA09             0.923    0.068   13.551    0.000
##     RMA10             0.934    0.072   13.029    0.000
##   control =~                                          
##     RCO02             1.000                           
##     RCO03             0.948    0.049   19.180    0.000
##     RCO04             0.796    0.044   18.110    0.000
##     RCO05             0.818    0.043   18.989    0.000
##     RCO06             0.834    0.046   18.213    0.000
##     RCO07             0.835    0.046   18.056    0.000
##   recuperacion =~                                     
##     desapego          1.000                           
##     relajacion        1.150    0.131    8.786    0.000
##     dominio           0.974    0.142    6.863    0.000
##     control           1.342    0.156    8.605    0.000
## 
## Variances:
##                    Estimate  Std.Err  z-value  P(>|z|)
##    .desapego          0.945    0.152    6.212    0.000
##    .relajacion        0.333    0.088    3.766    0.000
##    .dominio           1.582    0.246    6.442    0.000
##    .control           0.899    0.159    5.666    0.000
##    .RPD01             1.172    0.120    9.782    0.000
##    .RPD02             0.999    0.108    9.228    0.000
##    .RPD03             1.441    0.148    9.733    0.000
##    .RPD05             0.987    0.110    8.963    0.000
##    .RPD06             1.817    0.182    9.967    0.000
##    .RPD07             1.173    0.125    9.383    0.000
##    .RPD08             1.460    0.150    9.714    0.000
##    .RPD09             1.033    0.114    9.022    0.000
##    .RPD10             1.034    0.115    8.955    0.000
##    .RRE02             0.626    0.068    9.274    0.000
##    .RRE03             0.654    0.073    9.013    0.000
##    .RRE04             0.480    0.055    8.793    0.000
##    .RRE05             0.374    0.046    8.151    0.000
##    .RRE06             0.886    0.097    9.150    0.000
##    .RRE07             0.950    0.100    9.505    0.000
##    .RRE10             1.137    0.113   10.093    0.000
##    .RMA03             1.619    0.168    9.653    0.000
##    .RMA04             0.851    0.098    8.651    0.000
##    .RMA05             0.924    0.103    8.933    0.000
##    .RMA06             1.614    0.157   10.255    0.000
##    .RMA07             0.819    0.093    8.808    0.000
##    .RMA08             0.847    0.096    8.841    0.000
##    .RMA09             1.050    0.112    9.364    0.000
##    .RMA10             1.279    0.134    9.558    0.000
##    .RCO02             0.983    0.105    9.380    0.000
##    .RCO03             0.484    0.058    8.392    0.000
##    .RCO04             0.462    0.052    8.962    0.000
##    .RCO05             0.382    0.045    8.513    0.000
##    .RCO06             0.494    0.055    8.917    0.000
##    .RCO07             0.515    0.057    8.985    0.000
##     recuperacion      0.976    0.202    4.831    0.000

##Parte 2. Energia Recuperada

modelo32 <- ' #Regresiones
            #Variables Latentes
            energia =~ EN01 + EN02 + EN04 + EN05 + EN06 + EN07 + EN08
            #Varianzas y Covarianzas 
            energia ~~ energia
            #Intercepto
          '

##Generar el Analisis Factorial confirmatorio Modelo 2

cfa32 <- sem(modelo32, data=df3)
summary(cfa32)
## lavaan 0.6-19 ended normally after 32 iterations
## 
##   Estimator                                         ML
##   Optimization method                           NLMINB
##   Number of model parameters                        14
## 
##   Number of observations                           223
## 
## Model Test User Model:
##                                                       
##   Test statistic                                47.222
##   Degrees of freedom                                14
##   P-value (Chi-square)                           0.000
## 
## Parameter Estimates:
## 
##   Standard errors                             Standard
##   Information                                 Expected
##   Information saturated (h1) model          Structured
## 
## Latent Variables:
##                    Estimate  Std.Err  z-value  P(>|z|)
##   energia =~                                          
##     EN01              1.000                           
##     EN02              1.029    0.044   23.192    0.000
##     EN04              0.999    0.044   22.583    0.000
##     EN05              0.999    0.042   23.649    0.000
##     EN06              0.986    0.042   23.722    0.000
##     EN07              1.049    0.046   22.856    0.000
##     EN08              1.036    0.043   24.173    0.000
## 
## Variances:
##                    Estimate  Std.Err  z-value  P(>|z|)
##     energia           2.801    0.327    8.565    0.000
##    .EN01              0.711    0.074    9.651    0.000
##    .EN02              0.444    0.049    9.012    0.000
##    .EN04              0.481    0.052    9.214    0.000
##    .EN05              0.375    0.042    8.830    0.000
##    .EN06              0.359    0.041    8.798    0.000
##    .EN07              0.499    0.055    9.129    0.000
##    .EN08              0.353    0.041    8.580    0.000
lavaanPlot(cfa1, coef=TRUE, cov=TRUE)

##Evaluar el modelo 2

summary (cfa32, fit.measures=TRUE)
## lavaan 0.6-19 ended normally after 32 iterations
## 
##   Estimator                                         ML
##   Optimization method                           NLMINB
##   Number of model parameters                        14
## 
##   Number of observations                           223
## 
## Model Test User Model:
##                                                       
##   Test statistic                                47.222
##   Degrees of freedom                                14
##   P-value (Chi-square)                           0.000
## 
## Model Test Baseline Model:
## 
##   Test statistic                              2324.436
##   Degrees of freedom                                21
##   P-value                                        0.000
## 
## User Model versus Baseline Model:
## 
##   Comparative Fit Index (CFI)                    0.986
##   Tucker-Lewis Index (TLI)                       0.978
## 
## Loglikelihood and Information Criteria:
## 
##   Loglikelihood user model (H0)              -2017.154
##   Loglikelihood unrestricted model (H1)      -1993.543
##                                                       
##   Akaike (AIC)                                4062.308
##   Bayesian (BIC)                              4110.008
##   Sample-size adjusted Bayesian (SABIC)       4065.641
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.103
##   90 Percent confidence interval - lower         0.072
##   90 Percent confidence interval - upper         0.136
##   P-value H_0: RMSEA <= 0.050                    0.004
##   P-value H_0: RMSEA >= 0.080                    0.892
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.012
## 
## Parameter Estimates:
## 
##   Standard errors                             Standard
##   Information                                 Expected
##   Information saturated (h1) model          Structured
## 
## Latent Variables:
##                    Estimate  Std.Err  z-value  P(>|z|)
##   energia =~                                          
##     EN01              1.000                           
##     EN02              1.029    0.044   23.192    0.000
##     EN04              0.999    0.044   22.583    0.000
##     EN05              0.999    0.042   23.649    0.000
##     EN06              0.986    0.042   23.722    0.000
##     EN07              1.049    0.046   22.856    0.000
##     EN08              1.036    0.043   24.173    0.000
## 
## Variances:
##                    Estimate  Std.Err  z-value  P(>|z|)
##     energia           2.801    0.327    8.565    0.000
##    .EN01              0.711    0.074    9.651    0.000
##    .EN02              0.444    0.049    9.012    0.000
##    .EN04              0.481    0.052    9.214    0.000
##    .EN05              0.375    0.042    8.830    0.000
##    .EN06              0.359    0.041    8.798    0.000
##    .EN07              0.499    0.055    9.129    0.000
##    .EN08              0.353    0.041    8.580    0.000

##Parte 3. Engagment Laboral

modelo33 <- ' #Regresiones
            #Variables Latentes
            vigor =~ EVI01 + EVI02 + EVI03
            dedicacion =~ EDE01 + EDE02 + EDE03
            absorcion =~ EAB01 + EAB02 + EAB03
            #Varianzas y Covarianzas 
            vigor ~~ vigor 
            dedicacion ~~ dedicacion 
            absorcion ~~ absorcion
            vigor ~~ dedicacion + absorcion
            dedicacion ~~ absorcion
            #Intercepto
          '

##Generar el Analisis Factorial confirmatorio Modelo 3

cfa33 <- sem(modelo33, data=df3)
summary(cfa32)
## lavaan 0.6-19 ended normally after 32 iterations
## 
##   Estimator                                         ML
##   Optimization method                           NLMINB
##   Number of model parameters                        14
## 
##   Number of observations                           223
## 
## Model Test User Model:
##                                                       
##   Test statistic                                47.222
##   Degrees of freedom                                14
##   P-value (Chi-square)                           0.000
## 
## Parameter Estimates:
## 
##   Standard errors                             Standard
##   Information                                 Expected
##   Information saturated (h1) model          Structured
## 
## Latent Variables:
##                    Estimate  Std.Err  z-value  P(>|z|)
##   energia =~                                          
##     EN01              1.000                           
##     EN02              1.029    0.044   23.192    0.000
##     EN04              0.999    0.044   22.583    0.000
##     EN05              0.999    0.042   23.649    0.000
##     EN06              0.986    0.042   23.722    0.000
##     EN07              1.049    0.046   22.856    0.000
##     EN08              1.036    0.043   24.173    0.000
## 
## Variances:
##                    Estimate  Std.Err  z-value  P(>|z|)
##     energia           2.801    0.327    8.565    0.000
##    .EN01              0.711    0.074    9.651    0.000
##    .EN02              0.444    0.049    9.012    0.000
##    .EN04              0.481    0.052    9.214    0.000
##    .EN05              0.375    0.042    8.830    0.000
##    .EN06              0.359    0.041    8.798    0.000
##    .EN07              0.499    0.055    9.129    0.000
##    .EN08              0.353    0.041    8.580    0.000
lavaanPlot(cfa33, coef=TRUE, cov=TRUE)

##Evaluar el modelo 3

summary (cfa32, fit.measures=TRUE)
## lavaan 0.6-19 ended normally after 32 iterations
## 
##   Estimator                                         ML
##   Optimization method                           NLMINB
##   Number of model parameters                        14
## 
##   Number of observations                           223
## 
## Model Test User Model:
##                                                       
##   Test statistic                                47.222
##   Degrees of freedom                                14
##   P-value (Chi-square)                           0.000
## 
## Model Test Baseline Model:
## 
##   Test statistic                              2324.436
##   Degrees of freedom                                21
##   P-value                                        0.000
## 
## User Model versus Baseline Model:
## 
##   Comparative Fit Index (CFI)                    0.986
##   Tucker-Lewis Index (TLI)                       0.978
## 
## Loglikelihood and Information Criteria:
## 
##   Loglikelihood user model (H0)              -2017.154
##   Loglikelihood unrestricted model (H1)      -1993.543
##                                                       
##   Akaike (AIC)                                4062.308
##   Bayesian (BIC)                              4110.008
##   Sample-size adjusted Bayesian (SABIC)       4065.641
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.103
##   90 Percent confidence interval - lower         0.072
##   90 Percent confidence interval - upper         0.136
##   P-value H_0: RMSEA <= 0.050                    0.004
##   P-value H_0: RMSEA >= 0.080                    0.892
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.012
## 
## Parameter Estimates:
## 
##   Standard errors                             Standard
##   Information                                 Expected
##   Information saturated (h1) model          Structured
## 
## Latent Variables:
##                    Estimate  Std.Err  z-value  P(>|z|)
##   energia =~                                          
##     EN01              1.000                           
##     EN02              1.029    0.044   23.192    0.000
##     EN04              0.999    0.044   22.583    0.000
##     EN05              0.999    0.042   23.649    0.000
##     EN06              0.986    0.042   23.722    0.000
##     EN07              1.049    0.046   22.856    0.000
##     EN08              1.036    0.043   24.173    0.000
## 
## Variances:
##                    Estimate  Std.Err  z-value  P(>|z|)
##     energia           2.801    0.327    8.565    0.000
##    .EN01              0.711    0.074    9.651    0.000
##    .EN02              0.444    0.049    9.012    0.000
##    .EN04              0.481    0.052    9.214    0.000
##    .EN05              0.375    0.042    8.830    0.000
##    .EN06              0.359    0.041    8.798    0.000
##    .EN07              0.499    0.055    9.129    0.000
##    .EN08              0.353    0.041    8.580    0.000

##Parte 4. Modelo Completo

modelo34 <- ' #Regresiones
            #Variables Latentes
            desapego =~ RPD01 + RPD02 + RPD03 + RPD05 + RPD06 + RPD07 + RPD08 + RPD09 + RPD10
            relajacion =~ RRE02 + RRE03 + RRE04 + RRE05 + RRE06 + RRE07 + RRE10
            dominio =~  RMA03 + RMA03 + RMA04 + RMA05 + RMA06 + RMA07 + RMA08 + RMA09 + RMA10
            control =~ RCO02 + RCO03 + RCO04 + RCO05 + RCO06 + RCO07
            recuperacion =~ desapego + relajacion + dominio + control
            energia =~ EN01 + EN02 + EN04 + EN05 + EN06 + EN07 + EN08
            vigor =~ EVI01 + EVI02 + EVI03
            dedicacion =~ EDE01 + EDE02 + EDE03
            absorcion =~ EAB01 + EAB02 + EAB03
            #Varianzas y Covarianzas 
            desapego ~~ desapego 
            relajacion ~~ relajacion 
            dominio ~~ dominio 
            control ~~ control
            energia ~~ energia
            vigor ~~ vigor 
            dedicacion ~~ dedicacion 
            absorcion ~~ absorcion
            vigor ~~ dedicacion + absorcion
            dedicacion ~~ absorcion
            recuperacion ~~ energia + vigor + dedicacion + absorcion 
            energia ~~ vigor + dedicacion + absorcion
            #Intercepto
          '

##Generar el Analisis Factorial confirmatorio Modelo 4

cfa34 <- sem(modelo34, data=df3)
summary(cfa32)
## lavaan 0.6-19 ended normally after 32 iterations
## 
##   Estimator                                         ML
##   Optimization method                           NLMINB
##   Number of model parameters                        14
## 
##   Number of observations                           223
## 
## Model Test User Model:
##                                                       
##   Test statistic                                47.222
##   Degrees of freedom                                14
##   P-value (Chi-square)                           0.000
## 
## Parameter Estimates:
## 
##   Standard errors                             Standard
##   Information                                 Expected
##   Information saturated (h1) model          Structured
## 
## Latent Variables:
##                    Estimate  Std.Err  z-value  P(>|z|)
##   energia =~                                          
##     EN01              1.000                           
##     EN02              1.029    0.044   23.192    0.000
##     EN04              0.999    0.044   22.583    0.000
##     EN05              0.999    0.042   23.649    0.000
##     EN06              0.986    0.042   23.722    0.000
##     EN07              1.049    0.046   22.856    0.000
##     EN08              1.036    0.043   24.173    0.000
## 
## Variances:
##                    Estimate  Std.Err  z-value  P(>|z|)
##     energia           2.801    0.327    8.565    0.000
##    .EN01              0.711    0.074    9.651    0.000
##    .EN02              0.444    0.049    9.012    0.000
##    .EN04              0.481    0.052    9.214    0.000
##    .EN05              0.375    0.042    8.830    0.000
##    .EN06              0.359    0.041    8.798    0.000
##    .EN07              0.499    0.055    9.129    0.000
##    .EN08              0.353    0.041    8.580    0.000
lavaanPlot(cfa34, coef=TRUE, cov=TRUE)

##Evaluar el modelo 4

summary (cfa34, fit.measures=TRUE)
## lavaan 0.6-19 ended normally after 90 iterations
## 
##   Estimator                                         ML
##   Optimization method                           NLMINB
##   Number of model parameters                       106
## 
##   Number of observations                           223
## 
## Model Test User Model:
##                                                       
##   Test statistic                              2336.479
##   Degrees of freedom                               975
##   P-value (Chi-square)                           0.000
## 
## Model Test Baseline Model:
## 
##   Test statistic                             13086.220
##   Degrees of freedom                              1035
##   P-value                                        0.000
## 
## User Model versus Baseline Model:
## 
##   Comparative Fit Index (CFI)                    0.887
##   Tucker-Lewis Index (TLI)                       0.880
## 
## Loglikelihood and Information Criteria:
## 
##   Loglikelihood user model (H0)             -15041.289
##   Loglikelihood unrestricted model (H1)     -13873.049
##                                                       
##   Akaike (AIC)                               30294.577
##   Bayesian (BIC)                             30655.737
##   Sample-size adjusted Bayesian (SABIC)      30319.810
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.079
##   90 Percent confidence interval - lower         0.075
##   90 Percent confidence interval - upper         0.083
##   P-value H_0: RMSEA <= 0.050                    0.000
##   P-value H_0: RMSEA >= 0.080                    0.368
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.069
## 
## Parameter Estimates:
## 
##   Standard errors                             Standard
##   Information                                 Expected
##   Information saturated (h1) model          Structured
## 
## Latent Variables:
##                    Estimate  Std.Err  z-value  P(>|z|)
##   desapego =~                                         
##     RPD01             1.000                           
##     RPD02             1.209    0.081   14.858    0.000
##     RPD03             1.144    0.085   13.414    0.000
##     RPD05             1.314    0.086   15.311    0.000
##     RPD06             1.083    0.089   12.218    0.000
##     RPD07             1.229    0.085   14.481    0.000
##     RPD08             1.157    0.086   13.376    0.000
##     RPD09             1.315    0.087   15.162    0.000
##     RPD10             1.343    0.088   15.246    0.000
##   relajacion =~                                       
##     RRE02             1.000                           
##     RRE03             1.121    0.065   17.299    0.000
##     RRE04             1.020    0.058   17.611    0.000
##     RRE05             1.051    0.056   18.689    0.000
##     RRE06             1.245    0.074   16.915    0.000
##     RRE07             1.122    0.071   15.848    0.000
##     RRE10             0.815    0.067   12.146    0.000
##   dominio =~                                          
##     RMA03             1.000                           
##     RMA04             1.051    0.072   14.680    0.000
##     RMA05             1.011    0.071   14.294    0.000
##     RMA06             0.583    0.064    9.076    0.000
##     RMA07             0.989    0.068   14.497    0.000
##     RMA08             0.997    0.069   14.464    0.000
##     RMA09             0.927    0.069   13.515    0.000
##     RMA10             0.937    0.072   12.992    0.000
##   control =~                                          
##     RCO02             1.000                           
##     RCO03             0.946    0.049   19.155    0.000
##     RCO04             0.794    0.044   18.082    0.000
##     RCO05             0.815    0.043   18.911    0.000
##     RCO06             0.837    0.046   18.392    0.000
##     RCO07             0.837    0.046   18.198    0.000
##   recuperacion =~                                     
##     desapego          1.000                           
##     relajacion        1.072    0.121    8.856    0.000
##     dominio           1.018    0.142    7.177    0.000
##     control           1.422    0.157    9.064    0.000
##   energia =~                                          
##     EN01              1.000                           
##     EN02              1.026    0.044   23.557    0.000
##     EN04              0.996    0.043   22.911    0.000
##     EN05              0.994    0.042   23.892    0.000
##     EN06              0.981    0.041   23.941    0.000
##     EN07              1.044    0.045   23.102    0.000
##     EN08              1.031    0.042   24.448    0.000
##   vigor =~                                            
##     EVI01             1.000                           
##     EVI02             0.978    0.027   35.895    0.000
##     EVI03             0.990    0.048   20.657    0.000
##   dedicacion =~                                       
##     EDE01             1.000                           
##     EDE02             0.913    0.035   26.221    0.000
##     EDE03             0.580    0.037   15.850    0.000
##   absorcion =~                                        
##     EAB01             1.000                           
##     EAB02             0.707    0.051   13.915    0.000
##     EAB03             0.730    0.063   11.619    0.000
## 
## Covariances:
##                    Estimate  Std.Err  z-value  P(>|z|)
##   vigor ~~                                            
##     dedicacion        2.767    0.293    9.427    0.000
##     absorcion         2.132    0.248    8.613    0.000
##   dedicacion ~~                                       
##     absorcion         2.731    0.293    9.316    0.000
##   recuperacion ~~                                     
##     energia           1.366    0.197    6.936    0.000
##     vigor             1.007    0.165    6.098    0.000
##     dedicacion        1.049    0.179    5.856    0.000
##     absorcion         0.796    0.151    5.284    0.000
##   energia ~~                                          
##     vigor             2.045    0.249    8.223    0.000
##     dedicacion        1.852    0.259    7.139    0.000
##     absorcion         1.340    0.220    6.091    0.000
## 
## Variances:
##                    Estimate  Std.Err  z-value  P(>|z|)
##    .desapego          0.952    0.149    6.402    0.000
##    .relajacion        0.510    0.085    6.022    0.000
##    .dominio           1.486    0.231    6.441    0.000
##    .control           0.698    0.125    5.583    0.000
##     energia           2.823    0.327    8.622    0.000
##     vigor             2.859    0.289    9.900    0.000
##     dedicacion        3.458    0.367    9.425    0.000
##     absorcion         2.595    0.301    8.628    0.000
##    .RPD01             1.169    0.120    9.781    0.000
##    .RPD02             0.984    0.107    9.204    0.000
##    .RPD03             1.434    0.147    9.730    0.000
##    .RPD05             0.973    0.109    8.939    0.000
##    .RPD06             1.835    0.184    9.979    0.000
##    .RPD07             1.166    0.124    9.378    0.000
##    .RPD08             1.485    0.152    9.739    0.000
##    .RPD09             1.036    0.115    9.035    0.000
##    .RPD10             1.045    0.116    8.982    0.000
##    .RRE02             0.624    0.067    9.254    0.000
##    .RRE03             0.647    0.072    8.975    0.000
##    .RRE04             0.494    0.056    8.837    0.000
##    .RRE05             0.384    0.047    8.203    0.000
##    .RRE06             0.882    0.097    9.126    0.000
##    .RRE07             0.929    0.098    9.458    0.000
##    .RRE10             1.134    0.112   10.086    0.000
##    .RMA03             1.634    0.169    9.670    0.000
##    .RMA04             0.854    0.098    8.669    0.000
##    .RMA05             0.929    0.104    8.953    0.000
##    .RMA06             1.609    0.157   10.254    0.000
##    .RMA07             0.818    0.093    8.812    0.000
##    .RMA08             0.843    0.095    8.837    0.000
##    .RMA09             1.045    0.112    9.363    0.000
##    .RMA10             1.277    0.134    9.560    0.000
##    .RCO02             0.980    0.104    9.395    0.000
##    .RCO03             0.493    0.058    8.474    0.000
##    .RCO04             0.468    0.052    9.018    0.000
##    .RCO05             0.393    0.046    8.620    0.000
##    .RCO06             0.479    0.054    8.884    0.000
##    .RCO07             0.504    0.056    8.970    0.000
##    .EN01              0.689    0.071    9.661    0.000
##    .EN02              0.439    0.048    9.066    0.000
##    .EN04              0.476    0.051    9.266    0.000
##    .EN05              0.381    0.043    8.944    0.000
##    .EN06              0.367    0.041    8.925    0.000
##    .EN07              0.502    0.055    9.211    0.000
##    .EN08              0.358    0.041    8.708    0.000
##    .EVI01             0.177    0.036    4.919    0.000
##    .EVI02             0.242    0.038    6.299    0.000
##    .EVI03             1.222    0.124    9.826    0.000
##    .EDE01             0.395    0.065    6.059    0.000
##    .EDE02             0.498    0.066    7.580    0.000
##    .EDE03             0.836    0.085    9.887    0.000
##    .EAB01             0.478    0.099    4.805    0.000
##    .EAB02             1.010    0.109    9.283    0.000
##    .EAB03             1.718    0.176    9.778    0.000
##     recuperacion      0.971    0.198    4.893    0.000
LS0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IHJlY3VwZXJhY2lvbiA9fiBkZXNhcGVnbyArIHJlbGFqYWNpb24gKyBkb21pbmlvICsgY29udHJvbA0KICAgICAgICAgICAgZW5lcmdpYSA9fiBFTjAxICsgRU4wMiArIEVOMDQgKyBFTjA1ICsgRU4wNiArIEVOMDcgKyBFTjA4DQogICAgICAgICAgICB2aWdvciA9fiBFVkkwMSArIEVWSTAyICsgRVZJMDMNCiAgICAgICAgICAgIGRlZGljYWNpb24gPX4gRURFMDEgKyBFREUwMiArIEVERTAzDQogICAgICAgICAgICBhYnNvcmNpb24gPX4gRUFCMDEgKyBFQUIwMiArIEVBQjAzDQogICAgICAgICAgICAjVmFyaWFuemFzIHkgQ292YXJpYW56YXMgDQogICAgICAgICAgICBkZXNhcGVnbyB+fiBkZXNhcGVnbyANCiAgICAgICAgICAgIHJlbGFqYWNpb24gfn4gcmVsYWphY2lvbiANCiAgICAgICAgICAgIGRvbWluaW8gfn4gZG9taW5pbyANCiAgICAgICAgICAgIGNvbnRyb2wgfn4gY29udHJvbA0KICAgICAgICAgICAgZW5lcmdpYSB+fiBlbmVyZ2lhDQogICAgICAgICAgICB2aWdvciB+fiB2aWdvciANCiAgICAgICAgICAgIGRlZGljYWNpb24gfn4gZGVkaWNhY2lvbiANCiAgICAgICAgICAgIGFic29yY2lvbiB+fiBhYnNvcmNpb24NCiAgICAgICAgICAgIHZpZ29yIH5+IGRlZGljYWNpb24gKyBhYnNvcmNpb24NCiAgICAgICAgICAgIGRlZGljYWNpb24gfn4gYWJzb3JjaW9uDQogICAgICAgICAgICByZWN1cGVyYWNpb24gfn4gZW5lcmdpYSArIHZpZ29yICsgZGVkaWNhY2lvbiArIGFic29yY2lvbiANCiAgICAgICAgICAgIGVuZXJnaWEgfn4gdmlnb3IgKyBkZWRpY2FjaW9uICsgYWJzb3JjaW9uDQogICAgICAgICAgICAjSW50ZXJjZXB0bw0KICAgICAgICAgICcNCmBgYA0KDQoqKiMjR2VuZXJhciBlbCBBbmFsaXNpcyBGY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