Introducción

Lo primero se procede a la carga de paquetes que puedan ser necesarios: * foreign para poder leer los ficheros de SPSS * lavaan para construir modelos SEM

Carga de datos

Se procede a leer los resultados de las encuestas a un data frame llamado ddd y cuyo resumen se muestra a continuación, previa eliminación de los registros que contengan datos NA:

setwd('/home/jb/git/Entrepreneur/')
# ddd = read.spss(file="Emprendimiento2016.sav",to.data.frame=TRUE)
# save(ddd,file="Emprendimiento2016.RData")
load(file="Emprendimiento2016.RData")
# summary(ddd)
jdx=apply(is.na(ddd),1,sum) == 0
ddna=ddd[jdx,]
colnames(ddna)= iconv(colnames(ddna),'utf-8','ascii',sub='')
# summary(ddna)
ddf = ddna
for (i in (1:length(colnames(ddf)))[-c(1,4)]) {
  ddf[,i]=as.ordered(ddf[,i])
}
#
ddnaddf=ddna
ddnaddf[,'V2.4IndividualismoINV']=as.numeric(ddna[,'V2.4IndividualismoINV'])
obs.ddf=c('V2.1Individualismo','V2.4IndividualismoINV','V2.8Individualismo',
          'V2.2MasculinidadINV','V2.6Masculinidad',
          'V2.3.AversinINV','V2.5Aversin','V2.7Aversin', 
          'V3.1ACTFuturoAtractivo', 'V3.2ACTOpciones',
          'V3.3CONTFcil', 'V3.4CONTPuedo', 
          'V3.11NSFamilia', 'V3.12NSAmigos','V3.12NSCompaeros','V3.14NSSociedad',
          'V3.5IEListo', 'V3.6IEMeta','V3.7IEHarTodo', 'V3.8IEConvencido',
          'V3.9IEPensarSerio','V3.10IEFirmeIntencin')
# cr.poly=polychoric(ddnaddf[,obs.ddf])
# alpha(cr.poly$rho)
#
belief=63
ddnaddf[,belief]=NA
colnames(ddnaddf)[belief]="BELIEFS"
ddnaddf[ddnaddf$PAIS=="Alemania","BELIEFS"]=1
ddnaddf[ddnaddf$PAIS=="Suecia","BELIEFS"]=1
ddnaddf[ddnaddf$PAIS=="España","BELIEFS"]=2
ddnaddf[ddnaddf$PAIS=="Italia","BELIEFS"]=2
ddnaddf[ddnaddf$PAIS=="México","BELIEFS"]=2
# De la excell de Gustavo
ddnaddf[ddnaddf$PAIS=="Alemania","EcFree"]=rnorm(sum(ddnaddf$PAIS=="Alemania"),mean=73.4, sd=0.5)
ddnaddf[ddnaddf$PAIS=="Suecia","EcFree"]=rnorm(sum(ddnaddf$PAIS=="Suecia"),mean=73.1, sd=0.5)
ddnaddf[ddnaddf$PAIS=="España","EcFree"]=rnorm(sum(ddnaddf$PAIS=="España"),mean=67.2, sd=0.6)
ddnaddf[ddnaddf$PAIS=="Italia","EcFree"]=rnorm(sum(ddnaddf$PAIS=="Italia"),mean=60.9, sd=0.5)
ddnaddf[ddnaddf$PAIS=="México","EcFree"]=rnorm(sum(ddnaddf$PAIS=="México"),mean=66.8, sd=0.5)
ddnaddf[ddnaddf$PAIS=="Alemania","PPP"]=rnorm(sum(ddnaddf$PAIS=="Alemania"),mean=47.012, sd=0.5)
ddnaddf[ddnaddf$PAIS=="Suecia","PPP"]=rnorm(sum(ddnaddf$PAIS=="Suecia"),mean=47.046, sd=1.5)
ddnaddf[ddnaddf$PAIS=="España","PPP"]=rnorm(sum(ddnaddf$PAIS=="España"),mean=33.526, sd=0.5)
ddnaddf[ddnaddf$PAIS=="Italia","PPP"]=rnorm(sum(ddnaddf$PAIS=="Italia"),mean=36.195, sd=0.5)
ddnaddf[ddnaddf$PAIS=="México","PPP"]=rnorm(sum(ddnaddf$PAIS=="México"),mean=18.046, sd=0.95)
ddnaddf[ddnaddf$PAIS=="Alemania","Gini"]=rnorm(sum(ddnaddf$PAIS=="Alemania"),mean=31.7, sd=0.5)
ddnaddf[ddnaddf$PAIS=="Suecia","Gini"]=rnorm(sum(ddnaddf$PAIS=="Suecia"),mean=28.4, sd=0.5)
ddnaddf[ddnaddf$PAIS=="España","Gini"]=rnorm(sum(ddnaddf$PAIS=="España"),mean=36.1, sd=0.5)
ddnaddf[ddnaddf$PAIS=="Italia","Gini"]=rnorm(sum(ddnaddf$PAIS=="Italia"),mean=34.7, sd=0.5)
ddnaddf[ddnaddf$PAIS=="México","Gini"]=rnorm(sum(ddnaddf$PAIS=="México"),mean=48.7, sd=0.5)
ddnaddf[ddnaddf$PAIS=="Alemania","IDV"]=round(rnorm(sum(ddnaddf$PAIS=="Alemania"),mean=51, sd=1),0)
ddnaddf[ddnaddf$PAIS=="Suecia","IDV"]=round(rnorm(sum(ddnaddf$PAIS=="Suecia"),mean=71, sd=1),0)
ddnaddf[ddnaddf$PAIS=="España","IDV"]=round(rnorm(sum(ddnaddf$PAIS=="España"),mean=67, sd=1),0)
ddnaddf[ddnaddf$PAIS=="Italia","IDV"]=round(rnorm(sum(ddnaddf$PAIS=="Italia"),mean=76, sd=1),0)
ddnaddf[ddnaddf$PAIS=="México","IDV"]=round(rnorm(sum(ddnaddf$PAIS=="México"),mean=30, sd=1),0)
ddnaddf[ddnaddf$PAIS=="Alemania","MAS"]=round(rnorm(sum(ddnaddf$PAIS=="Alemania"),mean=42, sd=1),0)
ddnaddf[ddnaddf$PAIS=="Suecia","MAS"]=round(rnorm(sum(ddnaddf$PAIS=="Suecia"),mean=5, sd=2),0)
ddnaddf[ddnaddf$PAIS=="España","MAS"]=round(rnorm(sum(ddnaddf$PAIS=="España"),mean=66, sd=1),0)
ddnaddf[ddnaddf$PAIS=="Italia","MAS"]=round(rnorm(sum(ddnaddf$PAIS=="Italia"),mean=70, sd=0.5),0)
ddnaddf[ddnaddf$PAIS=="México","MAS"]=round(rnorm(sum(ddnaddf$PAIS=="México"),mean=69, sd=0.5),0)
ddnaddf[ddnaddf$PAIS=="Alemania","UAI"]=round(rnorm(sum(ddnaddf$PAIS=="Alemania"),mean=86, sd=1),0)
ddnaddf[ddnaddf$PAIS=="Suecia","UAI"]=round(rnorm(sum(ddnaddf$PAIS=="Suecia"),mean=29, sd=2),0)
ddnaddf[ddnaddf$PAIS=="España","UAI"]=round(rnorm(sum(ddnaddf$PAIS=="España"),mean=65, sd=1),0)
ddnaddf[ddnaddf$PAIS=="Italia","UAI"]=round(rnorm(sum(ddnaddf$PAIS=="Italia"),mean=75, sd=1),0)
ddnaddf[ddnaddf$PAIS=="México","UAI"]=round(rnorm(sum(ddnaddf$PAIS=="México"),mean=82, sd=1),0)
ddnaddf[ddnaddf$PAIS=="Alemania","CAT"]=round(rnorm(sum(ddnaddf$PAIS=="Alemania"),mean=29, sd=1),0)
ddnaddf[ddnaddf$PAIS=="Suecia","CAT"]=round(rnorm(sum(ddnaddf$PAIS=="Suecia"),mean=5, sd=2),0)
ddnaddf[ddnaddf$PAIS=="España","CAT"]=round(rnorm(sum(ddnaddf$PAIS=="España"),mean=92, sd=1),0)
ddnaddf[ddnaddf$PAIS=="Italia","CAT"]=round(rnorm(sum(ddnaddf$PAIS=="Italia"),mean=94, sd=1),0)
ddnaddf[ddnaddf$PAIS=="México","CAT"]=round(rnorm(sum(ddnaddf$PAIS=="México"),mean=85, sd=1),0)

# Datos de Gustavo incorporados

kruskal.test(ddnaddf[,63],ddnaddf[,42])
## 
##  Kruskal-Wallis rank sum test
## 
## data:  ddnaddf[, 63] and ddnaddf[, 42]
## Kruskal-Wallis chi-squared = 37.568, df = 6, p-value = 1.364e-06
chisq.test(table(ddnaddf[,63],ddnaddf[,42]))
## 
##  Pearson's Chi-squared test
## 
## data:  table(ddnaddf[, 63], ddnaddf[, 42])
## X-squared = 37.589, df = 6, p-value = 1.351e-06
#
kruskal.test(ddna[,5],ddna[,42])
## 
##  Kruskal-Wallis rank sum test
## 
## data:  ddna[, 5] and ddna[, 42]
## Kruskal-Wallis chi-squared = 27.427, df = 6, p-value = 0.0001204
kruskal.test(ddna[,2],ddna[,42])
## 
##  Kruskal-Wallis rank sum test
## 
## data:  ddna[, 2] and ddna[, 42]
## Kruskal-Wallis chi-squared = 20.236, df = 6, p-value = 0.002514
kruskal.test(ddna[,5],ddna[,42])
## 
##  Kruskal-Wallis rank sum test
## 
## data:  ddna[, 5] and ddna[, 42]
## Kruskal-Wallis chi-squared = 27.427, df = 6, p-value = 0.0001204
chisq.test(table(ddna[,5],ddna[,42]))
## 
##  Pearson's Chi-squared test
## 
## data:  table(ddna[, 5], ddna[, 42])
## X-squared = 27.443, df = 6, p-value = 0.0001196
chisq.test(table(ddna[,5],ddna[,36]))
## 
##  Pearson's Chi-squared test
## 
## data:  table(ddna[, 5], ddna[, 36])
## X-squared = 9.7832, df = 12, p-value = 0.635
chisq.test(table(ddna[,5],ddna[,38]))
## 
##  Pearson's Chi-squared test
## 
## data:  table(ddna[, 5], ddna[, 38])
## X-squared = 21.744, df = 6, p-value = 0.001347
chisq.test(table(ddna[,5],ddna[,39]))
## 
##  Pearson's Chi-squared test
## 
## data:  table(ddna[, 5], ddna[, 39])
## X-squared = 10.39, df = 6, p-value = 0.1092
chisq.test(table(ddna[,5],ddna[,40]))
## 
##  Pearson's Chi-squared test
## 
## data:  table(ddna[, 5], ddna[, 40])
## X-squared = 11.3, df = 6, p-value = 0.07952
chisq.test(table(ddna[,5],ddna[,38]))
## 
##  Pearson's Chi-squared test
## 
## data:  table(ddna[, 5], ddna[, 38])
## X-squared = 21.744, df = 6, p-value = 0.001347
#
summary(ddnaddf)
##      CODIGO            UNI            PAIS          EDAD          GENERO    
##  Min.   : 11002   UPM    :412   España  :412   Min.   :19.00   Hombre:1173  
##  1st Qu.: 21059   MILAN  :245   Italia  :727   1st Qu.:22.00   Mujer : 600  
##  Median : 41075   TUB    :213   México  :200   Median :23.00                
##  Mean   : 42867   PARMA  :202   Suecia  :221   Mean   :23.61                
##  3rd Qu.: 63016   MEXICO :200   Alemania:213   3rd Qu.:25.00                
##  Max.   :150452   POLIBA :140                  Max.   :52.00                
##                   (Other):361                                               
##              CARRERA       CURSO          PASNAC       PASNACPADRE   
##  Organización    :456   último:1773   Min.   :1.000   Min.   :1.000  
##  Industriales    :587                 1st Qu.:2.000   1st Qu.:2.000  
##  Química         :330                 Median :2.000   Median :2.000  
##  Ing. Civil      :400                 Mean   :2.617   Mean   :2.605  
##  Ing. Informática:  0                 3rd Qu.:3.000   3rd Qu.:3.000  
##                                       Max.   :6.000   Max.   :6.000  
##                                                                      
##   PASNACMADRE        CLASESOCIAL          ClaseSocial2         ESTPADRE  
##  Min.   :1.000   Baja      : 61   Baja-MedioBaja:797   Sin estudios:139  
##  1st Qu.:2.000   Media-Baja:736   Alta-MedioAlta:976   Secundaria  :480  
##  Median :2.000   Media-Alta:929                        FP          :395  
##  Mean   :2.608   Alta      : 47                        Universidad :759  
##  3rd Qu.:3.000                                                           
##  Max.   :6.000                                                           
##                                                                          
##          ESTMADRE       OCUPACIONPADRE     OCUPACIONMADRE   ENTORNONEG   
##  Sin estudios:154   Funcionario:405    Funcionario:438    Min.   :0.000  
##  Secundaria  :547   Empleado   :633    Empleado   :537    1st Qu.:0.000  
##  FP          :400   Empresario :453    Empresario :210    Median :1.000  
##  Universidad :672   Desempleado: 63    Desempleado:298    Mean   :0.727  
##                     Otro       :219    Otro       :290    3rd Qu.:1.000  
##                                                           Max.   :2.000  
##                                                                          
##  V2.1Individualismo       V2.2Feminidad    V2.2MasculinidadINV
##  Min.   :1.000      Muy Masculino:121   Muy femenino :280     
##  1st Qu.:3.000      Masculino    :225   Femenino     :627     
##  Median :4.000      Medio        :520   Medio        :520     
##  Mean   :3.813      Femenino     :627   Masculino    :225     
##  3rd Qu.:5.000      Muy femenino :280   Muy Masculino:121     
##  Max.   :6.000                                                
##                                                               
##        V2.3NoAversin      V2.3.AversinINV           V2.4Colectivismo
##  Alta aversión:331   Baja aversión: 97    Muy Individualista: 83    
##  Aversión     :542   Poca aversión:301    Individualista    :197    
##  Medio        :502   Medio        :502    Medio             :530    
##  Poca aversión:301   Aversión     :542    Colectivista      :693    
##  Baja aversión: 97   Alta aversión:331    Muy Colectivista  :270    
##                                                                     
##                                                                     
##  V2.4IndividualismoINV        V2.5Aversin       V2.6Masculinidad
##  Min.   :1.000         Baja aversión:110   Muy femenino : 29    
##  1st Qu.:2.000         Poca aversión:301   Femenino     : 98    
##  Median :2.000         Medio        :473   Medio        :389    
##  Mean   :2.509         Aversión     :493   Masculino    :726    
##  3rd Qu.:3.000         Alta aversión:396   Muy Masculino:531    
##  Max.   :5.000                                                  
##                                                                 
##         V2.7Aversin           V2.8Individualismo V2.9Innovacin  
##  Baja aversión: 27   Muy Colectivista  : 29      Min.   :1.000  
##  Poca aversión:120   Colectivista      :127      1st Qu.:2.000  
##  Medio        :413   Medio             :386      Median :3.000  
##  Aversión     :741   Individualista    :635      Mean   :3.092  
##  Alta aversión:472   Muy Individualista:596      3rd Qu.:4.000  
##                                                  Max.   :5.000  
##                                                                 
##     V2.10IT      V3.1ACTFuturoAtractivo V3.2ACTOpciones    MediaACT    
##  Min.   :1.000   Min.   :1.000          Min.   :1.000   Min.   :1.000  
##  1st Qu.:1.000   1st Qu.:4.000          1st Qu.:3.000   1st Qu.:3.500  
##  Median :2.000   Median :5.000          Median :4.000   Median :4.500  
##  Mean   :2.389   Mean   :4.917          Mean   :4.245   Mean   :4.581  
##  3rd Qu.:3.000   3rd Qu.:6.000          3rd Qu.:5.000   3rd Qu.:6.000  
##  Max.   :5.000   Max.   :7.000          Max.   :7.000   Max.   :7.000  
##                                                                        
##   V3.3CONTFcil   V3.4CONTPuedo     MediaCONT      V3.5IEListo   
##  Min.   :1.000   Min.   :1.000   Min.   :1.000   Min.   :1.000  
##  1st Qu.:3.000   1st Qu.:3.000   1st Qu.:2.500   1st Qu.:2.000  
##  Median :4.000   Median :4.000   Median :3.500   Median :3.000  
##  Mean   :3.669   Mean   :3.812   Mean   :3.741   Mean   :3.467  
##  3rd Qu.:5.000   3rd Qu.:5.000   3rd Qu.:5.000   3rd Qu.:5.000  
##  Max.   :7.000   Max.   :7.000   Max.   :7.000   Max.   :7.000  
##                                                                 
##    V3.6IEMeta    V3.7IEHarTodo   V3.8IEConvencido V3.9IEPensarSerio
##  Min.   :1.000   Min.   :1.000   Min.   :1.000    Min.   :1.000    
##  1st Qu.:2.000   1st Qu.:2.000   1st Qu.:2.000    1st Qu.:2.000    
##  Median :4.000   Median :3.000   Median :3.000    Median :3.000    
##  Mean   :3.699   Mean   :3.671   Mean   :3.635    Mean   :3.676    
##  3rd Qu.:5.000   3rd Qu.:5.000   3rd Qu.:5.000    3rd Qu.:5.000    
##  Max.   :7.000   Max.   :7.000   Max.   :7.000    Max.   :7.000    
##                                                                    
##  V3.10IEFirmeIntencin    MediaIE      V3.11NSFamilia  V3.12NSAmigos  
##  Min.   :1.000        Min.   :1.000   Min.   :1.000   Min.   :1.000  
##  1st Qu.:2.000        1st Qu.:2.167   1st Qu.:4.000   1st Qu.:4.000  
##  Median :3.000        Median :3.333   Median :6.000   Median :6.000  
##  Mean   :3.633        Mean   :3.630   Mean   :5.506   Mean   :5.415  
##  3rd Qu.:5.000        3rd Qu.:5.000   3rd Qu.:7.000   3rd Qu.:7.000  
##  Max.   :7.000        Max.   :7.000   Max.   :7.000   Max.   :7.000  
##                                                                      
##  V3.12NSCompaeros V3.14NSSociedad    MediaNS       V4.1FINPROP   
##  Min.   :1.000    Min.   :1.000   Min.   :1.000   Min.   :1.000  
##  1st Qu.:4.000    1st Qu.:4.000   1st Qu.:4.250   1st Qu.:2.000  
##  Median :5.000    Median :5.000   Median :5.250   Median :2.000  
##  Mean   :5.124    Mean   :4.818   Mean   :5.216   Mean   :2.399  
##  3rd Qu.:6.000    3rd Qu.:6.000   3rd Qu.:6.250   3rd Qu.:3.000  
##  Max.   :7.000    Max.   :7.000   Max.   :7.000   Max.   :5.000  
##                                                                  
##     V4.2ADM         V4.3JUV      V4.4CREDIT      V4.5FINPUB       V4.6JUV     
##  Min.   :1.000   Min.   :1.0   Min.   :1.000   Min.   :1.000   Min.   :1.000  
##  1st Qu.:1.000   1st Qu.:2.0   1st Qu.:2.000   1st Qu.:2.000   1st Qu.:2.000  
##  Median :2.000   Median :3.0   Median :2.000   Median :2.000   Median :3.000  
##  Mean   :2.223   Mean   :2.9   Mean   :2.403   Mean   :2.342   Mean   :3.094  
##  3rd Qu.:3.000   3rd Qu.:4.0   3rd Qu.:3.000   3rd Qu.:3.000   3rd Qu.:4.000  
##  Max.   :5.000   Max.   :5.0   Max.   :5.000   Max.   :5.000   Max.   :5.000  
##                                                                               
##     V4.7ADM       V4.8FINPROP       V4.9ADM         V4.10JUV    
##  Min.   :1.000   Min.   :1.000   Min.   :1.000   Min.   :1.000  
##  1st Qu.:2.000   1st Qu.:2.000   1st Qu.:1.000   1st Qu.:2.000  
##  Median :2.000   Median :2.000   Median :2.000   Median :2.000  
##  Mean   :2.346   Mean   :2.404   Mean   :2.136   Mean   :2.508  
##  3rd Qu.:3.000   3rd Qu.:3.000   3rd Qu.:3.000   3rd Qu.:3.000  
##  Max.   :5.000   Max.   :5.000   Max.   :5.000   Max.   :5.000  
##                                                                 
##     V4.11ADM        V4.12EDU        V4.13JUV        V4.14ADM    
##  Min.   :1.000   Min.   :1.000   Min.   :1.000   Min.   :1.000  
##  1st Qu.:1.000   1st Qu.:2.000   1st Qu.:2.000   1st Qu.:2.000  
##  Median :2.000   Median :3.000   Median :3.000   Median :2.000  
##  Mean   :2.043   Mean   :2.755   Mean   :2.633   Mean   :2.459  
##  3rd Qu.:3.000   3rd Qu.:4.000   3rd Qu.:3.000   3rd Qu.:3.000  
##  Max.   :5.000   Max.   :5.000   Max.   :5.000   Max.   :5.000  
##                                                                 
##     BELIEFS          EcFree           PPP             Gini      
##  Min.   :1.000   Min.   :59.06   Min.   :15.33   Min.   :27.15  
##  1st Qu.:2.000   1st Qu.:61.06   1st Qu.:33.59   1st Qu.:33.63  
##  Median :2.000   Median :66.60   Median :36.08   Median :34.86  
##  Mean   :1.755   Mean   :66.03   Mean   :36.17   Mean   :35.47  
##  3rd Qu.:2.000   3rd Qu.:68.41   3rd Qu.:37.41   3rd Qu.:35.99  
##  Max.   :2.000   Max.   :74.85   Max.   :50.63   Max.   :49.88  
##                                                                 
##       IDV             MAS             UAI             CAT       
##  Min.   :27.00   Min.   : 0.00   Min.   :24.00   Min.   : 0.00  
##  1st Qu.:66.00   1st Qu.:64.00   1st Qu.:65.00   1st Qu.:83.00  
##  Median :70.00   Median :69.00   Median :75.00   Median :92.00  
##  Mean   :65.11   Mean   :57.51   Mean   :69.06   Mean   :73.63  
##  3rd Qu.:76.00   3rd Qu.:70.00   3rd Qu.:77.00   3rd Qu.:94.00  
##  Max.   :79.00   Max.   :72.00   Max.   :89.00   Max.   :97.00  
## 

Análisis Factorial Confirmatorio. Modelo de Ajzen

Se procede a crear en modelo de Ajzen y a un análisis confirmatorio de datos. Partimos de las variables como factores

Modelado del caso de Ajzen con Ecuaciones Estructurales

#
 ddold = ddna
 ddnaddf[,"V2.8Individualismo"]= as.numeric(ddna[,"V2.8Individualismo"])
 ddnaddf[,"V2.2MasculinidadINV"]= as.numeric(ddna[,"V2.2MasculinidadINV"])
 ddnaddf[,"V2.6Masculinidad"]= as.numeric(ddna[,"V2.6Masculinidad"])
 ddnaddf[,"V2.3.AversinINV"]= as.numeric(ddna[,"V2.3.AversinINV"])
 ddnaddf[,"V2.5Aversin"]= as.numeric(ddna[,"V2.5Aversin"])
 ddnaddf[,"V2.7Aversin"]= as.numeric(ddna[,"V2.7Aversin"])
#
 obs.variables2=c('V3.1ACTFuturoAtractivo', 'V3.2ACTOpciones','V2.1Individualismo',
                'V3.11NSFamilia', 'V3.12NSAmigos', 'V3.14NSSociedad',
                'V3.3CONTFcil', 'V3.4CONTPuedo', 'V3.6IEMeta', 'V3.8IEConvencido',
                'V3.10IEFirmeIntencin', 'V2.8Individualismo',
                'V2.2MasculinidadINV', 'V2.6Masculinidad', 
                'V2.5Aversin','V2.7Aversin')
#
mcv = round(cov(ddnaddf[,obs.variables2]),1)

Resumen de las variables para protestantes

summary(ddnaddf[ddnaddf[,"BELIEFS"]==1,obs.ddf])
##  V2.1Individualismo V2.4IndividualismoINV V2.8Individualismo
##  Min.   :1.000      Min.   :1.00          Min.   :1.000     
##  1st Qu.:3.000      1st Qu.:2.00          1st Qu.:3.000     
##  Median :4.000      Median :2.00          Median :4.000     
##  Mean   :3.982      Mean   :2.27          Mean   :3.984     
##  3rd Qu.:5.000      3rd Qu.:3.00          3rd Qu.:5.000     
##  Max.   :6.000      Max.   :5.00          Max.   :5.000     
##  V2.2MasculinidadINV V2.6Masculinidad V2.3.AversinINV  V2.5Aversin   
##  Min.   :1.000       Min.   :1.000    Min.   :1.00    Min.   :1.000  
##  1st Qu.:2.000       1st Qu.:3.000    1st Qu.:2.00    1st Qu.:2.000  
##  Median :2.000       Median :4.000    Median :3.00    Median :3.000  
##  Mean   :2.267       Mean   :3.735    Mean   :3.09    Mean   :3.168  
##  3rd Qu.:3.000       3rd Qu.:4.000    3rd Qu.:4.00    3rd Qu.:4.000  
##  Max.   :5.000       Max.   :5.000    Max.   :5.00    Max.   :5.000  
##   V2.7Aversin    V3.1ACTFuturoAtractivo V3.2ACTOpciones  V3.3CONTFcil  
##  Min.   :1.000   Min.   :1.0            Min.   :1.000   Min.   :1.000  
##  1st Qu.:3.000   1st Qu.:4.0            1st Qu.:3.000   1st Qu.:3.000  
##  Median :4.000   Median :5.0            Median :4.000   Median :4.000  
##  Mean   :3.758   Mean   :4.8            Mean   :4.124   Mean   :3.749  
##  3rd Qu.:4.000   3rd Qu.:6.0            3rd Qu.:5.000   3rd Qu.:5.000  
##  Max.   :5.000   Max.   :7.0            Max.   :7.000   Max.   :7.000  
##  V3.4CONTPuedo   V3.11NSFamilia  V3.12NSAmigos   V3.12NSCompaeros
##  Min.   :1.000   Min.   :1.000   Min.   :1.000   Min.   :1.000   
##  1st Qu.:3.000   1st Qu.:5.000   1st Qu.:5.000   1st Qu.:4.000   
##  Median :4.000   Median :6.000   Median :6.000   Median :5.000   
##  Mean   :3.947   Mean   :5.528   Mean   :5.475   Mean   :5.014   
##  3rd Qu.:5.000   3rd Qu.:7.000   3rd Qu.:7.000   3rd Qu.:6.000   
##  Max.   :7.000   Max.   :7.000   Max.   :7.000   Max.   :7.000   
##  V3.14NSSociedad  V3.5IEListo      V3.6IEMeta    V3.7IEHarTodo  
##  Min.   :1.000   Min.   :1.000   Min.   :1.000   Min.   :1.000  
##  1st Qu.:4.000   1st Qu.:1.000   1st Qu.:2.000   1st Qu.:2.000  
##  Median :5.000   Median :3.000   Median :3.000   Median :3.000  
##  Mean   :4.763   Mean   :3.007   Mean   :3.396   Mean   :3.097  
##  3rd Qu.:6.000   3rd Qu.:4.000   3rd Qu.:5.000   3rd Qu.:4.000  
##  Max.   :7.000   Max.   :7.000   Max.   :7.000   Max.   :7.000  
##  V3.8IEConvencido V3.9IEPensarSerio V3.10IEFirmeIntencin
##  Min.   :1.00     Min.   :1.00      Min.   :1.000       
##  1st Qu.:2.00     1st Qu.:2.00      1st Qu.:2.000       
##  Median :3.00     Median :3.00      Median :3.000       
##  Mean   :3.15     Mean   :3.41      Mean   :3.279       
##  3rd Qu.:4.00     3rd Qu.:5.00      3rd Qu.:5.000       
##  Max.   :7.00     Max.   :7.00      Max.   :7.000

Resumen de las variables para Católicos

summary(ddnaddf[ddnaddf[,"BELIEFS"]==2,obs.ddf])
##  V2.1Individualismo V2.4IndividualismoINV V2.8Individualismo
##  Min.   :1.000      Min.   :1.000         Min.   :1.000     
##  1st Qu.:3.000      1st Qu.:2.000         1st Qu.:3.000     
##  Median :4.000      Median :2.000         Median :4.000     
##  Mean   :3.758      Mean   :2.587         Mean   :3.907     
##  3rd Qu.:5.000      3rd Qu.:3.000         3rd Qu.:5.000     
##  Max.   :5.000      Max.   :5.000         Max.   :5.000     
##  V2.2MasculinidadINV V2.6Masculinidad V2.3.AversinINV  V2.5Aversin   
##  Min.   :1.0         Min.   :1.000    Min.   :1.0     Min.   :1.000  
##  1st Qu.:2.0         1st Qu.:3.000    1st Qu.:3.0     1st Qu.:3.000  
##  Median :3.0         Median :4.000    Median :4.0     Median :4.000  
##  Mean   :2.7         Mean   :3.981    Mean   :3.5     Mean   :3.516  
##  3rd Qu.:3.0         3rd Qu.:5.000    3rd Qu.:4.0     3rd Qu.:4.000  
##  Max.   :5.0         Max.   :5.000    Max.   :5.0     Max.   :5.000  
##   V2.7Aversin    V3.1ACTFuturoAtractivo V3.2ACTOpciones  V3.3CONTFcil  
##  Min.   :1.000   Min.   :1.000          Min.   :1.000   Min.   :1.000  
##  1st Qu.:3.000   1st Qu.:4.000          1st Qu.:3.000   1st Qu.:2.000  
##  Median :4.000   Median :5.000          Median :4.000   Median :4.000  
##  Mean   :3.883   Mean   :4.955          Mean   :4.285   Mean   :3.643  
##  3rd Qu.:5.000   3rd Qu.:6.000          3rd Qu.:5.500   3rd Qu.:5.000  
##  Max.   :5.000   Max.   :7.000          Max.   :7.000   Max.   :7.000  
##  V3.4CONTPuedo   V3.11NSFamilia  V3.12NSAmigos   V3.12NSCompaeros
##  Min.   :1.000   Min.   :1.000   Min.   :1.000   Min.   :1.00    
##  1st Qu.:3.000   1st Qu.:4.000   1st Qu.:4.000   1st Qu.:4.00    
##  Median :4.000   Median :6.000   Median :6.000   Median :5.00    
##  Mean   :3.768   Mean   :5.499   Mean   :5.396   Mean   :5.16    
##  3rd Qu.:5.000   3rd Qu.:7.000   3rd Qu.:7.000   3rd Qu.:6.00    
##  Max.   :7.000   Max.   :7.000   Max.   :7.000   Max.   :7.00    
##  V3.14NSSociedad  V3.5IEListo      V3.6IEMeta    V3.7IEHarTodo  
##  Min.   :1.000   Min.   :1.000   Min.   :1.000   Min.   :1.000  
##  1st Qu.:4.000   1st Qu.:2.000   1st Qu.:2.000   1st Qu.:2.000  
##  Median :5.000   Median :3.000   Median :4.000   Median :4.000  
##  Mean   :4.836   Mean   :3.616   Mean   :3.798   Mean   :3.857  
##  3rd Qu.:6.000   3rd Qu.:5.000   3rd Qu.:5.000   3rd Qu.:5.000  
##  Max.   :7.000   Max.   :7.000   Max.   :7.000   Max.   :7.000  
##  V3.8IEConvencido V3.9IEPensarSerio V3.10IEFirmeIntencin
##  Min.   :1.000    Min.   :1.000     Min.   :1.000       
##  1st Qu.:2.000    1st Qu.:2.000     1st Qu.:2.000       
##  Median :4.000    Median :4.000     Median :4.000       
##  Mean   :3.792    Mean   :3.763     Mean   :3.748       
##  3rd Qu.:5.000    3rd Qu.:5.000     3rd Qu.:5.000       
##  Max.   :7.000    Max.   :7.000     Max.   :7.000

Preparación del modelo 2020

Nos referimos a EI ~ ATB + PBC, con

#
# V3.5IEListo"            "V3.6IEMeta"     "V3.7IEHarTodo"          
# "V3.8IEConvencido"     "V3.9IEPensarSerio"      "V3.10IEFirmeIntencin" 
ddnaddf[,"EI"] =as.numeric(apply(
                  ddnaddf[,c("V3.5IEListo","V3.6IEMeta", 
                   "V3.7IEHarTodo","V3.8IEConvencido",
                   "V3.9IEPensarSerio","V3.10IEFirmeIntencin")],
                   1,mean))
ddnaddf[,"ATB"] = as.numeric(apply(
                  ddnaddf[,c("V3.1ACTFuturoAtractivo",
                    "V3.2ACTOpciones")],
                    1,mean))
ddnaddf[,"PBC"] = as.numeric(apply(
                  ddnaddf[,c("V3.11NSFamilia",
                    "V3.12NSAmigos", "V3.12NSCompaeros",
                    "V3.14NSSociedad")],
                    1,mean))
ddnaddf[,"SN"] = as.numeric(apply(
                  ddnaddf[,c("V3.3CONTFcil","V3.4CONTPuedo")],
                    1,mean))
#

Ahora se modela el Esquema propuesto por G Morales el 18/4/2020

#
# PBC =~ V3.3CONTFcil + V3.4CONTPuedo 
# EI  =~ V3.6IEMeta + V3.8IEConvencido + V3.10IEFirmeIntencin
obs.variables99  = c("EcFree","PPP","Gini","IDV","MAS",
                     "UAI","CAT","ATB","PBC","SN","EI")
dat = ddnaddf[,obs.variables99]
EI.AJZEN.model99 = '
               # Variables Latentes
                Context  =~ EcFree + PPP + Gini 
                Cultural =~ MAS + UAI + CAT + IDV
                Religion =~ CAT 
                Cognitive=~ ATB + PBC + SN
                Supportive=~ SN 
                Ent =~ EI 
              #
                EcFree ~~ EcFree
                PPP ~~ PPP 
                CAT ~~ CAT
                SN  ~~ SN
                Gini ~~ Gini 
                MAS ~~ MAS
                ATB ~~ ATB
                EI ~~ EI
                Religion ~~ Religion
                Supportive ~~ Supportive
                Context ~~ Cultural
              # Equations
                Ent ~  Context + Cultural  + Cognitive + Religion + Supportive
        '
mcv = round(cov(dat),1)
# mod='EI =~ EcFree + PPP + Gini + IDV + MAS + UAI + CAT + ATB + PBC + SN'
#  + Context + Cultural + Cognitive + Religion + Supportive
fit <- lavaan::cfa(EI.AJZEN.model99, data= dat)
## Warning in lav_model_estimate(lavmodel = lavmodel, lavpartable = lavpartable, :
## lavaan WARNING: the optimizer warns that a solution has NOT been found!
summary(fit, fit.measures=FALSE)
## lavaan 0.6-5 did NOT end normally after 10000 iterations
## ** WARNING ** Estimates below are most likely unreliable
## 
##   Estimator                                         ML
##   Optimization method                           NLMINB
##   Number of free parameters                         39
##                                                       
##   Number of observations                          1773
##                                                       
## Model Test User Model:
##                                                       
##   Test statistic                                    NA
##   Degrees of freedom                                NA
## 
## Parameter Estimates:
## 
##   Information                                 Expected
##   Information saturated (h1) model          Structured
##   Standard errors                             Standard
## 
## Latent Variables:
##                    Estimate    Std.Err  z-value  P(>|z|)
##   Context =~                                            
##     EcFree              1.000                           
##     PPP                 4.854       NA                  
##     Gini               -2.687       NA                  
##   Cultural =~                                           
##     MAS                 1.000                           
##     UAI                -0.062       NA                  
##     CAT                -5.660       NA                  
##     IDV                 0.007       NA                  
##   Religion =~                                           
##     CAT                 1.000                           
##   Cognitive =~                                          
##     ATB                 1.000                           
##     PBC                 0.321       NA                  
##     SN                  0.003       NA                  
##   Supportive =~                                         
##     SN                  1.000                           
##   Ent =~                                                
##     EI                  1.000                           
## 
## Regressions:
##                    Estimate    Std.Err  z-value  P(>|z|)
##   Ent ~                                                 
##     Context             2.523       NA                  
##     Cultural           -3.244       NA                  
##     Cognitive        -546.312       NA                  
##     Religion            0.253       NA                  
##     Supportive        900.826       NA                  
## 
## Covariances:
##                    Estimate    Std.Err  z-value  P(>|z|)
##   Context ~~                                            
##     Cultural          -19.753       NA                  
##     Religion         -151.147       NA                  
##     Cognitive          -0.306       NA                  
##     Supportive         -0.224       NA                  
##   Cultural ~~                                           
##     Religion        -7209.098       NA                  
##     Cognitive          -0.753       NA                  
##     Supportive         -3.327       NA                  
##   Religion ~~                                           
##     Cognitive          -5.124       NA                  
##     Supportive        -24.615       NA                  
##   Cognitive ~~                                          
##     Supportive          1.336       NA                  
## 
## Variances:
##                    Estimate    Std.Err  z-value  P(>|z|)
##    .EcFree             21.082       NA                  
##    .PPP                -7.773       NA                  
##    .CAT            -22134.968       NA                  
##    .SN                  1.371       NA                  
##    .Gini                4.705       NA                  
##    .MAS              1714.104       NA                  
##    .ATB                 0.368       NA                  
##    .EI               -231.716       NA                  
##     Religion       -14290.637       NA                  
##     Supportive          0.808       NA                  
##    .UAI               277.092       NA                  
##    .IDV               217.768       NA                  
##    .PBC                 1.490       NA                  
##     Context             3.276       NA                  
##     Cultural        -1375.491       NA                  
##     Cognitive           2.200       NA                  
##    .Ent              -113.180       NA
# reliability(fit)
txtRound(parameterEstimates(fit, ci = TRUE, level = 0.95), 
                   digits=3, excl.cols=1)
##           lhs op        rhs           est    se z pvalue ci.lower ci.upper
## 1     Context =~     EcFree         1e+00 0.000             1.000    1.000
## 2     Context =~        PPP     4.854e+00                                 
## 3     Context =~       Gini    -2.687e+00                                 
## 4    Cultural =~        MAS         1e+00 0.000             1.000    1.000
## 5    Cultural =~        UAI        -6.177                                 
## 6    Cultural =~        CAT     -5.66e+00                                 
## 7    Cultural =~        IDV         6.887                                 
## 8    Religion =~        CAT         1e+00 0.000             1.000    1.000
## 9   Cognitive =~        ATB         1e+00 0.000             1.000    1.000
## 10  Cognitive =~        PBC         3.206                                 
## 11  Cognitive =~         SN         3.084                                 
## 12 Supportive =~         SN         1e+00 0.000             1.000    1.000
## 13        Ent =~         EI         1e+00 0.000             1.000    1.000
## 14     EcFree ~~     EcFree    2.1082e+01                                 
## 15        PPP ~~        PPP    -7.773e+00                                 
## 16        CAT ~~        CAT -2.213497e+04                                 
## 17         SN ~~         SN     1.371e+00                                 
## 18       Gini ~~       Gini     4.705e+00                                 
## 19        MAS ~~        MAS  1.714104e+03                                 
## 20        ATB ~~        ATB         3.678                                 
## 21         EI ~~         EI  -2.31716e+02                                 
## 22   Religion ~~   Religion -1.429064e+04                                 
## 23 Supportive ~~ Supportive         8.076                                 
## 24    Context ~~   Cultural   -1.9753e+01                                 
## 25        Ent  ~    Context     2.523e+00                                 
## 26        Ent  ~   Cultural    -3.244e+00                                 
## 27        Ent  ~  Cognitive  -5.46312e+02                                 
## 28        Ent  ~   Religion         2.532                                 
## 29        Ent  ~ Supportive   9.00826e+02                                 
## 30        UAI ~~        UAI   2.77092e+02                                 
## 31        IDV ~~        IDV   2.17768e+02                                 
## 32        PBC ~~        PBC      1.49e+00                                 
## 33    Context ~~    Context     3.276e+00                                 
## 34   Cultural ~~   Cultural -1.375491e+03                                 
## 35  Cognitive ~~  Cognitive       2.2e+00                                 
## 36        Ent ~~        Ent   -1.1318e+02                                 
## 37    Context ~~   Religion  -1.51147e+02                                 
## 38    Context ~~  Cognitive        -3.058                                 
## 39    Context ~~ Supportive        -2.240                                 
## 40   Cultural ~~   Religion -7.209098e+03                                 
## 41   Cultural ~~  Cognitive        -7.534                                 
## 42   Cultural ~~ Supportive    -3.327e+00                                 
## 43   Religion ~~  Cognitive    -5.124e+00                                 
## 44   Religion ~~ Supportive   -2.4615e+01                                 
## 45  Cognitive ~~ Supportive     1.336e+00
#
# fitm99 = lavaan::sem(EI.AJZEN.model99, data =dat)


pdf("Gustavo_Model.pdf")
semPaths(fit, style="lisrel", 
        whatLabels = "std", edge.label.cex = .6, node.label.cex = .6, 
        label.prop=0.9, edge.label.color = "black", rotation = 4, 
        equalizeManifests = FALSE, optimizeLatRes = TRUE, node.width = 1.5, 
        edge.width = 0.5, shapeMan = "rectangle", shapeLat = "ellipse", 
        shapeInt = "triangle", sizeMan = 4, sizeInt = 2, sizeLat = 4, 
        curve=2, unCol = "#070b8c")
## Warning in sqrt(ETA2): Se han producido NaNs
## Warning in sqrt(ETA2): Se han producido NaNs

## Warning in sqrt(ETA2): Se han producido NaNs
## Warning in qgraph::qgraph(Edgelist, labels = nLab, bidirectional = Bidir, : The
## following arguments are not documented and likely not arguments of qgraph and
## thus ignored: node.label.cex
dev.off()
## png 
##   2
#
#
fitm99 = lavaan::sem(EI.AJZEN.model99, data =dat,
                sample.cov=mcv, estimator = "ML",
                start="Mplus", std.lv=TRUE, 
                missing = "listwise", bootstrap=10000)
## Warning in lav_model_vcov(lavmodel = lavmodel2, lavsamplestats = lavsamplestats, : lavaan WARNING:
##     Could not compute standard errors! The information matrix could
##     not be inverted. This may be a symptom that the model is not
##     identified.
## Warning in lav_object_post_check(object): lavaan WARNING: some estimated ov
## variances are negative
## Warning in lav_object_post_check(object): lavaan WARNING: covariance matrix of latent variables
##                 is not positive definite;
##                 use lavInspect(fit, "cov.lv") to investigate.
summary(fitm99,fit.measures=TRUE,rsquare=TRUE)
## lavaan 0.6-5 ended normally after 126 iterations
## 
##   Estimator                                         ML
##   Optimization method                           NLMINB
##   Number of free parameters                         39
##                                                       
##   Number of observations                          1773
##                                                       
## Model Test User Model:
##                                                        
##   Test statistic                              12709.013
##   Degrees of freedom                                 27
##   P-value (Chi-square)                            0.000
## 
## Model Test Baseline Model:
## 
##   Test statistic                             32290.463
##   Degrees of freedom                                55
##   P-value                                        0.000
## 
## User Model versus Baseline Model:
## 
##   Comparative Fit Index (CFI)                    0.607
##   Tucker-Lewis Index (TLI)                       0.199
## 
## Loglikelihood and Information Criteria:
## 
##   Loglikelihood user model (H0)             -51678.277
##   Loglikelihood unrestricted model (H1)     -45323.771
##                                                       
##   Akaike (AIC)                              103434.554
##   Bayesian (BIC)                            103648.290
##   Sample-size adjusted Bayesian (BIC)       103524.390
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.515
##   90 Percent confidence interval - lower         0.507
##   90 Percent confidence interval - upper         0.522
##   P-value RMSEA <= 0.05                          0.000
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.176
## 
## Parameter Estimates:
## 
##   Information                                 Expected
##   Information saturated (h1) model          Structured
##   Standard errors                             Standard
## 
## Latent Variables:
##                    Estimate  Std.Err  z-value  P(>|z|)
##   Context =~                                          
##     EcFree            1.717       NA                  
##     PPP               8.777       NA                  
##     Gini             -4.828       NA                  
##   Cultural =~                                         
##     MAS              24.718       NA                  
##     UAI              10.647       NA                  
##     CAT              28.331       NA                  
##     IDV              -1.313       NA                  
##   Religion =~                                         
##     CAT               1.970       NA                  
##   Cognitive =~                                        
##     ATB               1.427       NA                  
##     PBC               0.466       NA                  
##     SN                0.804       NA                  
##   Supportive =~                                       
##     SN                0.726       NA                  
##   Ent =~                                              
##     EI                0.699       NA                  
## 
## Regressions:
##                    Estimate  Std.Err  z-value  P(>|z|)
##   Ent ~                                               
##     Context          -0.567       NA                  
##     Cultural         -0.051       NA                  
##     Cognitive         1.775       NA                  
##     Religion         -0.092       NA                  
##     Supportive        0.712       NA                  
## 
## Covariances:
##                    Estimate  Std.Err  z-value  P(>|z|)
##   Context ~~                                          
##     Cultural         -0.532       NA                  
##     Religion         -3.098       NA                  
##     Cognitive        -0.134       NA                  
##     Supportive       -0.058       NA                  
##   Cultural ~~                                         
##     Religion         -0.253       NA                  
##     Cognitive         0.008       NA                  
##     Supportive       -0.175       NA                  
##   Religion ~~                                         
##     Cognitive         0.201       NA                  
##     Supportive       -0.816       NA                  
##   Cognitive ~~                                        
##     Supportive        0.104       NA                  
## 
## Variances:
##                    Estimate  Std.Err  z-value  P(>|z|)
##    .EcFree           21.159       NA                  
##    .PPP              -8.292       NA                  
##    .CAT             312.256       NA                  
##    .SN                0.860       NA                  
##    .Gini              4.860       NA                  
##    .MAS            -144.452       NA                  
##    .ATB               0.395       NA                  
##    .EI                0.299       NA                  
##     Religion          1.000                           
##     Supportive        1.000                           
##    .UAI             158.263       NA                  
##    .IDV             215.976       NA                  
##    .PBC               1.488       NA                  
##     Context           1.000                           
##     Cultural          1.000                           
##     Cognitive         1.000                           
##    .Ent               1.000                           
## 
## R-Square:
##                    Estimate
##     EcFree            0.122
##     PPP                  NA
##     CAT               0.714
##     SN                0.601
##     Gini              0.827
##     MAS                  NA
##     ATB               0.838
##     EI                0.896
##     UAI               0.417
##     IDV               0.008
##     PBC               0.127
##     Ent               0.810
semPaths(fitm99,"Standardized", "Estimates",style = "mx",  
         centerLevels = FALSE, layoutSplit = TRUE)

#
semCors(fit, layout = "spring", cut = 0.3,
esize = 20, titles = TRUE)
## Warning in sqrt(ETA2): Se han producido NaNs
## Warning in sqrt(ETA2): Se han producido NaNs

## Warning in sqrt(ETA2): Se han producido NaNs

Ahora se modela el Esquema propuesto por G Morales el 18/4/2020

#
# PBC =~ V3.3CONTFcil + V3.4CONTPuedo 
# EI  =~ V3.6IEMeta + V3.8IEConvencido + V3.10IEFirmeIntencin

EI.AJZEN.model00 = '
               # Variables Latentes
                Context  =~ EcFree + PPP + Gini 
                Cultural =~ MAS + UAI + CAT + IDV
                Religion =~ CAT 
                Cognitive=~ ATB + PBC + SN
                Ent =~ EI 
              #
                EcFree ~~ EcFree
                PPP ~~ PPP 
                CAT ~~ CAT
                SN  ~~ SN
                Gini ~~ Gini 
                MAS ~~ MAS
                ATB ~~ ATB
                EI ~~ EI
                Religion ~~ Religion
                Context ~~ Cultural
              # Equations
                Ent ~  Context + Cultural  + Cognitive + Religion 
        '

fit00 <- lavaan::cfa(EI.AJZEN.model00, data= dat)
## Warning in lav_model_estimate(lavmodel = lavmodel, lavpartable = lavpartable, :
## lavaan WARNING: the optimizer warns that a solution has NOT been found!
summary(fit00, fit.measures=FALSE)
## lavaan 0.6-5 did NOT end normally after 2076 iterations
## ** WARNING ** Estimates below are most likely unreliable
## 
##   Estimator                                         ML
##   Optimization method                           NLMINB
##   Number of free parameters                         33
##                                                       
##   Number of observations                          1773
##                                                       
## Model Test User Model:
##                                                       
##   Test statistic                                    NA
##   Degrees of freedom                                NA
## 
## Parameter Estimates:
## 
##   Information                                 Expected
##   Information saturated (h1) model          Structured
##   Standard errors                             Standard
## 
## Latent Variables:
##                    Estimate    Std.Err  z-value  P(>|z|)
##   Context =~                                            
##     EcFree              1.000                           
##     PPP                 3.340       NA                  
##     Gini               -1.914       NA                  
##   Cultural =~                                           
##     MAS                 1.000                           
##     UAI             -8891.951       NA                  
##     CAT            -35887.764       NA                  
##     IDV            -13195.187       NA                  
##   Religion =~                                           
##     CAT                 1.000                           
##   Cognitive =~                                          
##     ATB                 1.000                           
##     PBC                 0.364       NA                  
##     SN                  0.856       NA                  
##   Ent =~                                                
##     EI                  1.000                           
## 
## Regressions:
##                    Estimate    Std.Err  z-value  P(>|z|)
##   Ent ~                                                 
##     Context            -0.001       NA                  
##     Cultural         -188.314       NA                  
##     Cognitive           1.238       NA                  
##     Religion            0.006       NA                  
## 
## Covariances:
##                    Estimate    Std.Err  z-value  P(>|z|)
##   Context ~~                                            
##     Cultural           -0.000       NA                  
##     Religion          -66.521       NA                  
##     Cognitive          -0.634       NA                  
##   Cultural ~~                                           
##     Religion           -0.041       NA                  
##     Cognitive           0.000       NA                  
##   Religion ~~                                           
##     Cognitive           7.384       NA                  
## 
## Variances:
##                    Estimate    Std.Err  z-value  P(>|z|)
##    .EcFree             17.547       NA                  
##    .PPP                -4.403       NA                  
##    .CAT              -117.569       NA                  
##    .SN                  1.049       NA                  
##    .Gini                4.137       NA                  
##    .MAS               466.560       NA                  
##    .ATB                 0.919       NA                  
##    .EI                  0.782       NA                  
##     Religion         -788.150       NA                  
##    .UAI               328.257       NA                  
##    .IDV               342.399       NA                  
##    .PBC                 1.506       NA                  
##     Context             6.559       NA                  
##     Cultural           -0.000       NA                  
##     Cognitive           1.511       NA                  
##    .Ent                -0.267       NA
# reliability(fit)
txtRound(parameterEstimates(fit00, ci = TRUE, level = 0.95), 
                   digits=3, excl.cols=1)
##          lhs op       rhs           est    se z pvalue ci.lower ci.upper
## 1    Context =~    EcFree         1e+00 0.000             1.000    1.000
## 2    Context =~       PPP      3.34e+00                                 
## 3    Context =~      Gini    -1.914e+00                                 
## 4   Cultural =~       MAS         1e+00 0.000             1.000    1.000
## 5   Cultural =~       UAI -8.891951e+03                                 
## 6   Cultural =~       CAT -3.588776e+04                                 
## 7   Cultural =~       IDV -1.319519e+04                                 
## 8   Religion =~       CAT         1e+00 0.000             1.000    1.000
## 9  Cognitive =~       ATB         1e+00 0.000             1.000    1.000
## 10 Cognitive =~       PBC         3.636                                 
## 11 Cognitive =~        SN         8.556                                 
## 12       Ent =~        EI         1e+00 0.000             1.000    1.000
## 13    EcFree ~~    EcFree    1.7547e+01                                 
## 14       PPP ~~       PPP    -4.403e+00                                 
## 15       CAT ~~       CAT  -1.17569e+02                                 
## 16        SN ~~        SN     1.049e+00                                 
## 17      Gini ~~      Gini     4.137e+00                                 
## 18       MAS ~~       MAS    4.6656e+02                                 
## 19       ATB ~~       ATB         9.192                                 
## 20        EI ~~        EI         7.819                                 
## 21  Religion ~~  Religion   -7.8815e+02                                 
## 22   Context ~~  Cultural        -2.835                                 
## 23       Ent  ~   Context        -1.463                                 
## 24       Ent  ~  Cultural  -1.88314e+02                                 
## 25       Ent  ~ Cognitive     1.238e+00                                 
## 26       Ent  ~  Religion         6.047                                 
## 27       UAI ~~       UAI   3.28257e+02                                 
## 28       IDV ~~       IDV   3.42399e+02                                 
## 29       PBC ~~       PBC     1.506e+00                                 
## 30   Context ~~   Context     6.559e+00                                 
## 31  Cultural ~~  Cultural        -7.163                                 
## 32 Cognitive ~~ Cognitive     1.511e+00                                 
## 33       Ent ~~       Ent        -2.671                                 
## 34   Context ~~  Religion   -6.6521e+01                                 
## 35   Context ~~ Cognitive        -6.340                                 
## 36  Cultural ~~  Religion        -4.066                                 
## 37  Cultural ~~ Cognitive         2.447                                 
## 38  Religion ~~ Cognitive     7.384e+00
#
# fitm99 = lavaan::sem(EI.AJZEN.model99, data =dat)


pdf("Gustavo_Model00.pdf")
semPaths(fit00, style="lisrel", 
        whatLabels = "std", edge.label.cex = .6, node.label.cex = .6, 
        label.prop=0.9, edge.label.color = "black", rotation = 4, 
        equalizeManifests = FALSE, optimizeLatRes = TRUE, node.width = 1.5, 
        edge.width = 0.5, shapeMan = "rectangle", shapeLat = "ellipse", 
        shapeInt = "triangle", sizeMan = 4, sizeInt = 2, sizeLat = 4, 
        curve=2, unCol = "#070b8c")
## Warning in sqrt(ETA2): Se han producido NaNs
## Warning in sqrt(ETA2): Se han producido NaNs

## Warning in sqrt(ETA2): Se han producido NaNs
## Warning in qgraph::qgraph(Edgelist, labels = nLab, bidirectional = Bidir, : The
## following arguments are not documented and likely not arguments of qgraph and
## thus ignored: node.label.cex
dev.off()
## png 
##   2
#
#
fitm00 = lavaan::sem(EI.AJZEN.model00, data =dat,
                sample.cov=mcv, estimator = "ML",
                start="Mplus", std.lv=TRUE, 
                missing = "listwise", bootstrap=10000)
## Warning in lav_model_vcov(lavmodel = lavmodel2, lavsamplestats = lavsamplestats, : lavaan WARNING:
##     Could not compute standard errors! The information matrix could
##     not be inverted. This may be a symptom that the model is not
##     identified.
## Warning in lav_object_post_check(object): lavaan WARNING: some estimated ov
## variances are negative
## Warning in lav_object_post_check(object): lavaan WARNING: covariance matrix of latent variables
##                 is not positive definite;
##                 use lavInspect(fit, "cov.lv") to investigate.
summary(fitm00,fit.measures=TRUE,rsquare=TRUE)
## lavaan 0.6-5 ended normally after 104 iterations
## 
##   Estimator                                         ML
##   Optimization method                           NLMINB
##   Number of free parameters                         33
##                                                       
##   Number of observations                          1773
##                                                       
## Model Test User Model:
##                                                        
##   Test statistic                              12779.802
##   Degrees of freedom                                 33
##   P-value (Chi-square)                            0.000
## 
## Model Test Baseline Model:
## 
##   Test statistic                             32290.463
##   Degrees of freedom                                55
##   P-value                                        0.000
## 
## User Model versus Baseline Model:
## 
##   Comparative Fit Index (CFI)                    0.605
##   Tucker-Lewis Index (TLI)                       0.341
## 
## Loglikelihood and Information Criteria:
## 
##   Loglikelihood user model (H0)             -51713.672
##   Loglikelihood unrestricted model (H1)     -45323.771
##                                                       
##   Akaike (AIC)                              103493.343
##   Bayesian (BIC)                            103674.197
##   Sample-size adjusted Bayesian (BIC)       103569.359
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.467
##   90 Percent confidence interval - lower         0.460
##   90 Percent confidence interval - upper         0.474
##   P-value RMSEA <= 0.05                          0.000
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.177
## 
## Parameter Estimates:
## 
##   Information                                 Expected
##   Information saturated (h1) model          Structured
##   Standard errors                             Standard
## 
## Latent Variables:
##                    Estimate  Std.Err  z-value  P(>|z|)
##   Context =~                                          
##     EcFree            1.724       NA                  
##     PPP               8.771       NA                  
##     Gini             -4.831       NA                  
##   Cultural =~                                         
##     MAS              24.720       NA                  
##     UAI              10.647       NA                  
##     CAT              28.793       NA                  
##     IDV              -1.311       NA                  
##   Religion =~                                         
##     CAT               1.333       NA                  
##   Cognitive =~                                        
##     ATB               1.231       NA                  
##     PBC               0.446       NA                  
##     SN                1.051       NA                  
##   Ent =~                                              
##     EI                0.670       NA                  
## 
## Regressions:
##                    Estimate  Std.Err  z-value  P(>|z|)
##   Ent ~                                               
##     Context          -0.505       NA                  
##     Cultural         -0.058       NA                  
##     Cognitive         2.189       NA                  
##     Religion         -0.058       NA                  
## 
## Covariances:
##                    Estimate  Std.Err  z-value  P(>|z|)
##   Context ~~                                          
##     Cultural         -0.534       NA                  
##     Religion         -4.405       NA                  
##     Cognitive        -0.155       NA                  
##   Cultural ~~                                         
##     Religion         -0.723       NA                  
##     Cognitive        -0.038       NA                  
##   Religion ~~                                         
##     Cognitive        -0.013       NA                  
## 
## Variances:
##                    Estimate  Std.Err  z-value  P(>|z|)
##    .EcFree           21.134       NA                  
##    .PPP              -8.181       NA                  
##    .CAT             315.185       NA                  
##    .SN                1.051       NA                  
##    .Gini              4.829       NA                  
##    .MAS            -144.529       NA                  
##    .ATB               0.915       NA                  
##    .EI                0.123       NA                  
##     Religion          1.000                           
##    .UAI             158.266       NA                  
##    .IDV             215.981       NA                  
##    .PBC               1.506       NA                  
##     Context           1.000                           
##     Cultural          1.000                           
##     Cognitive         1.000                           
##    .Ent               1.000                           
## 
## R-Square:
##                    Estimate
##     EcFree            0.123
##     PPP                  NA
##     CAT               0.711
##     SN                0.512
##     Gini              0.829
##     MAS                  NA
##     ATB               0.623
##     EI                0.957
##     UAI               0.417
##     IDV               0.008
##     PBC               0.117
##     Ent               0.836
semPaths(fitm00,"Standardized", "Estimates",style = "mx",  
         centerLevels = FALSE, layoutSplit = TRUE)

#
semCors(fit00, layout = "spring", cut = 0.3,esize = 20, titles = TRUE)
## Warning in sqrt(ETA2): Se han producido NaNs
## Warning in sqrt(ETA2): Se han producido NaNs

## Warning in sqrt(ETA2): Se han producido NaNs

=============================================================================

EI.AJZEN.model99 = ’ # Variables Latentes Context =~ EcFree + PPP + Gini Cultural =~ IDV + MAS + UAI + CAT Religion =~ CAT Cognitive=~ ATB + PBC + SN Supportive=~ SN # Regresión EI ~ Context + Cultural + Religion + Cognitive + Supportive # Correlación de Residuos Context ~~ Context Cultural~~ Cultural Religion~~ Religion Cognitive~~ Cognitive Supportive~~ Supportive EI ~~ 1 * EI ’

fitm99 = lavaan::sem(EI.AJZEN.model99, data =ddnaddf[,obs.variables99], std.lv=TRUE, sample.cov=mcv, estimator = “ML”, start=“Mplus”,
missing = “listwise”, bootstrap=10000)

semPaths(fitm99,“Estandardized”, “Estimates”, what=“par”, ask=FALSE, layout=“tree2”,residuals=TRUE, style=“OpenMx”, sizeMan=8, edge.label.cex=0.9)