Instalar librerias

library(readxl)
#install.packages("lavaan")
library(lavaan)
## This is lavaan 0.6-21
## lavaan is FREE software! Please report any bugs.
#install.packages("lavaanPlot")
library(lavaanPlot)

Importar Base de Datos

df <- read_excel("C:\\Users\\almai\\Downloads\\Datos_SEM_Eng.xlsx")

file.choose() # Entender la base de datos

summary(df)
##        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(df)
## 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(df)
## # 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>, …

El cuestionario evalúa experiencias de recuperación fuera del trabajo, energía recuperada y engagement laboral, todas medidas en escalas tipo Likert de 1 a 7. Estructuralmente, las variables se agrupan en dimensiones latentes bien definidas:
- Desapego psicológico (RPD): grado en que la persona logra desconectarse mentalmente del trabajo fuera del horario laboral.
- Relajación (RRE): actividades que reducen tensión y estrés mediante descanso o esparcimiento.
- Maestría (RMA): experiencias retadoras y de aprendizaje que amplían habilidades o perspectivas.
- Control (RCO): percepción de autonomía sobre cómo organizar el tiempo fuera del trabajo.
- Energía recuperada (EN / REG): sensación subjetiva de haber descansado y re-energizado.
- Engagement laboral (UWES): estado positivo relacionado con el trabajo, compuesto por:
- Vigor (EVI): altos niveles de energía y resiliencia.
- Dedicación (EDE): entusiasmo, inspiración y orgullo.
- Absorción (EAB): concentración profunda e inmersión en el trabajo.

Parte 1: Experiencias de Recuperación

modelo1 <- '  # variables latentes

desapego =~ RPD01 + RPD02 + RPD03 + RPD05 +
            RPD06 + RPD07 + RPD08 + RPD09 + RPD10

relajacion =~ RRE02 + RRE03 + RRE04 + RRE05 +
              RRE06 + RRE07 + RRE10

dominio =~ RMA02 + RMA03 + RMA04 + RMA05 +
           RMA06 + RMA07 + RMA08 + RMA09 + RMA10

control =~ RCO02 + RCO03 + RCO04 + RCO05 +
           RCO06 + RCO07
'
# Análisis Factorial Confirmatorio
fit1 <- cfa(modelo1,df) # integra bd con el modelo
summary(fit1, fit.measures = TRUE, standardized = TRUE)
## lavaan 0.6-21 ended normally after 56 iterations
## 
##   Estimator                                         ML
##   Optimization method                           NLMINB
##   Number of model parameters                        68
## 
##   Number of observations                           223
## 
## Model Test User Model:
##                                                       
##   Test statistic                              1215.404
##   Degrees of freedom                               428
##   P-value (Chi-square)                           0.000
## 
## Model Test Baseline Model:
## 
##   Test statistic                              7522.157
##   Degrees of freedom                               465
##   P-value                                        0.000
## 
## User Model versus Baseline Model:
## 
##   Comparative Fit Index (CFI)                    0.888
##   Tucker-Lewis Index (TLI)                       0.879
## 
## Loglikelihood and Information Criteria:
## 
##   Loglikelihood user model (H0)             -10613.334
##   Loglikelihood unrestricted model (H1)     -10005.632
##                                                       
##   Akaike (AIC)                               21362.669
##   Bayesian (BIC)                             21594.356
##   Sample-size adjusted Bayesian (SABIC)      21378.856
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.091
##   90 Percent confidence interval - lower         0.085
##   90 Percent confidence interval - upper         0.097
##   P-value H_0: RMSEA <= 0.050                    0.000
##   P-value H_0: RMSEA >= 0.080                    0.998
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.071
## 
## Parameter Estimates:
## 
##   Standard errors                             Standard
##   Information                                 Expected
##   Information saturated (h1) model          Structured
## 
## Latent Variables:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##   desapego =~                                                           
##     RPD01             1.000                               1.388    0.789
##     RPD02             1.204    0.081   14.786    0.000    1.670    0.857
##     RPD03             1.143    0.085   13.420    0.000    1.586    0.798
##     RPD05             1.310    0.086   15.269    0.000    1.818    0.877
##     RPD06             1.086    0.088   12.282    0.000    1.507    0.745
##     RPD07             1.227    0.085   14.451    0.000    1.702    0.843
##     RPD08             1.163    0.086   13.487    0.000    1.614    0.801
##     RPD09             1.315    0.087   15.175    0.000    1.825    0.873
##     RPD10             1.345    0.088   15.290    0.000    1.866    0.878
##   relajacion =~                                                         
##     RRE02             1.000                               1.275    0.850
##     RRE03             1.120    0.065   17.268    0.000    1.427    0.871
##     RRE04             1.024    0.058   17.732    0.000    1.306    0.883
##     RRE05             1.055    0.056   18.798    0.000    1.345    0.910
##     RRE06             1.243    0.074   16.857    0.000    1.585    0.859
##     RRE07             1.115    0.071   15.687    0.000    1.422    0.824
##     RRE10             0.815    0.067   12.135    0.000    1.038    0.698
##   dominio =~                                                            
##     RMA02             1.000                               1.406    0.729
##     RMA03             1.155    0.096   12.060    0.000    1.624    0.799
##     RMA04             1.179    0.089   13.267    0.000    1.659    0.874
##     RMA05             1.141    0.087   13.049    0.000    1.604    0.860
##     RMA06             0.647    0.075    8.618    0.000    0.911    0.581
##     RMA07             1.104    0.085   13.050    0.000    1.552    0.860
##     RMA08             1.109    0.085   12.985    0.000    1.560    0.856
##     RMA09             1.030    0.084   12.251    0.000    1.448    0.811
##     RMA10             1.056    0.088   12.039    0.000    1.486    0.798
##   control =~                                                            
##     RCO02             1.000                               1.631    0.855
##     RCO03             0.948    0.049   19.230    0.000    1.546    0.912
##     RCO04             0.795    0.044   18.125    0.000    1.297    0.886
##     RCO05             0.817    0.043   18.981    0.000    1.332    0.906
##     RCO06             0.834    0.046   18.247    0.000    1.360    0.889
##     RCO07             0.834    0.046   18.078    0.000    1.361    0.884
## 
## Covariances:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##   desapego ~~                                                           
##     relajacion        1.155    0.164    7.023    0.000    0.653    0.653
##     dominio           0.696    0.155    4.477    0.000    0.357    0.357
##     control           1.319    0.200    6.584    0.000    0.583    0.583
##   relajacion ~~                                                         
##     dominio           0.969    0.159    6.085    0.000    0.540    0.540
##     control           1.483    0.195    7.610    0.000    0.713    0.713
##   dominio ~~                                                            
##     control           1.221    0.202    6.047    0.000    0.532    0.532
## 
## Variances:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##    .RPD01             1.168    0.119    9.778    0.000    1.168    0.378
##    .RPD02             1.005    0.109    9.240    0.000    1.005    0.265
##    .RPD03             1.434    0.147    9.728    0.000    1.434    0.363
##    .RPD05             0.989    0.110    8.969    0.000    0.989    0.230
##    .RPD06             1.817    0.182    9.968    0.000    1.817    0.444
##    .RPD07             1.177    0.125    9.391    0.000    1.177    0.289
##    .RPD08             1.454    0.150    9.710    0.000    1.454    0.358
##    .RPD09             1.035    0.115    9.028    0.000    1.035    0.237
##    .RPD10             1.033    0.115    8.956    0.000    1.033    0.229
##    .RRE02             0.624    0.067    9.269    0.000    0.624    0.277
##    .RRE03             0.651    0.072    9.005    0.000    0.651    0.242
##    .RRE04             0.481    0.055    8.798    0.000    0.481    0.220
##    .RRE05             0.373    0.046    8.147    0.000    0.373    0.171
##    .RRE06             0.891    0.097    9.162    0.000    0.891    0.262
##    .RRE07             0.953    0.100    9.511    0.000    0.953    0.320
##    .RRE10             1.136    0.113   10.092    0.000    1.136    0.513
##    .RMA02             1.742    0.175    9.934    0.000    1.742    0.468
##    .RMA03             1.489    0.155    9.581    0.000    1.489    0.361
##    .RMA04             0.854    0.097    8.772    0.000    0.854    0.237
##    .RMA05             0.904    0.101    8.981    0.000    0.904    0.260
##    .RMA06             1.627    0.158   10.279    0.000    1.627    0.662
##    .RMA07             0.846    0.094    8.980    0.000    0.846    0.260
##    .RMA08             0.885    0.098    9.035    0.000    0.885    0.267
##    .RMA09             1.090    0.115    9.496    0.000    1.090    0.342
##    .RMA10             1.258    0.131    9.590    0.000    1.258    0.363
##    .RCO02             0.980    0.105    9.375    0.000    0.980    0.269
##    .RCO03             0.482    0.057    8.379    0.000    0.482    0.168
##    .RCO04             0.463    0.052    8.967    0.000    0.463    0.216
##    .RCO05             0.385    0.045    8.536    0.000    0.385    0.178
##    .RCO06             0.493    0.055    8.915    0.000    0.493    0.210
##    .RCO07             0.516    0.057    8.987    0.000    0.516    0.218
##     desapego          1.925    0.275    7.002    0.000    1.000    1.000
##     relajacion        1.625    0.207    7.845    0.000    1.000    1.000
##     dominio           1.978    0.317    6.241    0.000    1.000    1.000
##     control           2.660    0.335    7.930    0.000    1.000    1.000
lavaanPlot(model = fit1, coefs = TRUE, covs = TRUE)

Parte 1: Segundo orden

recuperacion =~ desapego + relajacion + dominio + control
modelo1_2orden <- '

desapego =~ RPD01 + RPD02 + RPD03 + RPD05 +
            RPD06 + RPD07 + RPD08 + RPD09 + RPD10

relajacion =~ RRE02 + RRE03 + RRE04 + RRE05 +
              RRE06 + RRE07 + RRE10

dominio =~ RMA02 + RMA03 + RMA04 + RMA05 +
           RMA06 + RMA07 + RMA08 + RMA09 + RMA10

control =~ RCO02 + RCO03 + RCO04 + RCO05 +
           RCO06 + RCO07

recuperacion =~ desapego + relajacion + dominio + control
'

fit1_2orden <- cfa(modelo1_2orden, df)
summary(fit1_2orden, fit.measures=TRUE, standardized=TRUE)
## lavaan 0.6-21 ended normally after 47 iterations
## 
##   Estimator                                         ML
##   Optimization method                           NLMINB
##   Number of model parameters                        66
## 
##   Number of observations                           223
## 
## Model Test User Model:
##                                                       
##   Test statistic                              1221.031
##   Degrees of freedom                               430
##   P-value (Chi-square)                           0.000
## 
## Model Test Baseline Model:
## 
##   Test statistic                              7522.157
##   Degrees of freedom                               465
##   P-value                                        0.000
## 
## User Model versus Baseline Model:
## 
##   Comparative Fit Index (CFI)                    0.888
##   Tucker-Lewis Index (TLI)                       0.879
## 
## Loglikelihood and Information Criteria:
## 
##   Loglikelihood user model (H0)             -10616.148
##   Loglikelihood unrestricted model (H1)     -10005.632
##                                                       
##   Akaike (AIC)                               21364.296
##   Bayesian (BIC)                             21589.169
##   Sample-size adjusted Bayesian (SABIC)      21380.007
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.091
##   90 Percent confidence interval - lower         0.085
##   90 Percent confidence interval - upper         0.097
##   P-value H_0: RMSEA <= 0.050                    0.000
##   P-value H_0: RMSEA >= 0.080                    0.998
## 
## 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|)   Std.lv  Std.all
##   desapego =~                                                           
##     RPD01             1.000                               1.386    0.788
##     RPD02             1.206    0.082   14.780    0.000    1.672    0.858
##     RPD03             1.143    0.085   13.374    0.000    1.584    0.797
##     RPD05             1.312    0.086   15.244    0.000    1.818    0.878
##     RPD06             1.088    0.089   12.266    0.000    1.507    0.745
##     RPD07             1.229    0.085   14.440    0.000    1.703    0.844
##     RPD08             1.164    0.087   13.447    0.000    1.613    0.800
##     RPD09             1.317    0.087   15.153    0.000    1.826    0.874
##     RPD10             1.346    0.088   15.258    0.000    1.866    0.878
##   relajacion =~                                                         
##     RRE02             1.000                               1.274    0.849
##     RRE03             1.120    0.065   17.227    0.000    1.427    0.870
##     RRE04             1.025    0.058   17.713    0.000    1.306    0.883
##     RRE05             1.055    0.056   18.758    0.000    1.344    0.910
##     RRE06             1.245    0.074   16.869    0.000    1.586    0.860
##     RRE07             1.117    0.071   15.689    0.000    1.423    0.825
##     RRE10             0.815    0.067   12.120    0.000    1.038    0.698
##   dominio =~                                                            
##     RMA02             1.000                               1.407    0.730
##     RMA03             1.155    0.096   12.079    0.000    1.626    0.800
##     RMA04             1.178    0.089   13.274    0.000    1.658    0.873
##     RMA05             1.141    0.087   13.072    0.000    1.606    0.861
##     RMA06             0.645    0.075    8.597    0.000    0.908    0.579
##     RMA07             1.103    0.084   13.061    0.000    1.552    0.860
##     RMA08             1.109    0.085   12.994    0.000    1.560    0.856
##     RMA09             1.028    0.084   12.246    0.000    1.447    0.810
##     RMA10             1.055    0.088   12.044    0.000    1.485    0.798
##   control =~                                                            
##     RCO02             1.000                               1.630    0.854
##     RCO03             0.948    0.049   19.182    0.000    1.545    0.912
##     RCO04             0.796    0.044   18.110    0.000    1.297    0.886
##     RCO05             0.818    0.043   18.990    0.000    1.333    0.907
##     RCO06             0.834    0.046   18.216    0.000    1.360    0.888
##     RCO07             0.835    0.046   18.057    0.000    1.361    0.884
##   recuperacion =~                                                       
##     desapego          1.000                               0.713    0.713
##     relajacion        1.149    0.131    8.787    0.000    0.892    0.892
##     dominio           0.858    0.129    6.666    0.000    0.603    0.603
##     control           1.341    0.156    8.605    0.000    0.813    0.813
## 
## Variances:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##    .RPD01             1.172    0.120    9.782    0.000    1.172    0.379
##    .RPD02             0.999    0.108    9.228    0.000    0.999    0.263
##    .RPD03             1.441    0.148    9.733    0.000    1.441    0.365
##    .RPD05             0.987    0.110    8.964    0.000    0.987    0.230
##    .RPD06             1.817    0.182    9.967    0.000    1.817    0.444
##    .RPD07             1.173    0.125    9.383    0.000    1.173    0.288
##    .RPD08             1.460    0.150    9.714    0.000    1.460    0.360
##    .RPD09             1.032    0.114    9.021    0.000    1.032    0.236
##    .RPD10             1.034    0.115    8.955    0.000    1.034    0.229
##    .RRE02             0.626    0.068    9.274    0.000    0.626    0.278
##    .RRE03             0.653    0.073    9.011    0.000    0.653    0.243
##    .RRE04             0.481    0.055    8.794    0.000    0.481    0.220
##    .RRE05             0.374    0.046    8.153    0.000    0.374    0.172
##    .RRE06             0.886    0.097    9.149    0.000    0.886    0.260
##    .RRE07             0.950    0.100    9.505    0.000    0.950    0.319
##    .RRE10             1.137    0.113   10.093    0.000    1.137    0.513
##    .RMA02             1.740    0.175    9.931    0.000    1.740    0.468
##    .RMA03             1.485    0.155    9.575    0.000    1.485    0.360
##    .RMA04             0.855    0.097    8.772    0.000    0.855    0.237
##    .RMA05             0.899    0.100    8.967    0.000    0.899    0.259
##    .RMA06             1.631    0.159   10.281    0.000    1.631    0.664
##    .RMA07             0.845    0.094    8.977    0.000    0.845    0.260
##    .RMA08             0.886    0.098    9.034    0.000    0.886    0.267
##    .RMA09             1.094    0.115    9.500    0.000    1.094    0.343
##    .RMA10             1.259    0.131    9.590    0.000    1.259    0.363
##    .RCO02             0.983    0.105    9.379    0.000    0.983    0.270
##    .RCO03             0.484    0.058    8.391    0.000    0.484    0.169
##    .RCO04             0.462    0.052    8.963    0.000    0.462    0.215
##    .RCO05             0.382    0.045    8.513    0.000    0.382    0.177
##    .RCO06             0.494    0.055    8.917    0.000    0.494    0.211
##    .RCO07             0.515    0.057    8.985    0.000    0.515    0.218
##    .desapego          0.943    0.152    6.207    0.000    0.491    0.491
##    .relajacion        0.333    0.089    3.757    0.000    0.205    0.205
##    .dominio           1.260    0.212    5.942    0.000    0.636    0.636
##    .control           0.900    0.159    5.666    0.000    0.339    0.339
##     recuperacion      0.978    0.202    4.833    0.000    1.000    1.000
library(lavaanPlot)

lavaanPlot(
  model = fit1_2orden,
  coefs = TRUE,
  stand = TRUE,
  covs = FALSE,
  graph_options = list(rankdir = "TB")
)

Parte 2: Energía Recuperada

modelo2 <- '  # variables latentes
energia =~ EN01 + EN02 + EN04 + EN05 +
           EN06 + EN07 + EN08
'
# Análisis Factorial Confirmatorio
fit2 <- cfa(modelo2,df) # integra bd con el modelo
summary(fit2, fit.measures = TRUE, standardized = TRUE)
## lavaan 0.6-21 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|)   Std.lv  Std.all
##   energia =~                                                            
##     EN01              1.000                               1.674    0.893
##     EN02              1.029    0.044   23.192    0.000    1.723    0.933
##     EN04              0.999    0.044   22.583    0.000    1.672    0.924
##     EN05              0.999    0.042   23.649    0.000    1.672    0.939
##     EN06              0.986    0.042   23.722    0.000    1.651    0.940
##     EN07              1.049    0.046   22.856    0.000    1.755    0.928
##     EN08              1.036    0.043   24.173    0.000    1.734    0.946
## 
## Variances:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##    .EN01              0.711    0.074    9.651    0.000    0.711    0.202
##    .EN02              0.444    0.049    9.012    0.000    0.444    0.130
##    .EN04              0.481    0.052    9.214    0.000    0.481    0.147
##    .EN05              0.375    0.042    8.830    0.000    0.375    0.118
##    .EN06              0.359    0.041    8.798    0.000    0.359    0.116
##    .EN07              0.499    0.055    9.129    0.000    0.499    0.139
##    .EN08              0.353    0.041    8.580    0.000    0.353    0.105
##     energia           2.801    0.327    8.565    0.000    1.000    1.000
lavaanPlot(model = fit2, coefs = TRUE, covs = TRUE)

Parte 3: Compromiso Laboral

modelo3 <- '  # variables latentes

vigor =~ EVI01 + EVI02 + EVI03

dedicacion =~ EDE01 + EDE02 + EDE03

absorcion =~ EAB01 + EAB02 + EAB03
'
# Análisis Factorial Confirmatorio
fit3 <- cfa(modelo3,df) # integra bd con el modelo
summary(fit3, fit3.measures = TRUE, standardized = TRUE)
## Warning: lavaan->.local():  
##    Unknown argument 'fit3.measures' for 'summary'
## lavaan 0.6-21 ended normally after 44 iterations
## 
##   Estimator                                         ML
##   Optimization method                           NLMINB
##   Number of model parameters                        21
## 
##   Number of observations                           223
## 
## Model Test User Model:
##                                                       
##   Test statistic                               271.168
##   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|)   Std.lv  Std.all
##   vigor =~                                                              
##     EVI01             1.000                               1.684    0.967
##     EVI02             0.986    0.028   35.166    0.000    1.660    0.962
##     EVI03             0.995    0.049   20.456    0.000    1.675    0.835
##   dedicacion =~                                                         
##     EDE01             1.000                               1.857    0.946
##     EDE02             0.914    0.035   26.126    0.000    1.698    0.924
##     EDE03             0.583    0.037   15.913    0.000    1.082    0.765
##   absorcion =~                                                          
##     EAB01             1.000                               1.610    0.918
##     EAB02             0.708    0.051   13.891    0.000    1.140    0.750
##     EAB03             0.732    0.063   11.644    0.000    1.179    0.669
## 
## Covariances:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##   vigor ~~                                                              
##     dedicacion        2.754    0.293    9.404    0.000    0.881    0.881
##     absorcion         2.125    0.247    8.600    0.000    0.784    0.784
##   dedicacion ~~                                                         
##     absorcion         2.728    0.293    9.311    0.000    0.913    0.913
## 
## Variances:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##    .EVI01             0.200    0.040    4.947    0.000    0.200    0.066
##    .EVI02             0.220    0.041    5.437    0.000    0.220    0.074
##    .EVI03             1.220    0.125    9.772    0.000    1.220    0.303
##    .EDE01             0.405    0.066    6.130    0.000    0.405    0.105
##    .EDE02             0.495    0.066    7.521    0.000    0.495    0.146
##    .EDE03             0.829    0.084    9.869    0.000    0.829    0.415
##    .EAB01             0.481    0.100    4.816    0.000    0.481    0.157
##    .EAB02             1.010    0.109    9.271    0.000    1.010    0.437
##    .EAB03             1.711    0.175    9.764    0.000    1.711    0.552
##     vigor             2.836    0.289    9.811    0.000    1.000    1.000
##     dedicacion        3.448    0.367    9.399    0.000    1.000    1.000
##     absorcion         2.592    0.301    8.615    0.000    1.000    1.000
lavaanPlot(model = fit3, coefs = TRUE, covs = TRUE)
modelo3 <- '

# Recuperación (segundo orden)
desapego =~ RPD01 + RPD02 + RPD03 + RPD05 +
            RPD06 + RPD07 + RPD08 + RPD09 + RPD10

relajacion =~ RRE02 + RRE03 + RRE04 + RRE05 +
              RRE06 + RRE07 + RRE10

dominio =~ RMA02 + RMA03 + RMA04 + RMA05 +
           RMA06 + RMA07 + RMA08 + RMA09 + RMA10

control =~ RCO02 + RCO03 + RCO04 + RCO05 +
           RCO06 + RCO07

recuperacion =~ desapego + relajacion + dominio + control

# Energía
energia =~ EN01 + EN02 + EN04 + EN05 +
           EN06 + EN07 + EN08

# Engagement
vigor =~ EVI01 + EVI02 + EVI03
dedicacion =~ EDE01 + EDE02 + EDE03
absorcion =~ EAB01 + EAB02 + EAB03

engagement =~ vigor + dedicacion + absorcion

# Relaciones estructurales
energia ~ a*recuperacion
engagement ~ b*energia + c*recuperacion

# Efectos indirectos
indirecto := a*b
total := c + (a*b)
'

fit3 <- sem(modelo3, df)
summary(fit3, fit.measures=TRUE, standardized=TRUE, rsquare=TRUE)
## lavaan 0.6-21 ended normally after 67 iterations
## 
##   Estimator                                         ML
##   Optimization method                           NLMINB
##   Number of model parameters                       104
## 
##   Number of observations                           223
## 
## Model Test User Model:
##                                                       
##   Test statistic                              2501.954
##   Degrees of freedom                              1024
##   P-value (Chi-square)                           0.000
## 
## Model Test Baseline Model:
## 
##   Test statistic                             13350.303
##   Degrees of freedom                              1081
##   P-value                                        0.000
## 
## User Model versus Baseline Model:
## 
##   Comparative Fit Index (CFI)                    0.880
##   Tucker-Lewis Index (TLI)                       0.873
## 
## Loglikelihood and Information Criteria:
## 
##   Loglikelihood user model (H0)             -15454.903
##   Loglikelihood unrestricted model (H1)     -14203.926
##                                                       
##   Akaike (AIC)                               31117.805
##   Bayesian (BIC)                             31472.151
##   Sample-size adjusted Bayesian (SABIC)      31142.562
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.080
##   90 Percent confidence interval - lower         0.076
##   90 Percent confidence interval - upper         0.084
##   P-value H_0: RMSEA <= 0.050                    0.000
##   P-value H_0: RMSEA >= 0.080                    0.578
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.074
## 
## Parameter Estimates:
## 
##   Standard errors                             Standard
##   Information                                 Expected
##   Information saturated (h1) model          Structured
## 
## Latent Variables:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##   desapego =~                                                           
##     RPD01             1.000                               1.387    0.789
##     RPD02             1.209    0.081   14.865    0.000    1.677    0.861
##     RPD03             1.144    0.085   13.419    0.000    1.587    0.798
##     RPD05             1.313    0.086   15.317    0.000    1.822    0.879
##     RPD06             1.082    0.089   12.214    0.000    1.501    0.742
##     RPD07             1.229    0.085   14.487    0.000    1.705    0.845
##     RPD08             1.157    0.086   13.375    0.000    1.604    0.796
##     RPD09             1.315    0.087   15.163    0.000    1.824    0.873
##     RPD10             1.343    0.088   15.247    0.000    1.863    0.877
##   relajacion =~                                                         
##     RRE02             1.000                               1.275    0.850
##     RRE03             1.120    0.065   17.295    0.000    1.429    0.871
##     RRE04             1.021    0.058   17.625    0.000    1.301    0.880
##     RRE05             1.051    0.056   18.687    0.000    1.341    0.908
##     RRE06             1.246    0.074   16.924    0.000    1.588    0.861
##     RRE07             1.121    0.071   15.838    0.000    1.430    0.829
##     RRE10             0.814    0.067   12.134    0.000    1.038    0.698
##   dominio =~                                                            
##     RMA02             1.000                               1.407    0.729
##     RMA03             1.152    0.096   12.041    0.000    1.621    0.798
##     RMA04             1.178    0.089   13.265    0.000    1.658    0.873
##     RMA05             1.141    0.087   13.057    0.000    1.605    0.860
##     RMA06             0.648    0.075    8.625    0.000    0.911    0.581
##     RMA07             1.104    0.085   13.062    0.000    1.553    0.861
##     RMA08             1.110    0.085   13.001    0.000    1.561    0.857
##     RMA09             1.030    0.084   12.257    0.000    1.448    0.811
##     RMA10             1.056    0.088   12.047    0.000    1.486    0.798
##   control =~                                                            
##     RCO02             1.000                               1.632    0.855
##     RCO03             0.945    0.049   19.172    0.000    1.543    0.910
##     RCO04             0.794    0.044   18.100    0.000    1.295    0.884
##     RCO05             0.814    0.043   18.926    0.000    1.329    0.904
##     RCO06             0.837    0.045   18.407    0.000    1.365    0.892
##     RCO07             0.836    0.046   18.205    0.000    1.364    0.887
##   recuperacion =~                                                       
##     desapego          1.000                               0.711    0.711
##     relajacion        1.070    0.121    8.840    0.000    0.827    0.827
##     dominio           0.900    0.129    6.960    0.000    0.631    0.631
##     control           1.423    0.157    9.062    0.000    0.860    0.860
##   energia =~                                                            
##     EN01              1.000                               1.678    0.896
##     EN02              1.027    0.044   23.415    0.000    1.723    0.933
##     EN04              0.998    0.044   22.871    0.000    1.675    0.925
##     EN05              0.996    0.042   23.836    0.000    1.671    0.939
##     EN06              0.983    0.041   23.857    0.000    1.649    0.939
##     EN07              1.045    0.045   22.963    0.000    1.753    0.926
##     EN08              1.033    0.042   24.398    0.000    1.733    0.946
##   vigor =~                                                              
##     EVI01             1.000                               1.684    0.967
##     EVI02             0.985    0.028   35.282    0.000    1.659    0.962
##     EVI03             0.996    0.048   20.546    0.000    1.677    0.836
##   dedicacion =~                                                         
##     EDE01             1.000                               1.868    0.952
##     EDE02             0.907    0.034   26.376    0.000    1.695    0.922
##     EDE03             0.571    0.037   15.539    0.000    1.066    0.754
##   absorcion =~                                                          
##     EAB01             1.000                               1.607    0.917
##     EAB02             0.711    0.051   13.823    0.000    1.143    0.752
##     EAB03             0.735    0.063   11.600    0.000    1.181    0.671
##   engagement =~                                                         
##     vigor             1.000                               0.901    0.901
##     dedicacion        1.213    0.061   19.812    0.000    0.985    0.985
##     absorcion         0.958    0.059   16.371    0.000    0.904    0.904
## 
## Regressions:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##   energia ~                                                             
##     recuperacn (a)    1.405    0.154    9.093    0.000    0.825    0.825
##   engagement ~                                                          
##     energia    (b)    0.407    0.106    3.845    0.000    0.450    0.450
##     recuperacn (c)    0.347    0.189    1.839    0.066    0.225    0.225
## 
## Variances:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##    .RPD01             1.168    0.119    9.781    0.000    1.168    0.378
##    .RPD02             0.983    0.107    9.202    0.000    0.983    0.259
##    .RPD03             1.434    0.147    9.729    0.000    1.434    0.363
##    .RPD05             0.972    0.109    8.938    0.000    0.972    0.227
##    .RPD06             1.836    0.184    9.980    0.000    1.836    0.449
##    .RPD07             1.165    0.124    9.377    0.000    1.165    0.286
##    .RPD08             1.486    0.153    9.740    0.000    1.486    0.366
##    .RPD09             1.037    0.115    9.036    0.000    1.037    0.238
##    .RPD10             1.046    0.116    8.984    0.000    1.046    0.232
##    .RRE02             0.623    0.067    9.252    0.000    0.623    0.277
##    .RRE03             0.647    0.072    8.976    0.000    0.647    0.241
##    .RRE04             0.492    0.056    8.829    0.000    0.492    0.225
##    .RRE05             0.384    0.047    8.203    0.000    0.384    0.176
##    .RRE06             0.880    0.097    9.122    0.000    0.880    0.259
##    .RRE07             0.930    0.098    9.460    0.000    0.930    0.313
##    .RRE10             1.136    0.113   10.087    0.000    1.136    0.513
##    .RMA02             1.741    0.175    9.935    0.000    1.741    0.468
##    .RMA03             1.499    0.156    9.594    0.000    1.499    0.363
##    .RMA04             0.857    0.098    8.785    0.000    0.857    0.238
##    .RMA05             0.903    0.101    8.983    0.000    0.903    0.260
##    .RMA06             1.626    0.158   10.280    0.000    1.626    0.662
##    .RMA07             0.844    0.094    8.979    0.000    0.844    0.259
##    .RMA08             0.882    0.098    9.031    0.000    0.882    0.266
##    .RMA09             1.090    0.115    9.498    0.000    1.090    0.342
##    .RMA10             1.257    0.131    9.592    0.000    1.257    0.363
##    .RCO02             0.978    0.104    9.391    0.000    0.978    0.269
##    .RCO03             0.493    0.058    8.474    0.000    0.493    0.172
##    .RCO04             0.468    0.052    9.016    0.000    0.468    0.218
##    .RCO05             0.393    0.046    8.621    0.000    0.393    0.182
##    .RCO06             0.479    0.054    8.884    0.000    0.479    0.205
##    .RCO07             0.505    0.056    8.972    0.000    0.505    0.213
##    .EN01              0.696    0.072    9.660    0.000    0.696    0.198
##    .EN02              0.443    0.049    9.064    0.000    0.443    0.130
##    .EN04              0.473    0.051    9.236    0.000    0.473    0.144
##    .EN05              0.378    0.042    8.907    0.000    0.378    0.119
##    .EN06              0.366    0.041    8.899    0.000    0.366    0.119
##    .EN07              0.507    0.055    9.209    0.000    0.507    0.142
##    .EN08              0.353    0.041    8.658    0.000    0.353    0.105
##    .EVI01             0.199    0.039    5.047    0.000    0.199    0.065
##    .EVI02             0.224    0.040    5.620    0.000    0.224    0.075
##    .EVI03             1.213    0.124    9.773    0.000    1.213    0.301
##    .EDE01             0.363    0.065    5.605    0.000    0.363    0.094
##    .EDE02             0.506    0.067    7.567    0.000    0.506    0.150
##    .EDE03             0.864    0.087    9.921    0.000    0.864    0.432
##    .EAB01             0.490    0.103    4.767    0.000    0.490    0.159
##    .EAB02             1.003    0.109    9.186    0.000    1.003    0.434
##    .EAB03             1.706    0.176    9.719    0.000    1.706    0.550
##    .desapego          0.952    0.149    6.396    0.000    0.495    0.495
##    .relajacion        0.514    0.085    6.023    0.000    0.316    0.316
##    .dominio           1.191    0.200    5.956    0.000    0.602    0.602
##    .control           0.694    0.125    5.538    0.000    0.261    0.261
##     recuperacion      0.972    0.199    4.892    0.000    1.000    1.000
##    .energia           0.898    0.137    6.565    0.000    0.319    0.319
##    .vigor             0.536    0.085    6.327    0.000    0.189    0.189
##    .dedicacion        0.102    0.090    1.143    0.253    0.029    0.029
##    .absorcion         0.472    0.112    4.233    0.000    0.183    0.183
##    .engagement        1.333    0.171    7.804    0.000    0.579    0.579
## 
## R-Square:
##                    Estimate
##     RPD01             0.622
##     RPD02             0.741
##     RPD03             0.637
##     RPD05             0.773
##     RPD06             0.551
##     RPD07             0.714
##     RPD08             0.634
##     RPD09             0.762
##     RPD10             0.768
##     RRE02             0.723
##     RRE03             0.759
##     RRE04             0.775
##     RRE05             0.824
##     RRE06             0.741
##     RRE07             0.687
##     RRE10             0.487
##     RMA02             0.532
##     RMA03             0.637
##     RMA04             0.762
##     RMA05             0.740
##     RMA06             0.338
##     RMA07             0.741
##     RMA08             0.734
##     RMA09             0.658
##     RMA10             0.637
##     RCO02             0.731
##     RCO03             0.828
##     RCO04             0.782
##     RCO05             0.818
##     RCO06             0.795
##     RCO07             0.787
##     EN01              0.802
##     EN02              0.870
##     EN04              0.856
##     EN05              0.881
##     EN06              0.881
##     EN07              0.858
##     EN08              0.895
##     EVI01             0.935
##     EVI02             0.925
##     EVI03             0.699
##     EDE01             0.906
##     EDE02             0.850
##     EDE03             0.568
##     EAB01             0.841
##     EAB02             0.566
##     EAB03             0.450
##     desapego          0.505
##     relajacion        0.684
##     dominio           0.398
##     control           0.739
##     energia           0.681
##     vigor             0.811
##     dedicacion        0.971
##     absorcion         0.817
##     engagement        0.421
## 
## Defined Parameters:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##     indirecto         0.571    0.157    3.629    0.000    0.371    0.371
##     total             0.918    0.130    7.038    0.000    0.597    0.597
library(lavaanPlot)

lavaanPlot(
  model = fit3,
  coefs = TRUE,        # muestra coeficientes
  stand = TRUE,        # coeficientes estandarizados
  covs = FALSE,        # quita covarianzas para que se vea limpio
  graph_options = list(rankdir = "TB")  # estructura vertical
)

Parte 4: Modelo de medición

modelo4 <- '

# Recuperación (segundo orden)
desapego =~ RPD01 + RPD02 + RPD03 + RPD05 +
            RPD06 + RPD07 + RPD08 + RPD09 + RPD10

relajacion =~ RRE02 + RRE03 + RRE04 + RRE05 +
              RRE06 + RRE07 + RRE10

dominio =~ RMA02 + RMA03 + RMA04 + RMA05 +
           RMA06 + RMA07 + RMA08 + RMA09 + RMA10

control =~ RCO02 + RCO03 + RCO04 + RCO05 +
           RCO06 + RCO07

recuperacion =~ desapego + relajacion + dominio + control

# Energía
energia =~ EN01 + EN02 + EN04 + EN05 +
           EN06 + EN07 + EN08

# Engagement (segundo orden)
vigor =~ EVI01 + EVI02 + EVI03
dedicacion =~ EDE01 + EDE02 + EDE03
absorcion =~ EAB01 + EAB02 + EAB03

engagement =~ vigor + dedicacion + absorcion
'

fit4 <- cfa(modelo4, df)
summary(fit4, fit.measures=TRUE, standardized=TRUE)
## lavaan 0.6-21 ended normally after 74 iterations
## 
##   Estimator                                         ML
##   Optimization method                           NLMINB
##   Number of model parameters                       104
## 
##   Number of observations                           223
## 
## Model Test User Model:
##                                                       
##   Test statistic                              2501.954
##   Degrees of freedom                              1024
##   P-value (Chi-square)                           0.000
## 
## Model Test Baseline Model:
## 
##   Test statistic                             13350.303
##   Degrees of freedom                              1081
##   P-value                                        0.000
## 
## User Model versus Baseline Model:
## 
##   Comparative Fit Index (CFI)                    0.880
##   Tucker-Lewis Index (TLI)                       0.873
## 
## Loglikelihood and Information Criteria:
## 
##   Loglikelihood user model (H0)             -15454.903
##   Loglikelihood unrestricted model (H1)     -14203.926
##                                                       
##   Akaike (AIC)                               31117.805
##   Bayesian (BIC)                             31472.151
##   Sample-size adjusted Bayesian (SABIC)      31142.562
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.080
##   90 Percent confidence interval - lower         0.076
##   90 Percent confidence interval - upper         0.084
##   P-value H_0: RMSEA <= 0.050                    0.000
##   P-value H_0: RMSEA >= 0.080                    0.578
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.074
## 
## Parameter Estimates:
## 
##   Standard errors                             Standard
##   Information                                 Expected
##   Information saturated (h1) model          Structured
## 
## Latent Variables:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##   desapego =~                                                           
##     RPD01             1.000                               1.387    0.789
##     RPD02             1.209    0.081   14.866    0.000    1.677    0.861
##     RPD03             1.144    0.085   13.419    0.000    1.587    0.798
##     RPD05             1.313    0.086   15.317    0.000    1.822    0.879
##     RPD06             1.082    0.089   12.214    0.000    1.501    0.742
##     RPD07             1.229    0.085   14.487    0.000    1.705    0.845
##     RPD08             1.157    0.086   13.375    0.000    1.604    0.796
##     RPD09             1.315    0.087   15.163    0.000    1.824    0.873
##     RPD10             1.343    0.088   15.247    0.000    1.863    0.877
##   relajacion =~                                                         
##     RRE02             1.000                               1.275    0.850
##     RRE03             1.120    0.065   17.295    0.000    1.429    0.871
##     RRE04             1.021    0.058   17.625    0.000    1.301    0.880
##     RRE05             1.051    0.056   18.687    0.000    1.341    0.908
##     RRE06             1.246    0.074   16.924    0.000    1.588    0.861
##     RRE07             1.121    0.071   15.838    0.000    1.430    0.829
##     RRE10             0.814    0.067   12.134    0.000    1.038    0.698
##   dominio =~                                                            
##     RMA02             1.000                               1.407    0.729
##     RMA03             1.152    0.096   12.041    0.000    1.621    0.798
##     RMA04             1.178    0.089   13.265    0.000    1.658    0.873
##     RMA05             1.141    0.087   13.057    0.000    1.605    0.860
##     RMA06             0.648    0.075    8.625    0.000    0.911    0.581
##     RMA07             1.104    0.085   13.062    0.000    1.553    0.861
##     RMA08             1.110    0.085   13.001    0.000    1.561    0.857
##     RMA09             1.030    0.084   12.257    0.000    1.448    0.811
##     RMA10             1.056    0.088   12.047    0.000    1.486    0.798
##   control =~                                                            
##     RCO02             1.000                               1.632    0.855
##     RCO03             0.945    0.049   19.172    0.000    1.543    0.910
##     RCO04             0.794    0.044   18.100    0.000    1.295    0.884
##     RCO05             0.814    0.043   18.926    0.000    1.329    0.904
##     RCO06             0.837    0.045   18.407    0.000    1.365    0.892
##     RCO07             0.836    0.046   18.205    0.000    1.364    0.887
##   recuperacion =~                                                       
##     desapego          1.000                               0.711    0.711
##     relajacion        1.070    0.121    8.840    0.000    0.827    0.827
##     dominio           0.900    0.129    6.960    0.000    0.631    0.631
##     control           1.423    0.157    9.062    0.000    0.860    0.860
##   energia =~                                                            
##     EN01              1.000                               1.678    0.896
##     EN02              1.027    0.044   23.415    0.000    1.723    0.933
##     EN04              0.998    0.044   22.871    0.000    1.675    0.925
##     EN05              0.996    0.042   23.836    0.000    1.671    0.939
##     EN06              0.983    0.041   23.857    0.000    1.649    0.939
##     EN07              1.045    0.045   22.964    0.000    1.753    0.926
##     EN08              1.033    0.042   24.398    0.000    1.733    0.946
##   vigor =~                                                              
##     EVI01             1.000                               1.684    0.967
##     EVI02             0.985    0.028   35.282    0.000    1.659    0.962
##     EVI03             0.996    0.048   20.546    0.000    1.677    0.836
##   dedicacion =~                                                         
##     EDE01             1.000                               1.868    0.952
##     EDE02             0.907    0.034   26.376    0.000    1.695    0.922
##     EDE03             0.571    0.037   15.539    0.000    1.066    0.754
##   absorcion =~                                                          
##     EAB01             1.000                               1.607    0.917
##     EAB02             0.711    0.051   13.823    0.000    1.143    0.752
##     EAB03             0.735    0.063   11.600    0.000    1.181    0.671
##   engagement =~                                                         
##     vigor             1.000                               0.901    0.901
##     dedicacion        1.213    0.061   19.812    0.000    0.985    0.985
##     absorcion         0.958    0.059   16.370    0.000    0.904    0.904
## 
## Covariances:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##   recuperacion ~~                                                       
##     energia           1.365    0.197    6.933    0.000    0.825    0.825
##     engagement        0.892    0.152    5.883    0.000    0.597    0.597
##   energia ~~                                                            
##     engagement        1.619    0.223    7.273    0.000    0.636    0.636
## 
## Variances:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##    .RPD01             1.168    0.119    9.781    0.000    1.168    0.378
##    .RPD02             0.983    0.107    9.202    0.000    0.983    0.259
##    .RPD03             1.434    0.147    9.729    0.000    1.434    0.363
##    .RPD05             0.972    0.109    8.938    0.000    0.972    0.227
##    .RPD06             1.836    0.184    9.980    0.000    1.836    0.449
##    .RPD07             1.165    0.124    9.377    0.000    1.165    0.286
##    .RPD08             1.486    0.153    9.740    0.000    1.486    0.366
##    .RPD09             1.037    0.115    9.036    0.000    1.037    0.238
##    .RPD10             1.046    0.116    8.984    0.000    1.046    0.232
##    .RRE02             0.623    0.067    9.252    0.000    0.623    0.277
##    .RRE03             0.647    0.072    8.976    0.000    0.647    0.241
##    .RRE04             0.492    0.056    8.829    0.000    0.492    0.225
##    .RRE05             0.384    0.047    8.203    0.000    0.384    0.176
##    .RRE06             0.880    0.097    9.122    0.000    0.880    0.259
##    .RRE07             0.930    0.098    9.460    0.000    0.930    0.313
##    .RRE10             1.136    0.113   10.087    0.000    1.136    0.513
##    .RMA02             1.741    0.175    9.935    0.000    1.741    0.468
##    .RMA03             1.499    0.156    9.594    0.000    1.499    0.363
##    .RMA04             0.857    0.098    8.785    0.000    0.857    0.238
##    .RMA05             0.903    0.101    8.983    0.000    0.903    0.260
##    .RMA06             1.626    0.158   10.280    0.000    1.626    0.662
##    .RMA07             0.844    0.094    8.979    0.000    0.844    0.259
##    .RMA08             0.882    0.098    9.031    0.000    0.882    0.266
##    .RMA09             1.090    0.115    9.498    0.000    1.090    0.342
##    .RMA10             1.257    0.131    9.592    0.000    1.257    0.363
##    .RCO02             0.978    0.104    9.391    0.000    0.978    0.269
##    .RCO03             0.493    0.058    8.474    0.000    0.493    0.172
##    .RCO04             0.468    0.052    9.016    0.000    0.468    0.218
##    .RCO05             0.393    0.046    8.621    0.000    0.393    0.182
##    .RCO06             0.479    0.054    8.884    0.000    0.479    0.205
##    .RCO07             0.505    0.056    8.972    0.000    0.505    0.213
##    .EN01              0.696    0.072    9.660    0.000    0.696    0.198
##    .EN02              0.443    0.049    9.064    0.000    0.443    0.130
##    .EN04              0.473    0.051    9.236    0.000    0.473    0.144
##    .EN05              0.378    0.042    8.907    0.000    0.378    0.119
##    .EN06              0.366    0.041    8.899    0.000    0.366    0.119
##    .EN07              0.507    0.055    9.209    0.000    0.507    0.142
##    .EN08              0.353    0.041    8.658    0.000    0.353    0.105
##    .EVI01             0.199    0.039    5.047    0.000    0.199    0.065
##    .EVI02             0.224    0.040    5.620    0.000    0.224    0.075
##    .EVI03             1.213    0.124    9.773    0.000    1.213    0.301
##    .EDE01             0.363    0.065    5.605    0.000    0.363    0.094
##    .EDE02             0.506    0.067    7.567    0.000    0.506    0.150
##    .EDE03             0.864    0.087    9.921    0.000    0.864    0.432
##    .EAB01             0.490    0.103    4.767    0.000    0.490    0.159
##    .EAB02             1.003    0.109    9.186    0.000    1.003    0.434
##    .EAB03             1.706    0.176    9.719    0.000    1.706    0.550
##    .desapego          0.952    0.149    6.396    0.000    0.495    0.495
##    .relajacion        0.514    0.085    6.023    0.000    0.316    0.316
##    .dominio           1.191    0.200    5.956    0.000    0.602    0.602
##    .control           0.694    0.125    5.538    0.000    0.261    0.261
##     recuperacion      0.972    0.199    4.892    0.000    1.000    1.000
##     energia           2.816    0.327    8.605    0.000    1.000    1.000
##    .vigor             0.536    0.085    6.327    0.000    0.189    0.189
##    .dedicacion        0.102    0.090    1.142    0.253    0.029    0.029
##    .absorcion         0.472    0.112    4.233    0.000    0.183    0.183
##     engagement        2.301    0.284    8.092    0.000    1.000    1.000
lavaanPlot(
  model = fit4,
  coefs = TRUE,
  stand = TRUE,
  covs = FALSE,
  graph_options = list(rankdir = "TB")
)