Los Modelos de Ecuaciones Estructurales son una técnica de análisis de estadística multivariada, que permite analizar patrones complejos de relaciones entre variables, realizar comparaciones entre e intragrupos, y validar modelos teóricos y empíricos.
Holzinger y Swineford realizaron exámenes de habilidad mental a adolescentes de 7° y 8° de dos escuelas (Pasteur y Grand-White).
La base de datos está incluida como paquete en R, e incluye las siguientes columnas:
• sex: Género (1=male, 2=female) • x1: Percepción visual • x2: Juego con cubos • x3: Juego con pastillas/espacial • x4: Comprensión de párrafos • x5: Completar oraciones • x6: Significado de palabras • x7: Sumas aceleradas • x8: Conto acelerado de puntos • x9: Discriminación acelerada de mayúsculas rectas y curvas
Se busca identificar las relaciones entre las habilidades visual (x1, x2, x3), textual (x4, x5, x6) y velocidad (x7,x8,x9) de los adolescentes.
#install.packages("lavaan")
library(lavaan)
#install.packages("lavaanPlot")
library(lavaanPlot)
# lavaan significa Latent variable analysis
library(readxl)
df1 <- HolzingerSwineford1939
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 ...
1.Regresión (~) Variable que depende de otras. 2.Variables latentes
(=~) No se observa, se infiere.
3.Varianzas y covarianzas () Relaciones entre variables
latentes y observada (Varianza entre sí misma, Covarianza entre
otras).
4.Intercepto (~1) Valor esperado cuando las demás variables son
cero.
modelo <- ’ # Regresiones
# Variables latentes
# Varianzas y covarianzas
# Intercepto
'
modelo1 <- ' # Regresiones
# Variables latentes
visual =~ x1 + x2 + x3
textual =~ x4 + x5 + x6
velocidad =~ x7+ x8 + x9
# Varianzas y covarianzas
# Intercepto
'
fit1 <- cfa(modelo1, df1)
summary(fit1)
## lavaan 0.7-2 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|)
## .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
## 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
lavaanPlot(fit1, coef=TRUE, cov=TRUE)
fit11 <- sem(modelo1, df1)
summary(fit11)
## lavaan 0.7-2 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|)
## .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
## 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
lavaanPlot(fit11, coef=TRUE, cov=TRUE)
La base de datos contiene distintas mediciones sobre la democracia
política e industrializacion en países de desarrollo durante 1960 y
1965.
La tabla incliye los siguientes datos:
• y1: Calificaciones sobre la libertad de prensa en 1960 • y2: Libertad de la oposición politica en 1960 • y3: Imparcialidad de elecciones en 1960 • y4: Eficacia de la legislatura electa en 1960 • y5: Calificaciones sobre la libertad de prensa en 1965 • y6: Libertad de la oposición politica 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 energia inanimada pero cápita en 1960 • x3: Porcentaje de la fuerza laboral en la industria en 1960
df7 <- PoliticalDemocracy
summary(df7)
## 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(df7)
## '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 ...
modelo2 <- ' # Regresiones
# Variables latentes
democracia1960 =~ y1 + y2 + y3 + y4
democracia1965 =~ y5 + y6 + y7 + y8
industria1960 =~ x1 + x2 + x3
# Varianzas y covarianzas
democracia1960 ~ industria1960
democracia1965 ~ industria1960 + democracia1960
'
fit2 <- sem(modelo2, data = PoliticalDemocracy) # o data = df7 si ya la renombraste igual
summary(fit2)
## lavaan 0.7-2 ended normally after 42 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|)
## democracia1960 =~
## 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
## democracia1965 =~
## 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
## industria1960 =~
## x1 1.000
## x2 2.182 0.139 15.714 0.000
## x3 1.819 0.152 11.956 0.000
##
## Regressions:
## Estimate Std.Err z-value P(>|z|)
## democracia1960 ~
## industria1960 1.474 0.392 3.763 0.000
## democracia1965 ~
## industria1960 0.453 0.220 2.064 0.039
## democracia1960 0.864 0.113 7.671 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|)
## .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
## .democracia1960 3.872 0.893 4.338 0.000
## .democracia1965 0.115 0.200 0.575 0.565
## industria1960 0.448 0.087 5.169 0.000
lavaanPlot(fit2, coef = TRUE, cov = TRUE)
La democracia cuenta con 8 derechos y libertades políticas:
En el libro “Why Nations Fail?” los autores concluyen que son las instituciones del país las que determinan el éxito o el fracaso.
#file.choose()
df8 <- read_excel("/Users/carlalievanoespinosa/Desktop/business analytics/8vo semestre/Datos_SEM_Eng.xlsx")
summary(df8)
## 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(df8)
## 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 ...
Uno de los retos más importantes de las organizaciones es entender el estado y bienestar de los colaboradores, ya que puede impactar directamente en el desempeño y el logro de los objetivos.
names(df8) <- trimws(names(df8))
modelo3 <- ' # Regresiones
# Variables latentes
desapego =~ RPD01 + RPD02 + RPD03 + RPD05 + RPD06 + RPD07 + RPD08 + RPD09 + RPD10
relajacion =~ RRE02 + RRE03 + RRE04 + RRE05 + RRE06 + RRE07 + RRE10
control =~ RCO02 + RCO03 + RCO04 + RCO05 + RCO06 + RCO07
dominio =~ RMA02 + RMA03 + RMA04 + RMA05 + RMA06 + RMA07 + RMA08 + RMA09 + RMA10
# Varianzas y covarianzas
# Intercepto
'
fit3 <- sem(modelo3, df8)
summary(fit3)
## lavaan 0.7-2 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
##
## 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.204 0.081 14.786 0.000
## RPD03 1.143 0.085 13.420 0.000
## RPD05 1.310 0.086 15.269 0.000
## RPD06 1.086 0.088 12.282 0.000
## RPD07 1.227 0.085 14.451 0.000
## RPD08 1.163 0.086 13.487 0.000
## RPD09 1.315 0.087 15.175 0.000
## RPD10 1.345 0.088 15.290 0.000
## relajacion =~
## RRE02 1.000
## RRE03 1.120 0.065 17.268 0.000
## RRE04 1.024 0.058 17.732 0.000
## RRE05 1.055 0.056 18.798 0.000
## RRE06 1.243 0.074 16.857 0.000
## RRE07 1.115 0.071 15.687 0.000
## RRE10 0.815 0.067 12.135 0.000
## control =~
## RCO02 1.000
## RCO03 0.948 0.049 19.230 0.000
## RCO04 0.795 0.044 18.125 0.000
## RCO05 0.817 0.043 18.981 0.000
## RCO06 0.834 0.046 18.247 0.000
## RCO07 0.834 0.046 18.078 0.000
## dominio =~
## RMA02 1.000
## RMA03 1.155 0.096 12.060 0.000
## RMA04 1.179 0.089 13.267 0.000
## RMA05 1.141 0.087 13.049 0.000
## RMA06 0.647 0.075 8.618 0.000
## RMA07 1.104 0.085 13.050 0.000
## RMA08 1.109 0.085 12.985 0.000
## RMA09 1.030 0.084 12.251 0.000
## RMA10 1.056 0.088 12.039 0.000
##
## Covariances:
## Estimate Std.Err z-value P(>|z|)
## desapego ~~
## relajacion 1.155 0.164 7.023 0.000
## control 1.319 0.200 6.584 0.000
## dominio 0.696 0.155 4.477 0.000
## relajacion ~~
## control 1.483 0.195 7.610 0.000
## dominio 0.969 0.159 6.085 0.000
## control ~~
## dominio 1.221 0.202 6.047 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|)
## .RPD01 1.168 0.119 9.778 0.000
## .RPD02 1.005 0.109 9.240 0.000
## .RPD03 1.434 0.147 9.728 0.000
## .RPD05 0.989 0.110 8.969 0.000
## .RPD06 1.817 0.182 9.968 0.000
## .RPD07 1.177 0.125 9.391 0.000
## .RPD08 1.454 0.150 9.710 0.000
## .RPD09 1.035 0.115 9.028 0.000
## .RPD10 1.033 0.115 8.956 0.000
## .RRE02 0.624 0.067 9.269 0.000
## .RRE03 0.651 0.072 9.005 0.000
## .RRE04 0.481 0.055 8.798 0.000
## .RRE05 0.373 0.046 8.147 0.000
## .RRE06 0.891 0.097 9.162 0.000
## .RRE07 0.953 0.100 9.511 0.000
## .RRE10 1.136 0.113 10.092 0.000
## .RCO02 0.980 0.105 9.375 0.000
## .RCO03 0.482 0.057 8.379 0.000
## .RCO04 0.463 0.052 8.967 0.000
## .RCO05 0.385 0.045 8.536 0.000
## .RCO06 0.493 0.055 8.915 0.000
## .RCO07 0.516 0.057 8.987 0.000
## .RMA02 1.742 0.175 9.934 0.000
## .RMA03 1.489 0.155 9.581 0.000
## .RMA04 0.854 0.097 8.772 0.000
## .RMA05 0.904 0.101 8.981 0.000
## .RMA06 1.627 0.158 10.279 0.000
## .RMA07 0.846 0.094 8.980 0.000
## .RMA08 0.885 0.098 9.035 0.000
## .RMA09 1.090 0.115 9.496 0.000
## .RMA10 1.258 0.131 9.590 0.000
## desapego 1.925 0.275 7.002 0.000
## relajacion 1.625 0.207 7.845 0.000
## control 2.660 0.335 7.930 0.000
## dominio 1.978 0.317 6.241 0.000
lavaanPlot(fit3, coef = TRUE, cov = TRUE)
modelo4 <- ' # Regresiones
# Variables latentes
energía =~ EN01 + EN02 + EN04 + EN05 + EN06 + EN07 + EN08
# Varianzas y covarianzas
# Intercepto
'
fit4 <- sem(modelo4, df8) # ponemos el modelo y los datos
summary(fit4)
## lavaan 0.7-2 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|)
## energía =~
## 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|)
## .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
## energía 2.801 0.327 8.565 0.000
lavaanPlot(fit4, coef = TRUE, cov = TRUE)
modelo5 <- ' # Regresiones
# Variables latentes
vigor =~ EVI01 + EVI02 + EVI03
dedicación =~ EDE01 + EDE02 + EDE03
absorcion de trabajo =~ EAB01+ EAB02
# Varianzas y covarianzas
# Intercepto
'
fit5 <- sem(modelo5, df8) # ponemos el modelo y los datos
## Warning: lavaan->lav_parse_check_relational():
## having identifiers with spaces ('absorcion de trabajo') is deprecated at
## line 6, pos 16
## absorcion de trabajo =~ EAB01+ EAB02
## ^
## Warning: lavaan->lav_parse_check_relational():
## having identifiers with spaces ('absorcion de trabajo') is deprecated at
## line 6, pos 16
## absorcion de trabajo =~ EAB01+ EAB02
## ^
summary(fit5)
## lavaan 0.7-2 ended normally after 44 iterations
##
## Estimator ML
## Optimization method NLMINB
## Number of model parameters 19
##
## Number of observations 223
##
## Model Test User Model:
##
## Test statistic 203.167
## Degrees of freedom 17
## 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|)
## vigor =~
## EVI01 1.000
## EVI02 0.986 0.028 35.155 0.000
## EVI03 0.995 0.049 20.476 0.000
## dedicación =~
## EDE01 1.000
## EDE02 0.912 0.035 26.335 0.000
## EDE03 0.578 0.037 15.767 0.000
## absorcion de trabajo =~
## EAB01 1.000
## EAB02 0.658 0.053 12.526 0.000
##
## Covariances:
## Estimate Std.Err z-value P(>|z|)
## vigor ~~
## dedicación 2.763 0.293 9.419 0.000
## absorcion de trabajo 2.184 0.250 8.730 0.000
## dedicación ~~
## absorcion de trabajo 2.796 0.296 9.439 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|)
## .EVI01 0.200 0.040 4.964 0.000
## .EVI02 0.221 0.040 5.455 0.000
## .EVI03 1.218 0.125 9.770 0.000
## .EDE01 0.388 0.065 6.004 0.000
## .EDE02 0.498 0.066 7.599 0.000
## .EDE03 0.844 0.085 9.903 0.000
## .EAB01 0.387 0.124 3.118 0.002
## .EAB02 1.145 0.120 9.543 0.000
## vigor 2.836 0.289 9.810 0.000
## dedicación 3.465 0.367 9.443 0.000
## absorcion de trabajo 2.686 0.312 8.606 0.000
lavaanPlot(fit5, coef = TRUE, cov = TRUE) # le ponemos que nos muestro coeficientes y covarianzas
fitMeasures(fit1, c("chisq", "df", "pvalue", "cfi", "tli", "rmsea", "srmr")) # experiencias de recuperación
## chisq df pvalue cfi tli rmsea srmr
## 85.306 24.000 0.000 0.931 0.896 0.092 0.065
fitMeasures(fit2, c("chisq", "df", "pvalue", "cfi", "tli", "rmsea", "srmr")) # energía recuperada
## chisq df pvalue cfi tli rmsea srmr
## 72.462 41.000 0.002 0.953 0.938 0.101 0.055
fitMeasures(fit3, c("chisq", "df", "pvalue", "cfi", "tli", "rmsea", "srmr")) # engagement laboral
## chisq df pvalue cfi tli rmsea srmr
## 1215.404 428.000 0.000 0.888 0.879 0.091 0.071
Los tres modelos de medición mostraron cargas factoriales sólidas y significativas, es decir, los ítems sí reflejan bien los conceptos que se buscaba medir (experiencias de recuperación, energía recuperada y engagement laboral); sin embargo, los índices de ajuste global fueron solo aceptables y, en el caso del engagement laboral, más débiles de lo esperado, lo que sugiere que ese constructo (compuesto por vigor, dedicación y absorción) no quedó representado de forma tan precisa como los otros dos, probablemente por el tamaño de muestra reducido (75 colaboradores) en relación con la cantidad de ítems evaluados. En términos prácticos, esto significa que aunque los datos apoyan de manera razonable la idea de que las experiencias de recuperación (desapego, relajación, dominio y control sobre el tiempo libre) y la energía recuperada son constructos bien definidos y medibles, los resultados sobre cómo estas dos variables afectan finalmente el compromiso laboral de los colaboradores deben interpretarse con cautela, y sería recomendable depurar el modelo de engagement o ampliar la muestra en futuros estudios para obtener conclusiones más robustas sobre el bienestar laboral en la organización.