Bibliotecas

  library(knitr)
  library(semPlot)
  library(tidyverse)
  library(psych)
  library(lavaan)

Dados

# abra o arquivo direto da internet
con<-url("http://www.labape.com.br/rprimi/SEM/exerc18/ex3b.RData") 
load(con) 

# explorando a base
  names(scores)
##   [1] "banco"            "cod_suj"          "Data de nasc."   
##   [4] "data.aplic"       "Idade0"           "idade1"          
##   [7] "Termo"            "sujeito"          "serie"           
##  [10] "escola"           "turma"            "Sexo"            
##  [13] "Esc. Mãe"         "port"             "mat"             
##  [16] "cloze"            "A_o"              "C_o"             
##  [19] "E_o"              "N_o"              "O_o"             
##  [22] "A_c"              "C_c"              "E_c"             
##  [25] "N_c"              "O_c"              "A_z"             
##  [28] "C_z"              "E_z"              "N_z"             
##  [31] "O_z"              "antonym.rc"       "antonym.cntrst_A"
##  [34] "antonym.cntrst_C" "antonym.cntrst_E" "antonym.cntrst_N"
##  [37] "antonym.cntrst_O" "mean_A"           "mean_C"          
##  [40] "mean_E"           "mean_N"           "mean_O"          
##  [43] "sd_A"             "sd_C"             "sd_E"            
##  [46] "sd_N"             "sd_O"             "antonym.rc_A"    
##  [49] "antonym.rc_C"     "antonym.rc_E"     "antonym.rc_N"    
##  [52] "antonym.rc_O"     "nse"              "A_1_o"           
##  [55] "C_1_o"            "E_1_o"            "N_1_o"           
##  [58] "O_1_o"            "A_1_c"            "C_1_c"           
##  [61] "E_1_c"            "N_1_c"            "O_1_c"           
##  [64] "A_1_z"            "C_1_z"            "E_1_z"           
##  [67] "N_1_z"            "O_1_z"            "A_0_o"           
##  [70] "C_0_o"            "E_0_o"            "N_0_o"           
##  [73] "O_0_o"            "A_0_c"            "C_0_c"           
##  [76] "E_0_c"            "N_0_c"            "O_0_c"           
##  [79] "A_0_z"            "C_0_z"            "E_0_z"           
##  [82] "N_0_z"            "O_0_z"            "cexp_o"          
##  [85] "comlrn_o"         "coplrn_o"         "cstrat_o"        
##  [88] "effper_o"         "elab_o"           "insmot_o"        
##  [91] "intmat_o"         "intrea_o"         "memor_o"         
##  [94] "scacad_o"         "scmath_o"         "scverb_o"        
##  [97] "selfef_o"         "cexp_c"           "comlrn_c"        
## [100] "coplrn_c"         "cstrat_c"         "effper_c"        
## [103] "elab_c"           "insmot_c"         "intmat_c"        
## [106] "intrea_c"         "memor_c"          "scacad_c"        
## [109] "scmath_c"         "scverb_c"         "selfef_c"        
## [112] "cexp_z"           "comlrn_z"         "coplrn_z"        
## [115] "cstrat_z"         "effper_z"         "elab_z"          
## [118] "insmot_z"         "intmat_z"         "intrea_z"        
## [121] "memor_z"          "scacad_z"         "scmath_z"        
## [124] "scverb_z"         "selfef_z"         "means"           
## [127] "sd"
  vars <- scores %>% select(contains("_c")) %>% select(10:33) %>% names 

  vars_scales <- names(dic)[c(3, 5, 20:22) ]
  
  dic %>% select(vars_scales) %>% filter((teste == "senna" | teste=="sal") & factor != "chk_0") %>%
    group_by(factor) %>% summarise_all("first") %>% arrange(desc(teste),port_text1) %>%
    kable()
factor teste port_text1 engl_text1 engl_text2
A_0 senna NA I care about what happens to other people. NA
A_1 senna NA i.115.A.Cmp.11__How much do you manage to be nice to other people? NA
C_0 senna NA I am a dedicated [add: and ambitious/hardworking] student. NA
C_1 senna NA How well do you manage to put the (necessary) time and effort into your work/necessary to be successful? NA
E_0 senna NA I am happy and lively NA
E_1 senna NA i.297.E.Act.11__Do you often do funny things to make your friends laugh? NA
N_0 senna NA I lose control easily whenever I don’t get what I want. NA
N_1 senna NA i.449.N.Vol.11__How easily are you able to stay calm, without exploding, when you are provoked? NA
O_0 senna NA Is interested in various types of art, music, or literature NA
O_1 senna NA i.482.O.Aes.11__How easily do you find it to create things artistically, like a poem for example? NA
cexp sal Auto-conceito Self-Belief Control Expectation
comlrn sal Competências sociais auto reportadas Self-report of social competencies Preference for competitive learning
coplrn sal Competências sociais auto reportadas Self-report of social competencies Preference for co-operative learning
scacad sal Confiança em si Self-related beliefs Academic self-concept
scmath sal Confiança em si Self-related beliefs Self-concept of mathematical competencies
scverb sal Confiança em si Self-related beliefs Self-concept of verbal competencies
selfef sal Confiança em si Self-related beliefs Self-efficacy
cstrat sal Estratégias de Aprendizagem Learning Strategies Control Strategies
elab sal Estratégias de Aprendizagem Learning Strategies Elaboration Strategies
memor sal Estratégias de Aprendizagem Learning Strategies Memorisation Strategies
effper sal Motivação Motivation Effort and persistence in learning
insmot sal Motivação Motivation Instrumental Motivation
intmat sal Motivação Motivation Interest in math
intrea sal Motivação Motivation Interest in reading
Correlação entre as variáveis
  scores %>% select(vars) %>% corr.test 
## Call:corr.test(x = .)
## Correlation matrix 
##          A_1_c C_1_c E_1_c N_1_c O_1_c A_0_c C_0_c E_0_c N_0_c O_0_c
## A_1_c     1.00  0.50  0.31  0.33  0.40  0.55  0.28  0.40  0.31  0.33
## C_1_c     0.50  1.00  0.25  0.42  0.50  0.52  0.66  0.48  0.37  0.47
## E_1_c     0.31  0.25  1.00  0.20  0.34  0.18  0.24  0.22  0.12  0.40
## N_1_c     0.33  0.42  0.20  1.00  0.46  0.33  0.20  0.27  0.64  0.32
## O_1_c     0.40  0.50  0.34  0.46  1.00  0.28  0.33  0.32  0.42  0.50
## A_0_c     0.55  0.52  0.18  0.33  0.28  1.00  0.45  0.34  0.34  0.36
## C_0_c     0.28  0.66  0.24  0.20  0.33  0.45  1.00  0.41  0.24  0.32
## E_0_c     0.40  0.48  0.22  0.27  0.32  0.34  0.41  1.00  0.30  0.33
## N_0_c     0.31  0.37  0.12  0.64  0.42  0.34  0.24  0.30  1.00  0.30
## O_0_c     0.33  0.47  0.40  0.32  0.50  0.36  0.32  0.33  0.30  1.00
## cexp_c    0.36  0.53  0.29  0.37  0.38  0.41  0.43  0.36  0.32  0.36
## comlrn_c  0.10  0.22  0.06  0.07  0.14  0.01  0.10  0.03  0.03  0.01
## coplrn_c  0.40  0.46  0.25  0.19  0.36  0.46  0.35  0.28  0.24  0.33
## cstrat_c  0.35  0.58  0.33  0.27  0.40  0.43  0.48  0.34  0.24  0.43
## effper_c  0.38  0.66  0.29  0.33  0.38  0.43  0.49  0.36  0.25  0.38
## elab_c    0.30  0.54  0.28  0.35  0.43  0.35  0.48  0.34  0.32  0.39
## insmot_c  0.27  0.43  0.26  0.20  0.27  0.25  0.26  0.15  0.16  0.36
## intmat_c  0.35  0.60  0.20  0.31  0.35  0.37  0.47  0.28  0.27  0.26
## intrea_c  0.35  0.50  0.29  0.27  0.41  0.43  0.41  0.28  0.22  0.38
## memor_c   0.32  0.54  0.26  0.27  0.33  0.32  0.44  0.31  0.30  0.33
## scacad_c  0.24  0.60  0.15  0.25  0.32  0.38  0.54  0.31  0.24  0.28
## scmath_c  0.25  0.50  0.15  0.13  0.22  0.28  0.43  0.26  0.17  0.24
## scverb_c  0.24  0.49  0.28  0.17  0.30  0.30  0.50  0.28  0.27  0.33
## selfef_c  0.37  0.56  0.27  0.30  0.36  0.36  0.47  0.40  0.25  0.40
##          cexp_c comlrn_c coplrn_c cstrat_c effper_c elab_c insmot_c
## A_1_c      0.36     0.10     0.40     0.35     0.38   0.30     0.27
## C_1_c      0.53     0.22     0.46     0.58     0.66   0.54     0.43
## E_1_c      0.29     0.06     0.25     0.33     0.29   0.28     0.26
## N_1_c      0.37     0.07     0.19     0.27     0.33   0.35     0.20
## O_1_c      0.38     0.14     0.36     0.40     0.38   0.43     0.27
## A_0_c      0.41     0.01     0.46     0.43     0.43   0.35     0.25
## C_0_c      0.43     0.10     0.35     0.48     0.49   0.48     0.26
## E_0_c      0.36     0.03     0.28     0.34     0.36   0.34     0.15
## N_0_c      0.32     0.03     0.24     0.24     0.25   0.32     0.16
## O_0_c      0.36     0.01     0.33     0.43     0.38   0.39     0.36
## cexp_c     1.00     0.07     0.48     0.58     0.63   0.61     0.37
## comlrn_c   0.07     1.00     0.10     0.22     0.12   0.13     0.03
## coplrn_c   0.48     0.10     1.00     0.44     0.49   0.45     0.35
## cstrat_c   0.58     0.22     0.44     1.00     0.67   0.74     0.53
## effper_c   0.63     0.12     0.49     0.67     1.00   0.62     0.49
## elab_c     0.61     0.13     0.45     0.74     0.62   1.00     0.49
## insmot_c   0.37     0.03     0.35     0.53     0.49   0.49     1.00
## intmat_c   0.51     0.17     0.53     0.50     0.55   0.50     0.41
## intrea_c   0.49     0.19     0.50     0.49     0.44   0.45     0.31
## memor_c    0.56     0.13     0.45     0.65     0.56   0.67     0.50
## scacad_c   0.60     0.14     0.49     0.59     0.61   0.54     0.39
## scmath_c   0.50     0.14     0.36     0.47     0.56   0.47     0.34
## scverb_c   0.51     0.15     0.38     0.48     0.42   0.34     0.32
## selfef_c   0.67     0.17     0.48     0.63     0.66   0.53     0.40
##          intmat_c intrea_c memor_c scacad_c scmath_c scverb_c selfef_c
## A_1_c        0.35     0.35    0.32     0.24     0.25     0.24     0.37
## C_1_c        0.60     0.50    0.54     0.60     0.50     0.49     0.56
## E_1_c        0.20     0.29    0.26     0.15     0.15     0.28     0.27
## N_1_c        0.31     0.27    0.27     0.25     0.13     0.17     0.30
## O_1_c        0.35     0.41    0.33     0.32     0.22     0.30     0.36
## A_0_c        0.37     0.43    0.32     0.38     0.28     0.30     0.36
## C_0_c        0.47     0.41    0.44     0.54     0.43     0.50     0.47
## E_0_c        0.28     0.28    0.31     0.31     0.26     0.28     0.40
## N_0_c        0.27     0.22    0.30     0.24     0.17     0.27     0.25
## O_0_c        0.26     0.38    0.33     0.28     0.24     0.33     0.40
## cexp_c       0.51     0.49    0.56     0.60     0.50     0.51     0.67
## comlrn_c     0.17     0.19    0.13     0.14     0.14     0.15     0.17
## coplrn_c     0.53     0.50    0.45     0.49     0.36     0.38     0.48
## cstrat_c     0.50     0.49    0.65     0.59     0.47     0.48     0.63
## effper_c     0.55     0.44    0.56     0.61     0.56     0.42     0.66
## elab_c       0.50     0.45    0.67     0.54     0.47     0.34     0.53
## insmot_c     0.41     0.31    0.50     0.39     0.34     0.32     0.40
## intmat_c     1.00     0.52    0.48     0.62     0.67     0.42     0.55
## intrea_c     0.52     1.00    0.46     0.50     0.36     0.47     0.50
## memor_c      0.48     0.46    1.00     0.52     0.45     0.48     0.55
## scacad_c     0.62     0.50    0.52     1.00     0.58     0.52     0.59
## scmath_c     0.67     0.36    0.45     0.58     1.00     0.36     0.58
## scverb_c     0.42     0.47    0.48     0.52     0.36     1.00     0.53
## selfef_c     0.55     0.50    0.55     0.59     0.58     0.53     1.00
## Sample Size 
##          A_1_c C_1_c E_1_c N_1_c O_1_c A_0_c C_0_c E_0_c N_0_c O_0_c
## A_1_c      168   168   168   168   168   168   168   168   168   168
## C_1_c      168   168   168   168   168   168   168   168   168   168
## E_1_c      168   168   168   168   168   168   168   168   168   168
## N_1_c      168   168   168   168   168   168   168   168   168   168
## O_1_c      168   168   168   168   168   168   168   168   168   168
## A_0_c      168   168   168   168   168   168   168   168   168   168
## C_0_c      168   168   168   168   168   168   168   168   168   168
## E_0_c      168   168   168   168   168   168   168   168   168   168
## N_0_c      168   168   168   168   168   168   168   168   168   168
## O_0_c      168   168   168   168   168   168   168   168   168   168
## cexp_c     168   168   168   168   168   168   168   168   168   168
## comlrn_c   167   167   167   167   167   167   167   167   167   167
## coplrn_c   167   167   167   167   167   167   167   167   167   167
## cstrat_c   168   168   168   168   168   168   168   168   168   168
## effper_c   168   168   168   168   168   168   168   168   168   168
## elab_c     168   168   168   168   168   168   168   168   168   168
## insmot_c   168   168   168   168   168   168   168   168   168   168
## intmat_c   167   167   167   167   167   167   167   167   167   167
## intrea_c   167   167   167   167   167   167   167   167   167   167
## memor_c    168   168   168   168   168   168   168   168   168   168
## scacad_c   167   167   167   167   167   167   167   167   167   167
## scmath_c   167   167   167   167   167   167   167   167   167   167
## scverb_c   167   167   167   167   167   167   167   167   167   167
## selfef_c   168   168   168   168   168   168   168   168   168   168
##          cexp_c comlrn_c coplrn_c cstrat_c effper_c elab_c insmot_c
## A_1_c       168      167      167      168      168    168      168
## C_1_c       168      167      167      168      168    168      168
## E_1_c       168      167      167      168      168    168      168
## N_1_c       168      167      167      168      168    168      168
## O_1_c       168      167      167      168      168    168      168
## A_0_c       168      167      167      168      168    168      168
## C_0_c       168      167      167      168      168    168      168
## E_0_c       168      167      167      168      168    168      168
## N_0_c       168      167      167      168      168    168      168
## O_0_c       168      167      167      168      168    168      168
## cexp_c      168      167      167      168      168    168      168
## comlrn_c    167      167      167      167      167    167      167
## coplrn_c    167      167      167      167      167    167      167
## cstrat_c    168      167      167      168      168    168      168
## effper_c    168      167      167      168      168    168      168
## elab_c      168      167      167      168      168    168      168
## insmot_c    168      167      167      168      168    168      168
## intmat_c    167      167      167      167      167    167      167
## intrea_c    167      167      167      167      167    167      167
## memor_c     168      167      167      168      168    168      168
## scacad_c    167      167      167      167      167    167      167
## scmath_c    167      167      167      167      167    167      167
## scverb_c    167      167      167      167      167    167      167
## selfef_c    168      167      167      168      168    168      168
##          intmat_c intrea_c memor_c scacad_c scmath_c scverb_c selfef_c
## A_1_c         167      167     168      167      167      167      168
## C_1_c         167      167     168      167      167      167      168
## E_1_c         167      167     168      167      167      167      168
## N_1_c         167      167     168      167      167      167      168
## O_1_c         167      167     168      167      167      167      168
## A_0_c         167      167     168      167      167      167      168
## C_0_c         167      167     168      167      167      167      168
## E_0_c         167      167     168      167      167      167      168
## N_0_c         167      167     168      167      167      167      168
## O_0_c         167      167     168      167      167      167      168
## cexp_c        167      167     168      167      167      167      168
## comlrn_c      167      167     167      167      167      167      167
## coplrn_c      167      167     167      167      167      167      167
## cstrat_c      167      167     168      167      167      167      168
## effper_c      167      167     168      167      167      167      168
## elab_c        167      167     168      167      167      167      168
## insmot_c      167      167     168      167      167      167      168
## intmat_c      167      167     167      167      167      167      167
## intrea_c      167      167     167      167      167      167      167
## memor_c       167      167     168      167      167      167      168
## scacad_c      167      167     167      167      167      167      167
## scmath_c      167      167     167      167      167      167      167
## scverb_c      167      167     167      167      167      167      167
## selfef_c      167      167     168      167      167      167      168
## Probability values (Entries above the diagonal are adjusted for multiple tests.) 
##          A_1_c C_1_c E_1_c N_1_c O_1_c A_0_c C_0_c E_0_c N_0_c O_0_c
## A_1_c     0.00     0  0.00  0.00  0.00  0.00  0.02  0.00  0.00  0.00
## C_1_c     0.00     0  0.05  0.00  0.00  0.00  0.00  0.00  0.00  0.00
## E_1_c     0.00     0  0.00  0.29  0.00  0.51  0.08  0.14  1.00  0.00
## N_1_c     0.00     0  0.01  0.00  0.00  0.00  0.29  0.03  0.00  0.00
## O_1_c     0.00     0  0.00  0.00  0.00  0.02  0.00  0.00  0.00  0.00
## A_0_c     0.00     0  0.02  0.00  0.00  0.00  0.00  0.00  0.00  0.00
## C_0_c     0.00     0  0.00  0.01  0.00  0.00  0.00  0.00  0.07  0.00
## E_0_c     0.00     0  0.00  0.00  0.00  0.00  0.00  0.00  0.01  0.00
## N_0_c     0.00     0  0.12  0.00  0.00  0.00  0.00  0.00  0.00  0.01
## O_0_c     0.00     0  0.00  0.00  0.00  0.00  0.00  0.00  0.00  0.00
## cexp_c    0.00     0  0.00  0.00  0.00  0.00  0.00  0.00  0.00  0.00
## comlrn_c  0.21     0  0.46  0.35  0.07  0.90  0.18  0.73  0.67  0.87
## coplrn_c  0.00     0  0.00  0.01  0.00  0.00  0.00  0.00  0.00  0.00
## cstrat_c  0.00     0  0.00  0.00  0.00  0.00  0.00  0.00  0.00  0.00
## effper_c  0.00     0  0.00  0.00  0.00  0.00  0.00  0.00  0.00  0.00
## elab_c    0.00     0  0.00  0.00  0.00  0.00  0.00  0.00  0.00  0.00
## insmot_c  0.00     0  0.00  0.01  0.00  0.00  0.00  0.05  0.04  0.00
## intmat_c  0.00     0  0.01  0.00  0.00  0.00  0.00  0.00  0.00  0.00
## intrea_c  0.00     0  0.00  0.00  0.00  0.00  0.00  0.00  0.00  0.00
## memor_c   0.00     0  0.00  0.00  0.00  0.00  0.00  0.00  0.00  0.00
## scacad_c  0.00     0  0.05  0.00  0.00  0.00  0.00  0.00  0.00  0.00
## scmath_c  0.00     0  0.06  0.09  0.00  0.00  0.00  0.00  0.03  0.00
## scverb_c  0.00     0  0.00  0.03  0.00  0.00  0.00  0.00  0.00  0.00
## selfef_c  0.00     0  0.00  0.00  0.00  0.00  0.00  0.00  0.00  0.00
##          cexp_c comlrn_c coplrn_c cstrat_c effper_c elab_c insmot_c
## A_1_c      0.00     1.00     0.00     0.00     0.00   0.01     0.03
## C_1_c      0.00     0.14     0.00     0.00     0.00   0.00     0.00
## E_1_c      0.01     1.00     0.05     0.00     0.01   0.02     0.04
## N_1_c      0.00     1.00     0.38     0.03     0.00   0.00     0.29
## O_1_c      0.00     1.00     0.00     0.00     0.00   0.00     0.02
## A_0_c      0.00     1.00     0.00     0.00     0.00   0.00     0.06
## C_0_c      0.00     1.00     0.00     0.00     0.00   0.00     0.04
## E_0_c      0.00     1.00     0.02     0.00     0.00   0.00     1.00
## N_0_c      0.00     1.00     0.08     0.09     0.06   0.00     0.89
## O_0_c      0.00     1.00     0.00     0.00     0.00   0.00     0.00
## cexp_c     0.00     1.00     0.00     0.00     0.00   0.00     0.00
## comlrn_c   0.38     0.00     1.00     0.14     1.00   1.00     1.00
## coplrn_c   0.00     0.19     0.00     0.00     0.00   0.00     0.00
## cstrat_c   0.00     0.00     0.00     0.00     0.00   0.00     0.00
## effper_c   0.00     0.12     0.00     0.00     0.00   0.00     0.00
## elab_c     0.00     0.09     0.00     0.00     0.00   0.00     0.00
## insmot_c   0.00     0.68     0.00     0.00     0.00   0.00     0.00
## intmat_c   0.00     0.03     0.00     0.00     0.00   0.00     0.00
## intrea_c   0.00     0.01     0.00     0.00     0.00   0.00     0.00
## memor_c    0.00     0.10     0.00     0.00     0.00   0.00     0.00
## scacad_c   0.00     0.07     0.00     0.00     0.00   0.00     0.00
## scmath_c   0.00     0.06     0.00     0.00     0.00   0.00     0.00
## scverb_c   0.00     0.05     0.00     0.00     0.00   0.00     0.00
## selfef_c   0.00     0.02     0.00     0.00     0.00   0.00     0.00
##          intmat_c intrea_c memor_c scacad_c scmath_c scverb_c selfef_c
## A_1_c        0.00     0.00    0.00     0.07     0.06     0.07     0.00
## C_1_c        0.00     0.00    0.00     0.00     0.00     0.00     0.00
## E_1_c        0.35     0.01    0.04     1.00     1.00     0.02     0.03
## N_1_c        0.00     0.03    0.03     0.05     1.00     0.78     0.01
## O_1_c        0.00     0.00    0.00     0.00     0.14     0.01     0.00
## A_0_c        0.00     0.00    0.00     0.00     0.02     0.01     0.00
## C_0_c        0.00     0.00    0.00     0.00     0.00     0.00     0.00
## E_0_c        0.02     0.02    0.00     0.00     0.05     0.02     0.00
## N_0_c        0.03     0.15    0.01     0.08     0.82     0.03     0.06
## O_0_c        0.05     0.00    0.00     0.02     0.09     0.00     0.00
## cexp_c       0.00     0.00    0.00     0.00     0.00     0.00     0.00
## comlrn_c     0.78     0.36    1.00     1.00     1.00     1.00     0.66
## coplrn_c     0.00     0.00    0.00     0.00     0.00     0.00     0.00
## cstrat_c     0.00     0.00    0.00     0.00     0.00     0.00     0.00
## effper_c     0.00     0.00    0.00     0.00     0.00     0.00     0.00
## elab_c       0.00     0.00    0.00     0.00     0.00     0.00     0.00
## insmot_c     0.00     0.00    0.00     0.00     0.00     0.00     0.00
## intmat_c     0.00     0.00    0.00     0.00     0.00     0.00     0.00
## intrea_c     0.00     0.00    0.00     0.00     0.00     0.00     0.00
## memor_c      0.00     0.00    0.00     0.00     0.00     0.00     0.00
## scacad_c     0.00     0.00    0.00     0.00     0.00     0.00     0.00
## scmath_c     0.00     0.00    0.00     0.00     0.00     0.00     0.00
## scverb_c     0.00     0.00    0.00     0.00     0.00     0.00     0.00
## selfef_c     0.00     0.00    0.00     0.00     0.00     0.00     0.00
## 
##  To see confidence intervals of the correlations, print with the short=FALSE option
  r <- scores %>% select(vars) %>% corr.test 
  r$r %>% kable(digits = 2)
A_1_c C_1_c E_1_c N_1_c O_1_c A_0_c C_0_c E_0_c N_0_c O_0_c cexp_c comlrn_c coplrn_c cstrat_c effper_c elab_c insmot_c intmat_c intrea_c memor_c scacad_c scmath_c scverb_c selfef_c
A_1_c 1.00 0.50 0.31 0.33 0.40 0.55 0.28 0.40 0.31 0.33 0.36 0.10 0.40 0.35 0.38 0.30 0.27 0.35 0.35 0.32 0.24 0.25 0.24 0.37
C_1_c 0.50 1.00 0.25 0.42 0.50 0.52 0.66 0.48 0.37 0.47 0.53 0.22 0.46 0.58 0.66 0.54 0.43 0.60 0.50 0.54 0.60 0.50 0.49 0.56
E_1_c 0.31 0.25 1.00 0.20 0.34 0.18 0.24 0.22 0.12 0.40 0.29 0.06 0.25 0.33 0.29 0.28 0.26 0.20 0.29 0.26 0.15 0.15 0.28 0.27
N_1_c 0.33 0.42 0.20 1.00 0.46 0.33 0.20 0.27 0.64 0.32 0.37 0.07 0.19 0.27 0.33 0.35 0.20 0.31 0.27 0.27 0.25 0.13 0.17 0.30
O_1_c 0.40 0.50 0.34 0.46 1.00 0.28 0.33 0.32 0.42 0.50 0.38 0.14 0.36 0.40 0.38 0.43 0.27 0.35 0.41 0.33 0.32 0.22 0.30 0.36
A_0_c 0.55 0.52 0.18 0.33 0.28 1.00 0.45 0.34 0.34 0.36 0.41 0.01 0.46 0.43 0.43 0.35 0.25 0.37 0.43 0.32 0.38 0.28 0.30 0.36
C_0_c 0.28 0.66 0.24 0.20 0.33 0.45 1.00 0.41 0.24 0.32 0.43 0.10 0.35 0.48 0.49 0.48 0.26 0.47 0.41 0.44 0.54 0.43 0.50 0.47
E_0_c 0.40 0.48 0.22 0.27 0.32 0.34 0.41 1.00 0.30 0.33 0.36 0.03 0.28 0.34 0.36 0.34 0.15 0.28 0.28 0.31 0.31 0.26 0.28 0.40
N_0_c 0.31 0.37 0.12 0.64 0.42 0.34 0.24 0.30 1.00 0.30 0.32 0.03 0.24 0.24 0.25 0.32 0.16 0.27 0.22 0.30 0.24 0.17 0.27 0.25
O_0_c 0.33 0.47 0.40 0.32 0.50 0.36 0.32 0.33 0.30 1.00 0.36 0.01 0.33 0.43 0.38 0.39 0.36 0.26 0.38 0.33 0.28 0.24 0.33 0.40
cexp_c 0.36 0.53 0.29 0.37 0.38 0.41 0.43 0.36 0.32 0.36 1.00 0.07 0.48 0.58 0.63 0.61 0.37 0.51 0.49 0.56 0.60 0.50 0.51 0.67
comlrn_c 0.10 0.22 0.06 0.07 0.14 0.01 0.10 0.03 0.03 0.01 0.07 1.00 0.10 0.22 0.12 0.13 0.03 0.17 0.19 0.13 0.14 0.14 0.15 0.17
coplrn_c 0.40 0.46 0.25 0.19 0.36 0.46 0.35 0.28 0.24 0.33 0.48 0.10 1.00 0.44 0.49 0.45 0.35 0.53 0.50 0.45 0.49 0.36 0.38 0.48
cstrat_c 0.35 0.58 0.33 0.27 0.40 0.43 0.48 0.34 0.24 0.43 0.58 0.22 0.44 1.00 0.67 0.74 0.53 0.50 0.49 0.65 0.59 0.47 0.48 0.63
effper_c 0.38 0.66 0.29 0.33 0.38 0.43 0.49 0.36 0.25 0.38 0.63 0.12 0.49 0.67 1.00 0.62 0.49 0.55 0.44 0.56 0.61 0.56 0.42 0.66
elab_c 0.30 0.54 0.28 0.35 0.43 0.35 0.48 0.34 0.32 0.39 0.61 0.13 0.45 0.74 0.62 1.00 0.49 0.50 0.45 0.67 0.54 0.47 0.34 0.53
insmot_c 0.27 0.43 0.26 0.20 0.27 0.25 0.26 0.15 0.16 0.36 0.37 0.03 0.35 0.53 0.49 0.49 1.00 0.41 0.31 0.50 0.39 0.34 0.32 0.40
intmat_c 0.35 0.60 0.20 0.31 0.35 0.37 0.47 0.28 0.27 0.26 0.51 0.17 0.53 0.50 0.55 0.50 0.41 1.00 0.52 0.48 0.62 0.67 0.42 0.55
intrea_c 0.35 0.50 0.29 0.27 0.41 0.43 0.41 0.28 0.22 0.38 0.49 0.19 0.50 0.49 0.44 0.45 0.31 0.52 1.00 0.46 0.50 0.36 0.47 0.50
memor_c 0.32 0.54 0.26 0.27 0.33 0.32 0.44 0.31 0.30 0.33 0.56 0.13 0.45 0.65 0.56 0.67 0.50 0.48 0.46 1.00 0.52 0.45 0.48 0.55
scacad_c 0.24 0.60 0.15 0.25 0.32 0.38 0.54 0.31 0.24 0.28 0.60 0.14 0.49 0.59 0.61 0.54 0.39 0.62 0.50 0.52 1.00 0.58 0.52 0.59
scmath_c 0.25 0.50 0.15 0.13 0.22 0.28 0.43 0.26 0.17 0.24 0.50 0.14 0.36 0.47 0.56 0.47 0.34 0.67 0.36 0.45 0.58 1.00 0.36 0.58
scverb_c 0.24 0.49 0.28 0.17 0.30 0.30 0.50 0.28 0.27 0.33 0.51 0.15 0.38 0.48 0.42 0.34 0.32 0.42 0.47 0.48 0.52 0.36 1.00 0.53
selfef_c 0.37 0.56 0.27 0.30 0.36 0.36 0.47 0.40 0.25 0.40 0.67 0.17 0.48 0.63 0.66 0.53 0.40 0.55 0.50 0.55 0.59 0.58 0.53 1.00
  library(d3heatmap)
  scores %>% 
      select(vars) %>%
      cor(use="pair") %>%
      d3heatmap( 
        symn= TRUE, 
        symm = TRUE, 
        k_row = 5, 
        k_col = 5
        )
Análise paralela e EFA
  scores %>% select(vars) %>% fa.parallel(fa = "fa" )

## Parallel analysis suggests that the number of factors =  2  and the number of components =  NA
  scores %>% select(vars) %>% fa(nfactors = 3) %>% print.psych(cut =.28, sort = TRUE)
## Factor Analysis using method =  minres
## Call: fa(r = ., nfactors = 3)
## Standardized loadings (pattern matrix) based upon correlation matrix
##          item   MR1   MR3   MR2   h2   u2 com
## scacad_c   21  0.74             0.66 0.34 1.1
## intmat_c   18  0.73             0.60 0.40 1.0
## scmath_c   22  0.71             0.54 0.46 1.1
## C_0_c       7  0.57             0.46 0.54 1.2
## C_1_c       2  0.55        0.38 0.70 0.30 1.8
## selfef_c   24  0.47  0.35       0.61 0.39 1.9
## scverb_c   23  0.40             0.38 0.62 1.7
## coplrn_c   13  0.38             0.40 0.60 1.9
## intrea_c   19  0.36             0.42 0.58 2.2
## comlrn_c   12                   0.04 0.96 1.2
## cstrat_c   14        0.78       0.74 0.26 1.1
## elab_c     16        0.70       0.64 0.36 1.0
## insmot_c   17        0.64       0.39 0.61 1.0
## memor_c    20        0.61       0.57 0.43 1.2
## E_1_c       3        0.47       0.24 0.76 1.8
## O_0_c      10        0.47  0.41 0.43 0.57 2.2
## effper_c   15  0.40  0.43       0.63 0.37 2.0
## cexp_c     11  0.36  0.38       0.57 0.43 2.2
## N_1_c       4              0.67 0.45 0.55 1.0
## N_0_c       9              0.65 0.41 0.59 1.0
## O_1_c       5        0.29  0.54 0.47 0.53 1.6
## A_1_c       1              0.51 0.39 0.61 1.2
## A_0_c       6  0.37        0.46 0.42 0.58 2.0
## E_0_c       8              0.39 0.30 0.70 1.7
## 
##                        MR1  MR3  MR2
## SS loadings           4.57 4.02 2.87
## Proportion Var        0.19 0.17 0.12
## Cumulative Var        0.19 0.36 0.48
## Proportion Explained  0.40 0.35 0.25
## Cumulative Proportion 0.40 0.75 1.00
## 
##  With factor correlations of 
##      MR1  MR3  MR2
## MR1 1.00 0.71 0.41
## MR3 0.71 1.00 0.49
## MR2 0.41 0.49 1.00
## 
## Mean item complexity =  1.5
## Test of the hypothesis that 3 factors are sufficient.
## 
## The degrees of freedom for the null model are  276  and the objective function was  13.44 with Chi Square of  2125.3
## The degrees of freedom for the model are 207  and the objective function was  2.08 
## 
## The root mean square of the residuals (RMSR) is  0.04 
## The df corrected root mean square of the residuals is  0.05 
## 
## The harmonic number of observations is  168 with the empirical chi square  182.25  with prob <  0.89 
## The total number of observations was  168  with Likelihood Chi Square =  324.25  with prob <  3.4e-07 
## 
## Tucker Lewis Index of factoring reliability =  0.914
## RMSEA index =  0.064  and the 90 % confidence intervals are  0.046 0.07
## BIC =  -736.41
## Fit based upon off diagonal values = 0.99
## Measures of factor score adequacy             
##                                                    MR1  MR3  MR2
## Correlation of (regression) scores with factors   0.95 0.95 0.90
## Multiple R square of scores with factors          0.90 0.89 0.81
## Minimum correlation of possible factor scores     0.80 0.79 0.63
  scores %>% select(vars) %>% fa(nfactors = 5) %>% print.psych(cut =.21, sort = TRUE)
## Factor Analysis using method =  minres
## Call: fa(r = ., nfactors = 5)
## Standardized loadings (pattern matrix) based upon correlation matrix
##          item   MR1   MR5   MR2   MR3   MR4    h2   u2 com
## scacad_c   21  0.74                         0.673 0.33 1.1
## intmat_c   18  0.72                         0.611 0.39 1.1
## scmath_c   22  0.69                         0.543 0.46 1.2
## C_0_c       7  0.61                         0.477 0.52 1.3
## scverb_c   23  0.59                    0.24 0.440 0.56 1.3
## C_1_c       2  0.56                         0.692 0.31 1.6
## selfef_c   24  0.53  0.26                   0.619 0.38 1.5
## intrea_c   19  0.45                    0.23 0.453 0.55 1.7
## coplrn_c   13  0.31              0.25       0.415 0.58 2.8
## comlrn_c   12  0.30                         0.064 0.94 1.6
## E_0_c       8  0.25                         0.294 0.71 3.6
## elab_c     16        0.80                   0.710 0.29 1.1
## cstrat_c   14        0.73                   0.735 0.27 1.1
## insmot_c   17        0.64                   0.397 0.60 1.0
## memor_c    20        0.61                   0.587 0.41 1.2
## effper_c   15  0.32  0.46                   0.644 0.36 1.9
## cexp_c     11  0.35  0.36                   0.574 0.43 2.3
## N_1_c       4              0.86             0.739 0.26 1.0
## N_0_c       9              0.72             0.550 0.45 1.0
## A_0_c       6                    0.94       0.868 0.13 1.0
## A_1_c       1                    0.46  0.22 0.442 0.56 1.6
## E_1_c       3        0.23              0.50 0.343 0.66 1.5
## O_0_c      10        0.24              0.49 0.487 0.51 1.7
## O_1_c       5              0.37        0.43 0.526 0.47 2.2
## 
##                        MR1  MR5  MR2  MR3  MR4
## SS loadings           4.54 3.39 1.80 1.76 1.40
## Proportion Var        0.19 0.14 0.07 0.07 0.06
## Cumulative Var        0.19 0.33 0.41 0.48 0.54
## Proportion Explained  0.35 0.26 0.14 0.14 0.11
## Cumulative Proportion 0.35 0.62 0.75 0.89 1.00
## 
##  With factor correlations of 
##      MR1  MR5  MR2  MR3  MR4
## MR1 1.00 0.74 0.35 0.49 0.29
## MR5 0.74 1.00 0.38 0.42 0.36
## MR2 0.35 0.38 1.00 0.42 0.32
## MR3 0.49 0.42 0.42 1.00 0.33
## MR4 0.29 0.36 0.32 0.33 1.00
## 
## Mean item complexity =  1.6
## Test of the hypothesis that 5 factors are sufficient.
## 
## The degrees of freedom for the null model are  276  and the objective function was  13.44 with Chi Square of  2125.3
## The degrees of freedom for the model are 166  and the objective function was  1.46 
## 
## The root mean square of the residuals (RMSR) is  0.03 
## The df corrected root mean square of the residuals is  0.04 
## 
## The harmonic number of observations is  168 with the empirical chi square  100.14  with prob <  1 
## The total number of observations was  168  with Likelihood Chi Square =  225.32  with prob <  0.0015 
## 
## Tucker Lewis Index of factoring reliability =  0.945
## RMSEA index =  0.053  and the 90 % confidence intervals are  0.029 0.061
## BIC =  -625.25
## Fit based upon off diagonal values = 0.99
## Measures of factor score adequacy             
##                                                    MR1  MR5  MR2  MR3  MR4
## Correlation of (regression) scores with factors   0.95 0.95 0.91 0.95 0.82
## Multiple R square of scores with factors          0.91 0.90 0.83 0.90 0.68
## Minimum correlation of possible factor scores     0.82 0.79 0.66 0.79 0.36

Exercício