Victor Manuel Muñoz Tirado - A01423434
Los Modelos de Ecuaciones Estructurales (Sem) es una técnica de análisis de estadística multivariada, que permite analizar paterones 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 esta incluida como paquete en R e incluye las siguientes variables y columnas:
id: identificador
sex: género (1 Hombre, 2 Mujer)
ageyr: años
agemo: meses
school: escuela
grade: grado
x1: percepción visual
x2: juego con cubos
x3: juego con pastillas / espaciales
x4: comprension de párrafos
x5: completar oraciones
x6: significados de palabras
x7: sumas aceleradas
x8: conteo acelerado de puntos
x9: discriminacion acelerada de mayusculas 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.
library(lavaan)
library(lavaanPlot)
#lavaan = Latent variable analysis (no se observa, se infiere)
df1 <- HolzingerSwineford1939
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 ...
colSums(is.na(df1))
## id sex ageyr agemo school grade x1 x2 x3 x4 x5
## 0 0 0 0 0 1 0 0 0 0 0
## x6 x7 x8 x9
## 0 0 0 0
modelo1 <- ' # Regresiones
# Variables latentes
visual =~ x1 + x2 + x3
textual =~ x4 + x5 + x6
velocidad =~ x7 + x8 + x9
# Varianzas y covarianzas
# 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
## 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(fit, coef=TRUE, cov=TRUE)
La base de datos contiene distintas mediciones sobre la democracia política e industralización en paises en desarrollo durante 1960 y 1965.
La tabla inluye los siguientes datos:
y1: calificaciones de libertad en 1960
y2: libertad de la oposcion política 1960
y3: imparcialidad de elecciones 1960
y4: eficacia de la legislatura en 1960
y5: calificaciones de libertad en 1965
y6: libertad de la oposcion política 1965
y7: imparcialidad de elecciones 1965
y8: eficacia de la legislatura en 1965
x1: PIB per cápita en 1960
x2: consumo de energia inanimada per cápita 1960
x3: porcentaje de la fuerza laboral en la industria 1960
df2 <- PoliticalDemocracy
modelo2 <- ' # Regresiones
Politica1965 ~ Politica1960 + Economia1960
Politica1960 ~ Economia1960
# Variables latentes
Politica1965 =~ y5 + y6 + y7 + y8
Politica1960 =~ y1 + y2 + y3 + y4
Economia1960 =~ x1 + x2 + x3
# Varianzas y covarianzas
# Intercepto7
'
fit2 <- cfa(modelo2, df2)
summary(fit2)
## 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|)
## Politica1965 =~
## 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
## Politica1960 =~
## 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
## Economia1960 =~
## 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|)
## Politica1965 ~
## Politica1960 0.864 0.113 7.671 0.000
## Economia1960 0.453 0.220 2.064 0.039
## Politica1960 ~
## Economia1960 1.474 0.392 3.763 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|)
## .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
## .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
## .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
## .Politica1965 0.115 0.200 0.575 0.565
## .Politica1960 3.872 0.893 4.338 0.000
## Economia1960 0.448 0.087 5.169 0.000
lavaanPlot(fit2, 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.
library(lavaan)
library(lavaanPlot)
library(readxl)
df <- read_xlsx("Datos_SEM_Eng.xlsx")
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
modelo1 <- ' # Regresiones
# Variables latentes
desapego =~ RPD01 + RPD02 + RPD03 + RPD05 + RPD06 + RPD07 + RPD08 + RPD09 + RPD10
relajación =~ RRE02 + RRE03 + RRE04 + RRE05 + RRE06 + RRE07 + RRE10
maestria =~ RMA02 + RMA03 + RMA04 + RMA05 + RMA06 + RMA07 + RMA08 + RMA09 + RMA10
control =~ RCO02 + RCO03 + RCO04 + RCO05 + RCO06 + RCO07
recuperación =~ desapego + relajación + maestria + control
# Varianzas y covarianzas
# Intercepto
'
fit <- cfa(modelo1, df)
summary(fit)
## lavaan 0.6.17 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
##
## Parameter Estimates:
##
## Standard errors Standard
## Information Expected
## Information saturated (h1) model Structured
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|)
## desapego =~
## RPD01 1.000
## RPD02 1.206 0.082 14.780 0.000
## RPD03 1.143 0.085 13.374 0.000
## RPD05 1.312 0.086 15.244 0.000
## RPD06 1.088 0.089 12.266 0.000
## RPD07 1.229 0.085 14.440 0.000
## RPD08 1.164 0.087 13.447 0.000
## RPD09 1.317 0.087 15.153 0.000
## RPD10 1.346 0.088 15.258 0.000
## relajación =~
## RRE02 1.000
## RRE03 1.120 0.065 17.227 0.000
## RRE04 1.025 0.058 17.713 0.000
## RRE05 1.055 0.056 18.758 0.000
## RRE06 1.245 0.074 16.869 0.000
## RRE07 1.117 0.071 15.689 0.000
## RRE10 0.815 0.067 12.120 0.000
## maestria =~
## RMA02 1.000
## RMA03 1.155 0.096 12.079 0.000
## RMA04 1.178 0.089 13.274 0.000
## RMA05 1.141 0.087 13.072 0.000
## RMA06 0.645 0.075 8.597 0.000
## RMA07 1.103 0.084 13.061 0.000
## RMA08 1.109 0.085 12.994 0.000
## RMA09 1.028 0.084 12.246 0.000
## RMA10 1.055 0.088 12.044 0.000
## control =~
## RCO02 1.000
## RCO03 0.948 0.049 19.182 0.000
## RCO04 0.796 0.044 18.110 0.000
## RCO05 0.818 0.043 18.990 0.000
## RCO06 0.834 0.046 18.216 0.000
## RCO07 0.835 0.046 18.057 0.000
## recuperación =~
## desapego 1.000
## relajación 1.149 0.131 8.787 0.000
## maestria 0.858 0.129 6.666 0.000
## control 1.341 0.156 8.605 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|)
## .RPD01 1.172 0.120 9.782 0.000
## .RPD02 0.999 0.108 9.228 0.000
## .RPD03 1.441 0.148 9.733 0.000
## .RPD05 0.987 0.110 8.964 0.000
## .RPD06 1.817 0.182 9.967 0.000
## .RPD07 1.173 0.125 9.383 0.000
## .RPD08 1.460 0.150 9.714 0.000
## .RPD09 1.032 0.114 9.021 0.000
## .RPD10 1.034 0.115 8.955 0.000
## .RRE02 0.626 0.068 9.274 0.000
## .RRE03 0.653 0.073 9.011 0.000
## .RRE04 0.481 0.055 8.794 0.000
## .RRE05 0.374 0.046 8.153 0.000
## .RRE06 0.886 0.097 9.149 0.000
## .RRE07 0.950 0.100 9.505 0.000
## .RRE10 1.137 0.113 10.093 0.000
## .RMA02 1.740 0.175 9.931 0.000
## .RMA03 1.485 0.155 9.575 0.000
## .RMA04 0.855 0.097 8.772 0.000
## .RMA05 0.899 0.100 8.967 0.000
## .RMA06 1.631 0.159 10.281 0.000
## .RMA07 0.845 0.094 8.977 0.000
## .RMA08 0.886 0.098 9.034 0.000
## .RMA09 1.094 0.115 9.500 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.391 0.000
## .RCO04 0.462 0.052 8.963 0.000
## .RCO05 0.382 0.045 8.513 0.000
## .RCO06 0.494 0.055 8.917 0.000
## .RCO07 0.515 0.057 8.985 0.000
## .desapego 0.943 0.152 6.207 0.000
## .relajación 0.333 0.089 3.757 0.000
## .maestria 1.260 0.212 5.942 0.000
## .control 0.900 0.159 5.666 0.000
## recuperación 0.978 0.202 4.833 0.000
lavaanPlot(fit, coef=TRUE, cov=TRUE)
Revisar estimates en variances (eliminar las más bajas), eliminar las P(>|Z|) mayor a 0.05, otro criterio a eliminar es los que tengan un error estandar más grande que los demas. Analizar latentes
modelo1_depurado <- ' # Regresiones
# Variables latentes
desapego =~ RPD01 + RPD02 + RPD03 + RPD05 + RPD07 + RPD08 + RPD09 + RPD10
relajación =~ RRE02 + RRE03 + RRE04 + RRE05 + RRE06 + RRE07
maestria =~ RMA02 + RMA03 + RMA04 + RMA05 + RMA07 + RMA08 + RMA09 + RMA10
control =~ RCO02 + RCO03 + RCO05 + RCO06 + RCO07
recuperación =~ desapego + relajación + maestria + control
# Varianzas y covarianzas
# Intercepto
'
fit2 <- cfa(modelo1_depurado, df)
summary(fit2)
## lavaan 0.6.17 ended normally after 48 iterations
##
## Estimator ML
## Optimization method NLMINB
## Number of model parameters 58
##
## Number of observations 223
##
## Model Test User Model:
##
## Test statistic 886.791
## Degrees of freedom 320
## 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.079 15.158 0.000
## RPD03 1.146 0.083 13.750 0.000
## RPD05 1.310 0.084 15.663 0.000
## RPD07 1.219 0.083 14.675 0.000
## RPD08 1.114 0.086 13.004 0.000
## RPD09 1.301 0.085 15.315 0.000
## RPD10 1.328 0.086 15.404 0.000
## relajación =~
## RRE02 1.000
## RRE03 1.111 0.064 17.245 0.000
## RRE04 1.025 0.057 17.974 0.000
## RRE05 1.054 0.055 19.046 0.000
## RRE06 1.237 0.073 16.904 0.000
## RRE07 1.105 0.071 15.618 0.000
## maestria =~
## RMA02 1.000
## RMA03 1.155 0.095 12.223 0.000
## RMA04 1.176 0.088 13.412 0.000
## RMA05 1.140 0.086 13.220 0.000
## RMA07 1.091 0.083 13.067 0.000
## RMA08 1.103 0.084 13.087 0.000
## RMA09 1.020 0.083 12.287 0.000
## RMA10 1.049 0.087 12.097 0.000
## control =~
## RCO02 1.000
## RCO03 0.944 0.051 18.648 0.000
## RCO05 0.820 0.044 18.683 0.000
## RCO06 0.840 0.046 18.083 0.000
## RCO07 0.842 0.047 18.010 0.000
## recuperación =~
## desapego 1.000
## relajación 1.145 0.132 8.696 0.000
## maestria 0.843 0.129 6.525 0.000
## control 1.356 0.159 8.549 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|)
## .RPD01 1.134 0.117 9.697 0.000
## .RPD02 0.956 0.105 9.070 0.000
## .RPD03 1.381 0.143 9.629 0.000
## .RPD05 0.932 0.107 8.749 0.000
## .RPD07 1.162 0.125 9.304 0.000
## .RPD08 1.629 0.166 9.815 0.000
## .RPD09 1.053 0.117 8.980 0.000
## .RPD10 1.061 0.119 8.926 0.000
## .RRE02 0.612 0.067 9.179 0.000
## .RRE03 0.666 0.074 8.988 0.000
## .RRE04 0.467 0.054 8.651 0.000
## .RRE05 0.361 0.045 7.940 0.000
## .RRE06 0.898 0.098 9.119 0.000
## .RRE07 0.974 0.102 9.502 0.000
## .RMA02 1.720 0.174 9.901 0.000
## .RMA03 1.456 0.153 9.519 0.000
## .RMA04 0.839 0.097 8.681 0.000
## .RMA05 0.879 0.099 8.876 0.000
## .RMA07 0.874 0.097 9.009 0.000
## .RMA08 0.884 0.098 8.993 0.000
## .RMA09 1.105 0.116 9.490 0.000
## .RMA10 1.265 0.132 9.573 0.000
## .RCO02 0.999 0.109 9.187 0.000
## .RCO03 0.517 0.063 8.171 0.000
## .RCO05 0.385 0.047 8.145 0.000
## .RCO06 0.482 0.056 8.540 0.000
## .RCO07 0.495 0.058 8.582 0.000
## .desapego 0.985 0.157 6.286 0.000
## .relajación 0.360 0.092 3.917 0.000
## .maestria 1.309 0.218 5.994 0.000
## .control 0.850 0.159 5.341 0.000
## recuperación 0.974 0.203 4.795 0.000
lavaanPlot(fit2, coef=TRUE, cov=TRUE)
modelo2 <- ' # Regresiones
# Variables latentes
energia =~ EN01 + EN02 +EN04 + EN05 + EN06 + EN07 + EN08
# Varianzas y covarianzas
# Intercepto
'
fit3 <- cfa(modelo2, df)
summary(fit3)
## 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(fit3, coef=TRUE, cov=TRUE)
Despues de valiar los valores estimativos, los errores estandar y el p-value, determinamos innecesario depurar el modelo
modelo3 <- ' # Regresiones
# Variables latentes
vigor =~ EVI01 + EVI02 + EVI03
dedicacion =~ EDE01 + EDE02 + EDE03
absorcion =~ EAB01 + EAB02
engagement =~ vigor + dedicacion + absorcion
# Varianzas y covarianzas
# Intercepto
'
fit4 <- cfa(modelo3, df)
## Warning in lav_object_post_check(object): lavaan WARNING: some estimated lv
## variances are negative
summary(fit4)
## lavaan 0.6.17 ended normally after 34 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
## dedicacion =~
## EDE01 1.000
## EDE02 0.912 0.035 26.335 0.000
## EDE03 0.578 0.037 15.767 0.000
## absorcion =~
## EAB01 1.000
## EAB02 0.658 0.053 12.526 0.000
## engagement =~
## vigor 1.000
## dedicacion 1.280 0.069 18.579 0.000
## absorcion 1.012 0.061 16.461 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 0.678 0.096 7.052 0.000
## .dedicacion -0.072 0.098 -0.734 0.463
## .absorcion 0.476 0.138 3.451 0.001
## engagement 2.158 0.281 7.691 0.000
lavaanPlot(fit4, coef=TRUE, cov=TRUE)
modelo4 <- ' # Regresiones
# Variables latentes1
desapego =~ RPD01 + RPD02 + RPD03 + RPD05 + RPD07 + RPD08 + RPD09 + RPD10
relajación =~ RRE02 + RRE03 + RRE04 + RRE05 + RRE06 + RRE07
maestria =~ RMA02 + RMA03 + RMA04 + RMA05 + RMA07 + RMA08 + RMA09 + RMA10
control =~ RCO02 + RCO03 + RCO05 + RCO06 + RCO07
recuperación =~ desapego + relajación + maestria + control
# Variables latentes2
energia =~ EN01 + EN02 +EN04 + EN05 + EN06 + EN07 + EN08
# Variables latentes3
vigor =~ EVI01 + EVI02 + EVI03
dedicacion =~ EDE01 + EDE02 + EDE03
absorcion =~ EAB01 + EAB02
engagement =~ vigor + dedicacion + absorcion
# Varianzas y covarianzas
engagement ~~ energia + recuperación
# Intercepto
'
fit5 <- sem(modelo4, df)
summary(fit5)
## lavaan 0.6.17 ended normally after 70 iterations
##
## Estimator ML
## Optimization method NLMINB
## Number of model parameters 94
##
## Number of observations 223
##
## Model Test User Model:
##
## Test statistic 1976.721
## Degrees of freedom 809
## 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.207 0.079 15.227 0.000
## RPD03 1.146 0.083 13.777 0.000
## RPD05 1.312 0.083 15.717 0.000
## RPD07 1.220 0.083 14.704 0.000
## RPD08 1.108 0.086 12.927 0.000
## RPD09 1.299 0.085 15.301 0.000
## RPD10 1.325 0.086 15.367 0.000
## relajación =~
## RRE02 1.000
## RRE03 1.112 0.064 17.353 0.000
## RRE04 1.019 0.057 17.900 0.000
## RRE05 1.050 0.055 18.994 0.000
## RRE06 1.236 0.073 16.969 0.000
## RRE07 1.109 0.070 15.777 0.000
## maestria =~
## RMA02 1.000
## RMA03 1.153 0.095 12.187 0.000
## RMA04 1.176 0.088 13.407 0.000
## RMA05 1.139 0.086 13.209 0.000
## RMA07 1.092 0.084 13.071 0.000
## RMA08 1.105 0.084 13.099 0.000
## RMA09 1.022 0.083 12.301 0.000
## RMA10 1.049 0.087 12.102 0.000
## control =~
## RCO02 1.000
## RCO03 0.941 0.051 18.597 0.000
## RCO05 0.815 0.044 18.556 0.000
## RCO06 0.843 0.046 18.316 0.000
## RCO07 0.844 0.046 18.181 0.000
## recuperación =~
## desapego 1.000
## relajación 1.059 0.121 8.777 0.000
## maestria 0.880 0.129 6.848 0.000
## control 1.432 0.158 9.070 0.000
## energia =~
## EN01 1.000
## EN02 1.027 0.044 23.429 0.000
## EN04 0.998 0.044 22.876 0.000
## EN05 0.996 0.042 23.843 0.000
## EN06 0.982 0.041 23.859 0.000
## EN07 1.044 0.045 22.967 0.000
## EN08 1.033 0.042 24.399 0.000
## vigor =~
## EVI01 1.000
## EVI02 0.985 0.028 35.254 0.000
## EVI03 0.996 0.048 20.570 0.000
## dedicacion =~
## EDE01 1.000
## EDE02 0.905 0.034 26.521 0.000
## EDE03 0.567 0.037 15.443 0.000
## absorcion =~
## EAB01 1.000
## EAB02 0.656 0.053 12.366 0.000
## engagement =~
## vigor 1.000
## dedicacion 1.217 0.061 20.030 0.000
## absorcion 0.984 0.057 17.200 0.000
##
## Covariances:
## Estimate Std.Err z-value P(>|z|)
## energia ~~
## engagement 1.615 0.222 7.268 0.000
## recuperación ~~
## engagement 0.907 0.153 5.927 0.000
## energia 1.375 0.198 6.937 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|)
## .RPD01 1.133 0.117 9.698 0.000
## .RPD02 0.941 0.104 9.044 0.000
## .RPD03 1.376 0.143 9.627 0.000
## .RPD05 0.921 0.105 8.726 0.000
## .RPD07 1.157 0.124 9.301 0.000
## .RPD08 1.653 0.168 9.836 0.000
## .RPD09 1.061 0.118 9.002 0.000
## .RPD10 1.076 0.120 8.962 0.000
## .RRE02 0.607 0.066 9.147 0.000
## .RRE03 0.657 0.073 8.942 0.000
## .RRE04 0.479 0.055 8.691 0.000
## .RRE05 0.371 0.046 7.997 0.000
## .RRE06 0.894 0.098 9.092 0.000
## .RRE07 0.954 0.101 9.457 0.000
## .RMA02 1.720 0.174 9.905 0.000
## .RMA03 1.470 0.154 9.539 0.000
## .RMA04 0.840 0.097 8.692 0.000
## .RMA05 0.882 0.099 8.892 0.000
## .RMA07 0.872 0.097 9.011 0.000
## .RMA08 0.880 0.098 8.988 0.000
## .RMA09 1.099 0.116 9.487 0.000
## .RMA10 1.262 0.132 9.575 0.000
## .RCO02 0.994 0.108 9.210 0.000
## .RCO03 0.531 0.064 8.307 0.000
## .RCO05 0.403 0.048 8.335 0.000
## .RCO06 0.463 0.055 8.487 0.000
## .RCO07 0.482 0.056 8.566 0.000
## .EN01 0.695 0.072 9.659 0.000
## .EN02 0.442 0.049 9.061 0.000
## .EN04 0.473 0.051 9.236 0.000
## .EN05 0.378 0.042 8.907 0.000
## .EN06 0.366 0.041 8.900 0.000
## .EN07 0.507 0.055 9.209 0.000
## .EN08 0.354 0.041 8.661 0.000
## .EVI01 0.199 0.039 5.057 0.000
## .EVI02 0.224 0.040 5.635 0.000
## .EVI03 1.211 0.124 9.770 0.000
## .EDE01 0.352 0.064 5.524 0.000
## .EDE02 0.510 0.067 7.652 0.000
## .EDE03 0.874 0.088 9.947 0.000
## .EAB01 0.378 0.128 2.946 0.003
## .EAB02 1.149 0.121 9.493 0.000
## .desapego 0.984 0.152 6.474 0.000
## .relajación 0.548 0.089 6.176 0.000
## .maestria 1.244 0.207 6.015 0.000
## .control 0.646 0.123 5.240 0.000
## recuperación 0.975 0.200 4.882 0.000
## energia 2.817 0.327 8.606 0.000
## .vigor 0.537 0.084 6.421 0.000
## .dedicacion 0.098 0.087 1.123 0.261
## .absorcion 0.469 0.138 3.397 0.001
## engagement 2.300 0.284 8.098 0.000
lavaanPlot(fit5, coef=TRUE, cov=TRUE)