# Instalar librerias
#install.packages("lavaan")
#install.packages("lavaanPlot")
library("lavaan")
library("lavaanPlot")
library("dplyr")
library("readxl")
Los modelos de ecuaciones estructurales (SEM) es una técnica de análisis de estadística multivariada, que permite analizar patrones complejos de relaciones entre variables, realizar comparaciones entre intragrupos, y validar modelos teóricos y empíricos.
Holzinger y Swineford realizaron examenes de habilidad mental a adolescentes de 7o y 8o grado de dos escuelas (Pasteur y Grand-White). La base de datos esta incluída como paquete en R, e incluye las siguientes columnas:
Visual
x1 : percepción visual
x2 : juego con cubos
x3 : juego con pastillas/espacial
Textual
x4 : comprensión de parrafos
x5 : completar oraciones
x6 : significado de palabras
Velocidad
x7 : sumas aceleradas
x8 : conteo acelerado
x9 : disciminación acelerada de mayusculas rectas y curvas.
Se busca identificar las relaciones entre las habilidades (variables latentes) visual, textual y velocidad.
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
##
modelo1 <- ' # Regresiones
# Variables latentes
visual =~ x1 + x2 + x3
textual =~ x4 + x5 + x6
velocidad =~ x7 + x8 + x9
# Varianzas y covarianzas
visual ~~ textual
textual ~~ velocidad
velocidad~~ visual
# Intercepto '
fit <- cfa(modelo1, df1)
summary(fit)
## lavaan 0.6.17 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
## textual ~~
## velocidad 0.173 0.049 3.518 0.000
## visual ~~
## velocidad 0.262 0.056 4.660 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(fit, coef=TRUE, cov= TRUE)
La base de datos contiene distintas mediciones sobre la democracia política e industrialización en países 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.
Democracia en el 60, 65 y la industria en el 60 Incluir variables latentes
df2 <- PoliticalDemocracy
modelo1 <- ' # Regresiones
Democracia65 ~ Democracia60 + Industrial
Democracia60 ~ Industrial
# Variables latentes
Democracia60 =~ y1 + y2 + y3 + y4
Democracia65 =~ y5 + y6 + y7 + y8
Industrial =~ x1 + x2 + x3
# Varianzas y Covarianzas
# Intercepto
'
fit <- cfa(modelo1, df2)
summary(fit)
## lavaan 0.6.17 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|)
## Democracia60 =~
## 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
## Democracia65 =~
## 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
## Industrial =~
## 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|)
## Democracia65 ~
## Democracia60 0.864 0.113 7.671 0.000
## Industrial 0.453 0.220 2.064 0.039
## Democracia60 ~
## Industrial 1.474 0.392 3.763 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
## .Democracia60 3.872 0.893 4.338 0.000
## .Democracia65 0.115 0.200 0.575 0.565
## Industrial 0.448 0.087 5.169 0.000
lavaanPlot(fit, coef = TRUE, cov = TRUE)
modelo2 <- ' # Regresiones
Industrial ~ Democracia60
# Variables latentes
Democracia60 =~ y1 + y2 + y3 + y4
Democracia65 =~ y5 + y6 + y7 + y8
Industrial =~ x1 + x2 + x3
# Varianzas y Covarianzas
# Intercepto
'
fit <- cfa(modelo2, df2)
summary(fit)
## lavaan 0.6.17 ended normally after 45 iterations
##
## Estimator ML
## Optimization method NLMINB
## Number of model parameters 24
##
## Number of observations 75
##
## Model Test User Model:
##
## Test statistic 76.467
## Degrees of freedom 42
## P-value (Chi-square) 0.001
##
## Parameter Estimates:
##
## Standard errors Standard
## Information Expected
## Information saturated (h1) model Structured
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|)
## Democracia60 =~
## y1 1.000
## y2 1.354 0.179 7.548 0.000
## y3 1.049 0.153 6.840 0.000
## y4 1.320 0.141 9.334 0.000
## Democracia65 =~
## y5 1.000
## y6 1.289 0.170 7.570 0.000
## y7 1.308 0.164 7.983 0.000
## y8 1.335 0.160 8.342 0.000
## Industrial =~
## x1 1.000
## x2 2.179 0.139 15.685 0.000
## x3 1.818 0.152 11.968 0.000
##
## Regressions:
## Estimate Std.Err z-value P(>|z|)
## Industrial ~
## Democracia60 0.155 0.036 4.330 0.000
##
## Covariances:
## Estimate Std.Err z-value P(>|z|)
## Democracia60 ~~
## Democracia65 4.405 0.904 4.872 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|)
## .y1 2.053 0.405 5.064 0.000
## .y2 6.694 1.207 5.546 0.000
## .y3 5.414 0.950 5.699 0.000
## .y4 2.817 0.593 4.749 0.000
## .y5 2.519 0.469 5.377 0.000
## .y6 4.216 0.783 5.382 0.000
## .y7 3.443 0.665 5.178 0.000
## .y8 2.880 0.584 4.928 0.000
## .x1 0.081 0.020 4.138 0.000
## .x2 0.121 0.071 1.701 0.089
## .x3 0.467 0.090 5.163 0.000
## Democracia60 4.734 1.081 4.381 0.000
## Democracia65 4.216 1.044 4.037 0.000
## .Industrial 0.336 0.067 5.045 0.000
lavaanPlot(fit, coef = TRUE, cov = TRUE)
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.
Las experiencias de recuperación se refieren a la medida en que un individuo percibe que las actividades que se realizan fuera del horario laboral le ayudarán a restaurar los recursos energéticos que le permitirán sortear efectivamente el estrés y las presiones laborales.
#install.packages("lavaan")
#install.packages("lavaanPlot")
#Latent Variable Analysis
library(lavaan)
library(lavaanPlot)
library(readxl)
df2 <- read_excel("Datos_SEM_Eng.xlsx")
summary(df2)
## 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
Diccionario Desapego RPD01 - Me olvidé del trabajo
RPD02 - No pensé en mi trabajo para nada
RPD03 - Me distancié de mi trabajo
RPD04 -Tuve un receso de las demandas del trabajo (eliminada)
RPD05 - Me desconecte completamente del trabajo
RPD06 - A propósito no hice, ni revisé nada de mi trabajo
RPD07 - Ni me acordé de mi trabajo
RPD08 - Con toda intención no hice nada sobre mi trabajo
RPD09 - Logré desligarme de mis responsabilidades laborales
RPD10 - Me deslinde de mis actividades laborales
Relajacion RRE01 - Me puse cómodo y me relajé (eliminada)
RRE02 - Hice actividades relajantes
RRE03 - Usé mi tiempo para relajarme
RRE04 - Me tomé tiempo para el esparcimiento
RRE05 - Usé mi tiempo para despejarme
RRE06 - Dediqué tiempo a mis pasatiempos favoritos
RRE07 - Realicé actividades que me destensaron
RRE08 - Bajé mi estrés relajándome (eliminada)
RRE09 - Me enfoque en mis hobbies (eliminada)
RRE10 - Mi atención estuvo en distraerme del trabajo
Dominio/Maestria RMA01 - Aprendí cosas nuevas (eliminada)
RMA02 - Busqué retos intelectuales
RMA03 - Hice cosas que me retaron
RMA04 - Hice algo que amplió mis horizontes
RMA05 - Hice algo que me reta a mejorar
RMA06 - Utilicé mi tiempo en actividades diferentes
RMA07 - Busqué ampliar mis perspectivas
RMA08 - Hice cosas diferentes que me enseñaron
RMA09 - Disfruté haciendo cosas novedosas
RMA10 - Salí de la rutina con actividades retadoras
Escala RCO01 - Sentí que podía decidir por mí mismo/a qué hacer (eliminada)
RCO02 - Decidí por mi mismo mi propio horario
RCO03 - Determiné por mí mismo como pasar mi tiempo
RCO04 - Me hice cargo de cosas en la forma que yo quería hacerlas
RCO05 - Elegí cómo usar mi tiempo
RCO06 - Elegí libremente cómo organizar mis actividades
RCO07 - Tomé la decisión sobre cuándo y cómo hago las actividades fuera del trabajo
RCO08 - Puedo organizar mis actividades fuera del trabajo con libertad (eliminada)
1-. Regresión (~) Variables que dependen de otras.
2-. Variables latentes (=~) No se observa, se infiere.
3-. Varianzas y covarianzas (~~) Relaciones entre variables latentes y observada.
4-. Intercepto (~1) Valor esperado cuando las demás variables son cero.
modelo3 <- ' # Regresiones
# Variables latentes
desapego =~ RPD01 + RPD02 + RPD03 + RPD05 + RPD06 + RPD07 + RPD08 + RPD09
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
# Varianzas y Covarianzas
# Intercepto'
fit2 <- cfa(modelo3, df2)
summary(fit2)
## lavaan 0.6.17 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 1093.666
## 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.230 0.079 15.509 0.000
## RPD03 1.148 0.084 13.690 0.000
## RPD05 1.315 0.084 15.639 0.000
## RPD06 1.067 0.088 12.160 0.000
## RPD07 1.243 0.083 14.976 0.000
## RPD08 1.137 0.086 13.276 0.000
## RPD09 1.245 0.087 14.293 0.000
## relajacion =~
## RRE02 1.000
## RRE03 1.120 0.065 17.225 0.000
## RRE04 1.025 0.058 17.704 0.000
## RRE05 1.055 0.056 18.757 0.000
## RRE06 1.246 0.074 16.875 0.000
## RRE07 1.117 0.071 15.692 0.000
## RRE10 0.814 0.067 12.110 0.000
## dominio =~
## RMA02 1.000
## RMA03 1.155 0.096 12.075 0.000
## RMA04 1.179 0.089 13.271 0.000
## RMA05 1.141 0.087 13.069 0.000
## RMA06 0.646 0.075 8.599 0.000
## RMA07 1.103 0.084 13.060 0.000
## RMA08 1.109 0.085 12.992 0.000
## RMA09 1.028 0.084 12.247 0.000
## RMA10 1.056 0.088 12.043 0.000
## control =~
## RCO02 1.000
## RCO03 0.948 0.049 19.187 0.000
## RCO04 0.796 0.044 18.109 0.000
## RCO05 0.818 0.043 18.991 0.000
## RCO06 0.834 0.046 18.217 0.000
## RCO07 0.835 0.046 18.057 0.000
## recuperacion =~
## desapego 1.000
## relajacion 1.160 0.135 8.620 0.000
## dominio 0.872 0.132 6.612 0.000
## control 1.361 0.161 8.471 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|)
## .RPD01 1.139 0.118 9.622 0.000
## .RPD02 0.841 0.097 8.627 0.000
## .RPD03 1.379 0.145 9.539 0.000
## .RPD05 0.912 0.107 8.520 0.000
## .RPD06 1.866 0.188 9.909 0.000
## .RPD07 1.054 0.117 8.987 0.000
## .RPD08 1.535 0.159 9.660 0.000
## .RPD09 1.339 0.144 9.320 0.000
## .RRE02 0.626 0.068 9.271 0.000
## .RRE03 0.653 0.073 9.009 0.000
## .RRE04 0.481 0.055 8.794 0.000
## .RRE05 0.374 0.046 8.147 0.000
## .RRE06 0.885 0.097 9.143 0.000
## .RRE07 0.950 0.100 9.502 0.000
## .RRE10 1.138 0.113 10.093 0.000
## .RMA02 1.741 0.175 9.932 0.000
## .RMA03 1.486 0.155 9.576 0.000
## .RMA04 0.856 0.098 8.773 0.000
## .RMA05 0.899 0.100 8.968 0.000
## .RMA06 1.631 0.159 10.281 0.000
## .RMA07 0.845 0.094 8.976 0.000
## .RMA08 0.886 0.098 9.034 0.000
## .RMA09 1.093 0.115 9.499 0.000
## .RMA10 1.259 0.131 9.590 0.000
## .RCO02 0.983 0.105 9.379 0.000
## .RCO03 0.484 0.058 8.389 0.000
## .RCO04 0.462 0.052 8.964 0.000
## .RCO05 0.382 0.045 8.513 0.000
## .RCO06 0.494 0.055 8.916 0.000
## .RCO07 0.516 0.057 8.986 0.000
## .desapego 1.000 0.159 6.294 0.000
## .relajacion 0.341 0.090 3.775 0.000
## .dominio 1.255 0.212 5.933 0.000
## .control 0.891 0.160 5.568 0.000
## recuperacion 0.953 0.201 4.741 0.000
lavaanPlot(fit2, coef = TRUE, cov = TRUE)
Para depurar se eliminan variables con un p-value menor a .05, en este caso todas son 0 por lo que se eliminaran las variables más bajas en estimate. Otro criterio para decidir es comparar el error estandar al modificar el modelo.
modelo1.2 <-
' # Regresiones
# Variables latentes
desapego =~ RPD01 + RPD02 + RPD03 + RPD05 + RPD07 + RPD08 + RPD09
relajacion =~ RRE02 + RRE03 + RRE04 + RRE05 + RRE06 + RRE07
dominio =~ RMA02 + RMA03 + RMA05 + RMA07 + RMA08 + RMA09 + RMA10
control =~ RCO02 + RCO03 +RCO04 + RCO05 + RCO06 + RCO07
recuperacion =~ desapego + relajacion + dominio + control
# Varianzas y Covarianzas
# Intercepto '
fit1.2 <- cfa(modelo1.2, df2)
summary(fit1.2)
## lavaan 0.6.17 ended normally after 45 iterations
##
## Estimator ML
## Optimization method NLMINB
## Number of model parameters 56
##
## Number of observations 223
##
## Model Test User Model:
##
## Test statistic 765.606
## Degrees of freedom 295
## 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.229 0.077 15.969 0.000
## RPD03 1.150 0.082 14.083 0.000
## RPD05 1.313 0.082 16.080 0.000
## RPD07 1.233 0.081 15.219 0.000
## RPD08 1.079 0.085 12.683 0.000
## RPD09 1.223 0.085 14.312 0.000
## relajacion =~
## RRE02 1.000
## RRE03 1.112 0.064 17.277 0.000
## RRE04 1.024 0.057 17.970 0.000
## RRE05 1.054 0.055 19.065 0.000
## RRE06 1.236 0.073 16.894 0.000
## RRE07 1.104 0.071 15.609 0.000
## dominio =~
## RMA02 1.000
## RMA03 1.152 0.094 12.302 0.000
## RMA05 1.130 0.085 13.226 0.000
## RMA07 1.077 0.083 13.015 0.000
## RMA08 1.088 0.084 13.025 0.000
## RMA09 1.006 0.082 12.214 0.000
## RMA10 1.058 0.086 12.324 0.000
## control =~
## RCO02 1.000
## RCO03 0.948 0.049 19.192 0.000
## RCO04 0.796 0.044 18.117 0.000
## RCO05 0.818 0.043 19.001 0.000
## RCO06 0.834 0.046 18.214 0.000
## RCO07 0.834 0.046 18.052 0.000
## recuperacion =~
## desapego 1.000
## relajacion 1.152 0.136 8.502 0.000
## dominio 0.864 0.134 6.466 0.000
## control 1.371 0.163 8.386 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|)
## .RPD01 1.101 0.116 9.526 0.000
## .RPD02 0.786 0.094 8.355 0.000
## .RPD03 1.318 0.140 9.417 0.000
## .RPD05 0.857 0.104 8.251 0.000
## .RPD07 1.048 0.118 8.900 0.000
## .RPD08 1.740 0.178 9.799 0.000
## .RPD09 1.389 0.149 9.333 0.000
## .RRE02 0.611 0.067 9.172 0.000
## .RRE03 0.663 0.074 8.974 0.000
## .RRE04 0.468 0.054 8.652 0.000
## .RRE05 0.360 0.045 7.924 0.000
## .RRE06 0.901 0.099 9.121 0.000
## .RRE07 0.976 0.103 9.503 0.000
## .RMA02 1.690 0.174 9.729 0.000
## .RMA03 1.432 0.155 9.252 0.000
## .RMA05 0.887 0.104 8.523 0.000
## .RMA07 0.900 0.103 8.737 0.000
## .RMA08 0.915 0.105 8.727 0.000
## .RMA09 1.133 0.122 9.300 0.000
## .RMA10 1.194 0.129 9.240 0.000
## .RCO02 0.982 0.105 9.377 0.000
## .RCO03 0.484 0.058 8.387 0.000
## .RCO04 0.462 0.052 8.961 0.000
## .RCO05 0.381 0.045 8.508 0.000
## .RCO06 0.494 0.055 8.918 0.000
## .RCO07 0.516 0.057 8.988 0.000
## .desapego 1.041 0.164 6.361 0.000
## .relajacion 0.377 0.095 3.972 0.000
## .dominio 1.321 0.221 5.991 0.000
## .control 0.872 0.162 5.377 0.000
## recuperacion 0.950 0.202 4.698 0.000
lavaanPlot(fit1.2, coef = TRUE, cov = TRUE)
Energía EN01 - Siento que pude cargarme de energía. (eliminated)
EN02 - Considero que me siento completamente recuperado
EN03 - Siento con la energía suficiente para un nuevo día
EN04 - Me siento renovado/a
EN05 - Logré recuperar mi energía
EN06 - Pude descansar lo suficiente para re-energetizarme
EN07 - Me siento como nuevo/a
EN08 - Recuperé mis niveles de energía para trabajar
EN09 - Me siento reconstituido después de alejarme del trabajo(eliminated)
EN10 - Cada día es una nueva oportunidad para empezar (eliminated)
modelo2 <- ' # Regresiones
# Variables latentes
energia =~ EN01 + EN02 +EN04 +EN05 + EN06 + EN07 + EN08
# Varianzas y Covarianzas
# Intercepto'
fit <- cfa(modelo2, df2)
summary(fit)
## lavaan 0.6.17 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|)
## .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
## energia 2.801 0.327 8.565 0.000
lavaanPlot(fit, coef = TRUE, cov = TRUE)
modelo3 <-
' # Regresiones
#Variables latentes 1
desapego =~ RPD01 + RPD02 + RPD03 + RPD05 + RPD06 + RPD07 + RPD08 + RPD09
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
#Variables latentes 2
energia =~ EN01 + EN02 +EN04 +EN05 + EN06 + EN07 + EN08
# Variables latentes 3
vigor =~ EVI01 + EVI02 + EVI03
dedicacion=~ EDE01 + EDE02 + EDE03
absorcion =~ EAB01 + EAB02
engagement =~ vigor + dedicacion + absorcion
#Relaciones de variables
# Varianzas y Covarianzas
engagement ~~ energia + recuperacion
# Intercepto'
fit3 <- sem(modelo3, df2)
summary(fit3)
## lavaan 0.6.17 ended normally after 73 iterations
##
## Estimator ML
## Optimization method NLMINB
## Number of model parameters 100
##
## Number of observations 223
##
## Model Test User Model:
##
## Test statistic 2247.010
## Degrees of freedom 935
## 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.232 0.079 15.583 0.000
## RPD03 1.148 0.084 13.720 0.000
## RPD05 1.317 0.084 15.698 0.000
## RPD06 1.061 0.088 12.085 0.000
## RPD07 1.243 0.083 15.001 0.000
## RPD08 1.129 0.086 13.177 0.000
## RPD09 1.244 0.087 14.296 0.000
## relajacion =~
## RRE02 1.000
## RRE03 1.120 0.065 17.300 0.000
## RRE04 1.020 0.058 17.624 0.000
## RRE05 1.051 0.056 18.690 0.000
## RRE06 1.245 0.074 16.926 0.000
## RRE07 1.121 0.071 15.839 0.000
## RRE10 0.814 0.067 12.129 0.000
## dominio =~
## RMA02 1.000
## RMA03 1.152 0.096 12.037 0.000
## RMA04 1.179 0.089 13.263 0.000
## RMA05 1.141 0.087 13.056 0.000
## RMA06 0.648 0.075 8.626 0.000
## RMA07 1.104 0.085 13.061 0.000
## RMA08 1.110 0.085 13.000 0.000
## RMA09 1.030 0.084 12.257 0.000
## RMA10 1.056 0.088 12.046 0.000
## control =~
## RCO02 1.000
## RCO03 0.945 0.049 19.175 0.000
## RCO04 0.794 0.044 18.100 0.000
## RCO05 0.814 0.043 18.924 0.000
## RCO06 0.837 0.045 18.415 0.000
## RCO07 0.836 0.046 18.207 0.000
## recuperacion =~
## desapego 1.000
## relajacion 1.073 0.123 8.726 0.000
## dominio 0.908 0.131 6.918 0.000
## control 1.434 0.160 8.964 0.000
## energia =~
## EN01 1.000
## EN02 1.027 0.044 23.423 0.000
## EN04 0.998 0.044 22.879 0.000
## EN05 0.996 0.042 23.843 0.000
## EN06 0.982 0.041 23.863 0.000
## EN07 1.044 0.045 22.972 0.000
## EN08 1.033 0.042 24.405 0.000
## vigor =~
## EVI01 1.000
## EVI02 0.985 0.028 35.255 0.000
## EVI03 0.996 0.048 20.570 0.000
## dedicacion =~
## EDE01 1.000
## EDE02 0.905 0.034 26.514 0.000
## EDE03 0.567 0.037 15.447 0.000
## absorcion =~
## EAB01 1.000
## EAB02 0.656 0.053 12.367 0.000
## engagement =~
## vigor 1.000
## dedicacion 1.216 0.061 20.023 0.000
## absorcion 0.984 0.057 17.204 0.000
##
## Covariances:
## Estimate Std.Err z-value P(>|z|)
## energia ~~
## engagement 1.616 0.222 7.270 0.000
## recuperacion ~~
## engagement 0.886 0.151 5.857 0.000
## energia 1.362 0.197 6.899 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|)
## .RPD01 1.138 0.118 9.627 0.000
## .RPD02 0.826 0.096 8.595 0.000
## .RPD03 1.374 0.144 9.540 0.000
## .RPD05 0.900 0.106 8.498 0.000
## .RPD06 1.890 0.190 9.929 0.000
## .RPD07 1.051 0.117 8.992 0.000
## .RPD08 1.566 0.162 9.696 0.000
## .RPD09 1.342 0.144 9.333 0.000
## .RRE02 0.623 0.067 9.250 0.000
## .RRE03 0.647 0.072 8.973 0.000
## .RRE04 0.492 0.056 8.828 0.000
## .RRE05 0.384 0.047 8.198 0.000
## .RRE06 0.880 0.097 9.120 0.000
## .RRE07 0.930 0.098 9.458 0.000
## .RRE10 1.137 0.113 10.087 0.000
## .RMA02 1.742 0.175 9.935 0.000
## .RMA03 1.500 0.156 9.595 0.000
## .RMA04 0.857 0.098 8.786 0.000
## .RMA05 0.903 0.101 8.983 0.000
## .RMA06 1.626 0.158 10.280 0.000
## .RMA07 0.843 0.094 8.979 0.000
## .RMA08 0.881 0.098 9.031 0.000
## .RMA09 1.089 0.115 9.497 0.000
## .RMA10 1.256 0.131 9.591 0.000
## .RCO02 0.977 0.104 9.390 0.000
## .RCO03 0.493 0.058 8.474 0.000
## .RCO04 0.468 0.052 9.017 0.000
## .RCO05 0.393 0.046 8.622 0.000
## .RCO06 0.479 0.054 8.881 0.000
## .RCO07 0.505 0.056 8.972 0.000
## .EN01 0.695 0.072 9.659 0.000
## .EN02 0.443 0.049 9.064 0.000
## .EN04 0.472 0.051 9.236 0.000
## .EN05 0.378 0.042 8.909 0.000
## .EN06 0.366 0.041 8.901 0.000
## .EN07 0.507 0.055 9.209 0.000
## .EN08 0.354 0.041 8.660 0.000
## .EVI01 0.199 0.039 5.056 0.000
## .EVI02 0.224 0.040 5.638 0.000
## .EVI03 1.211 0.124 9.770 0.000
## .EDE01 0.352 0.064 5.528 0.000
## .EDE02 0.509 0.067 7.644 0.000
## .EDE03 0.874 0.088 9.945 0.000
## .EAB01 0.379 0.128 2.951 0.003
## .EAB02 1.149 0.121 9.491 0.000
## .desapego 0.997 0.154 6.459 0.000
## .relajacion 0.524 0.086 6.064 0.000
## .dominio 1.189 0.200 5.953 0.000
## .control 0.693 0.126 5.517 0.000
## recuperacion 0.958 0.198 4.831 0.000
## energia 2.817 0.327 8.606 0.000
## .vigor 0.536 0.084 6.408 0.000
## .dedicacion 0.100 0.088 1.137 0.255
## .absorcion 0.469 0.138 3.393 0.001
## engagement 2.301 0.284 8.100 0.000
lavaanPlot(fit3, coef = TRUE, cov = TRUE)