Bibliotecas

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

Importe os dados

  bd_dip <-read_sav("projeto_dip_2.sav")

Explore as variáveis

  names(bd_dip)
##   [1] "ID"       "TMP1"     "OBS1"     "TMPJ1"    "CONPES1"  "COMUN1"  
##   [7] "CONHTR1"  "ORGPL1"   "SEGTR1"   "CTREMO1"  "TRBEQ1"   "ATCL1"   
##  [13] "FIDL1"    "AVGE1"    "RECT1"    "TMP2"     "OBS2"     "TMPJ2"   
##  [19] "CONPES2"  "COMUN2"   "CONHTR2"  "ORGPL2"   "SEGTR2"   "CTREMO2" 
##  [25] "TRBEQ2"   "ATCL2"    "FIDL2"    "AVGE2"    "RECT2"    "AI_BR"   
##  [31] "NF_BR"    "AQ_BR"    "A_BR"     "B_BR"     "C_BR"     "E_BR"    
##  [37] "F_BR"     "G_BR"     "H_BR"     "I_BR"     "L_BR"     "M_BR"    
##  [43] "N_BR"     "O_BR"     "Q1_BR"    "Q2_BR"    "Q3_BR"    "Q4_BR"   
##  [49] "AI"       "NF"       "AQ"       "A"        "A_M"      "A_F"     
##  [55] "B"        "C"        "E"        "E_M"      "E_F"      "F"       
##  [61] "G"        "H"        "I"        "I_M"      "I_F"      "L"       
##  [67] "M"        "N"        "O"        "Q1"       "Q2"       "Q3"      
##  [73] "Q4"       "FATOE_I"  "FATOR_II" "FATO_III" "FATOR_IV" "FATOR_V" 
##  [79] "RA"       "RV"       "RM"       "RE"       "RN"       "EG"      
##  [85] "EPN_RA"   "EPN_RV"   "EPN_RM"   "EPN_RE"   "EPN_RN"   "EPN_EG"  
##  [91] "ETNIA"    "IDADE"    "SEXO"     "FACES"    "PAISAG"   "FACILIT" 
##  [97] "SENSA"    "TRANSI"   "MISTUR"   "GERENC"   "RELAC"    "PERCEP"  
## [103] "USOFACI"  "CONEMO"   "REGEMO"   "EXPERI"   "ETRATEG"  "IE1"     
## [109] "IE2"      "IE"       "AV_DES1"  "AV_DES2"  "AV_DES"
  vars <- names(bd_dip)[c(79:83, 94:101)]
  
  describe(bd_dip[ , vars])
##         vars   n  mean    sd median trimmed   mad   min   max range  skew
## RA         1 153 14.88  4.42  16.00   15.37  4.45  0.00 23.00 23.00 -1.04
## RV         2 153 15.20  3.81  16.00   15.37  4.45  2.00 24.00 22.00 -0.52
## RM         3 153 10.93  4.64  11.00   10.70  4.45  0.00 23.00 23.00  0.34
## RE         4 153  9.35  4.53   9.00    9.29  4.45  0.00 19.00 19.00  0.15
## RN         5 153  9.87  4.30  10.00   10.07  4.45  0.00 19.00 19.00 -0.30
## FACES      6 121 40.25  7.73  41.43   41.05  7.60 15.09 51.73 36.64 -0.88
## PAISAG     7 120 42.89  8.75  45.19   44.10  6.79 10.19 54.36 44.16 -1.35
## FACILIT    8 114 42.29  7.63  44.72   43.20  6.51 17.70 52.63 34.92 -1.07
## SENSA      9 113 37.86  9.15  39.93   38.51  8.07 11.23 53.04 41.81 -0.68
## TRANSI    10 123 43.09  5.61  43.75   43.38  5.28 22.54 54.10 31.56 -0.64
## MISTUR    11 122 37.08  6.95  36.72   37.34  7.73 19.48 50.40 30.92 -0.28
## GERENC    12 121 41.40  8.66  42.67   42.38  7.93 12.27 56.85 44.58 -0.95
## RELAC     13 120 38.89 10.31  39.82   39.54 10.61 11.00 55.23 44.23 -0.53
##         kurtosis   se
## RA          1.14 0.36
## RV          0.48 0.31
## RM         -0.38 0.37
## RE         -0.71 0.37
## RN         -0.56 0.35
## FACES       0.35 0.70
## PAISAG      1.89 0.80
## FACILIT     0.66 0.71
## SENSA      -0.03 0.86
## TRANSI      0.82 0.51
## MISTUR     -0.44 0.63
## GERENC      0.67 0.79
## RELAC      -0.22 0.94
  corr.test(bd_dip[ , vars])
## Call:corr.test(x = bd_dip[, vars])
## Correlation matrix 
##           RA   RV    RM    RE    RN FACES PAISAG FACILIT SENSA TRANSI
## RA      1.00 0.47  0.54  0.46  0.54  0.28   0.25    0.07  0.33   0.13
## RV      0.47 1.00  0.31  0.43  0.53  0.16   0.20    0.03  0.29   0.26
## RM      0.54 0.31  1.00  0.48  0.45  0.07   0.05   -0.17  0.14   0.12
## RE      0.46 0.43  0.48  1.00  0.52  0.33   0.16   -0.12  0.22   0.17
## RN      0.54 0.53  0.45  0.52  1.00  0.16   0.25   -0.01  0.19   0.24
## FACES   0.28 0.16  0.07  0.33  0.16  1.00   0.20    0.19  0.29   0.20
## PAISAG  0.25 0.20  0.05  0.16  0.25  0.20   1.00    0.37  0.14   0.17
## FACILIT 0.07 0.03 -0.17 -0.12 -0.01  0.19   0.37    1.00  0.25   0.25
## SENSA   0.33 0.29  0.14  0.22  0.19  0.29   0.14    0.25  1.00   0.32
## TRANSI  0.13 0.26  0.12  0.17  0.24  0.20   0.17    0.25  0.32   1.00
## MISTUR  0.32 0.34  0.17  0.41  0.24  0.42   0.15    0.20  0.43   0.27
## GERENC  0.14 0.26  0.07  0.22  0.13  0.11   0.29    0.13  0.37   0.37
## RELAC   0.26 0.27  0.14  0.21  0.22  0.08   0.18    0.12  0.39   0.22
##         MISTUR GERENC RELAC
## RA        0.32   0.14  0.26
## RV        0.34   0.26  0.27
## RM        0.17   0.07  0.14
## RE        0.41   0.22  0.21
## RN        0.24   0.13  0.22
## FACES     0.42   0.11  0.08
## PAISAG    0.15   0.29  0.18
## FACILIT   0.20   0.13  0.12
## SENSA     0.43   0.37  0.39
## TRANSI    0.27   0.37  0.22
## MISTUR    1.00   0.42  0.31
## GERENC    0.42   1.00  0.43
## RELAC     0.31   0.43  1.00
## Sample Size 
##          RA  RV  RM  RE  RN FACES PAISAG FACILIT SENSA TRANSI MISTUR
## RA      153 153 153 153 153   121    120     114   113    123    122
## RV      153 153 153 153 153   121    120     114   113    123    122
## RM      153 153 153 153 153   121    120     114   113    123    122
## RE      153 153 153 153 153   121    120     114   113    123    122
## RN      153 153 153 153 153   121    120     114   113    123    122
## FACES   121 121 121 121 121   121    119     113   112    121    120
## PAISAG  120 120 120 120 120   119    120     112   113    120    120
## FACILIT 114 114 114 114 114   113    112     114   110    114    113
## SENSA   113 113 113 113 113   112    113     110   113    113    113
## TRANSI  123 123 123 123 123   121    120     114   113    123    122
## MISTUR  122 122 122 122 122   120    120     113   113    122    122
## GERENC  121 121 121 121 121   120    119     113   112    121    120
## RELAC   120 120 120 120 120   118    118     111   111    120    120
##         GERENC RELAC
## RA         121   120
## RV         121   120
## RM         121   120
## RE         121   120
## RN         121   120
## FACES      120   118
## PAISAG     119   118
## FACILIT    113   111
## SENSA      112   111
## TRANSI     121   120
## MISTUR     120   120
## GERENC     121   119
## RELAC      119   120
## Probability values (Entries above the diagonal are adjusted for multiple tests.) 
##           RA   RV   RM   RE   RN FACES PAISAG FACILIT SENSA TRANSI MISTUR
## RA      0.00 0.00 0.00 0.00 0.00  0.11   0.23    1.00  0.02   1.00   0.02
## RV      0.00 0.00 0.01 0.00 0.00  1.00   0.99    1.00  0.11   0.16   0.01
## RM      0.00 0.00 0.00 0.00 0.00  1.00   1.00    1.00  1.00   1.00   1.00
## RE      0.00 0.00 0.00 0.00 0.00  0.01   1.00    1.00  0.64   1.00   0.00
## RN      0.00 0.00 0.00 0.00 0.00  1.00   0.24    1.00  1.00   0.27   0.27
## FACES   0.00 0.07 0.45 0.00 0.09  0.00   0.94    1.00  0.11   0.94   0.00
## PAISAG  0.01 0.03 0.62 0.08 0.01  0.03   0.00    0.00  1.00   1.00   1.00
## FACILIT 0.43 0.75 0.06 0.22 0.89  0.05   0.00    0.00  0.37   0.27   1.00
## SENSA   0.00 0.00 0.14 0.02 0.05  0.00   0.15    0.01  0.00   0.03   0.00
## TRANSI  0.15 0.00 0.19 0.05 0.01  0.03   0.06    0.01  0.00   0.00   0.15
## MISTUR  0.00 0.00 0.06 0.00 0.01  0.00   0.10    0.04  0.00   0.00   0.00
## GERENC  0.12 0.00 0.45 0.02 0.16  0.22   0.00    0.17  0.00   0.00   0.00
## RELAC   0.00 0.00 0.14 0.02 0.02  0.41   0.06    0.22  0.00   0.02   0.00
##         GERENC RELAC
## RA        1.00  0.17
## RV        0.18  0.12
## RM        1.00  1.00
## RE        0.64  0.75
## RN        1.00  0.59
## FACES     1.00  1.00
## PAISAG    0.09  1.00
## FACILIT   1.00  1.00
## SENSA     0.00  0.00
## TRANSI    0.00  0.64
## MISTUR    0.00  0.03
## GERENC    0.00  0.00
## RELAC     0.00  0.00
## 
##  To see confidence intervals of the correlations, print with the short=FALSE option
  bd_dip %>% select(vars) %>% describe %>% kable(digits = 2)
vars n mean sd median trimmed mad min max range skew kurtosis se
RA 1 153 14.88 4.42 16.00 15.37 4.45 0.00 23.00 23.00 -1.04 1.14 0.36
RV 2 153 15.20 3.81 16.00 15.37 4.45 2.00 24.00 22.00 -0.52 0.48 0.31
RM 3 153 10.93 4.64 11.00 10.70 4.45 0.00 23.00 23.00 0.34 -0.38 0.37
RE 4 153 9.35 4.53 9.00 9.29 4.45 0.00 19.00 19.00 0.15 -0.71 0.37
RN 5 153 9.87 4.30 10.00 10.07 4.45 0.00 19.00 19.00 -0.30 -0.56 0.35
FACES 6 121 40.25 7.73 41.43 41.05 7.60 15.09 51.73 36.64 -0.88 0.35 0.70
PAISAG 7 120 42.89 8.75 45.19 44.10 6.79 10.19 54.36 44.16 -1.35 1.89 0.80
FACILIT 8 114 42.29 7.63 44.72 43.20 6.51 17.70 52.63 34.92 -1.07 0.66 0.71
SENSA 9 113 37.86 9.15 39.93 38.51 8.07 11.23 53.04 41.81 -0.68 -0.03 0.86
TRANSI 10 123 43.09 5.61 43.75 43.38 5.28 22.54 54.10 31.56 -0.64 0.82 0.51
MISTUR 11 122 37.08 6.95 36.72 37.34 7.73 19.48 50.40 30.92 -0.28 -0.44 0.63
GERENC 12 121 41.40 8.66 42.67 42.38 7.93 12.27 56.85 44.58 -0.95 0.67 0.79
RELAC 13 120 38.89 10.31 39.82 39.54 10.61 11.00 55.23 44.23 -0.53 -0.22 0.94
  bd_dip %>% select(vars) %>% corr.test() %>% .$r %>% kable(digits = 2)
RA RV RM RE RN FACES PAISAG FACILIT SENSA TRANSI MISTUR GERENC RELAC
RA 1.00 0.47 0.54 0.46 0.54 0.28 0.25 0.07 0.33 0.13 0.32 0.14 0.26
RV 0.47 1.00 0.31 0.43 0.53 0.16 0.20 0.03 0.29 0.26 0.34 0.26 0.27
RM 0.54 0.31 1.00 0.48 0.45 0.07 0.05 -0.17 0.14 0.12 0.17 0.07 0.14
RE 0.46 0.43 0.48 1.00 0.52 0.33 0.16 -0.12 0.22 0.17 0.41 0.22 0.21
RN 0.54 0.53 0.45 0.52 1.00 0.16 0.25 -0.01 0.19 0.24 0.24 0.13 0.22
FACES 0.28 0.16 0.07 0.33 0.16 1.00 0.20 0.19 0.29 0.20 0.42 0.11 0.08
PAISAG 0.25 0.20 0.05 0.16 0.25 0.20 1.00 0.37 0.14 0.17 0.15 0.29 0.18
FACILIT 0.07 0.03 -0.17 -0.12 -0.01 0.19 0.37 1.00 0.25 0.25 0.20 0.13 0.12
SENSA 0.33 0.29 0.14 0.22 0.19 0.29 0.14 0.25 1.00 0.32 0.43 0.37 0.39
TRANSI 0.13 0.26 0.12 0.17 0.24 0.20 0.17 0.25 0.32 1.00 0.27 0.37 0.22
MISTUR 0.32 0.34 0.17 0.41 0.24 0.42 0.15 0.20 0.43 0.27 1.00 0.42 0.31
GERENC 0.14 0.26 0.07 0.22 0.13 0.11 0.29 0.13 0.37 0.37 0.42 1.00 0.43
RELAC 0.26 0.27 0.14 0.21 0.22 0.08 0.18 0.12 0.39 0.22 0.31 0.43 1.00
bd_dip  %>% select(vars) %>% fa.parallel(fa = "pc")

## Parallel analysis suggests that the number of factors =  NA  and the number of components =  2
 bd_dip  %>% select(vars) %>% fa(nfactors = 2, rotate = "varimax")
## Factor Analysis using method =  minres
## Call: fa(r = ., nfactors = 2, rotate = "varimax")
## Standardized loadings (pattern matrix) based upon correlation matrix
##           MR1   MR2   h2   u2 com
## RA       0.69  0.25 0.54 0.46 1.3
## RV       0.55  0.32 0.41 0.59 1.6
## RM       0.69 -0.04 0.48 0.52 1.0
## RE       0.69  0.21 0.52 0.48 1.2
## RN       0.70  0.17 0.52 0.48 1.1
## FACES    0.20  0.37 0.18 0.82 1.5
## PAISAG   0.13  0.39 0.17 0.83 1.2
## FACILIT -0.18  0.47 0.26 0.74 1.3
## SENSA    0.19  0.60 0.39 0.61 1.2
## TRANSI   0.13  0.48 0.25 0.75 1.2
## MISTUR   0.29  0.59 0.43 0.57 1.5
## GERENC   0.10  0.60 0.37 0.63 1.1
## RELAC    0.20  0.47 0.26 0.74 1.4
## 
##                        MR1  MR2
## SS loadings           2.51 2.26
## Proportion Var        0.19 0.17
## Cumulative Var        0.19 0.37
## Proportion Explained  0.53 0.47
## Cumulative Proportion 0.53 1.00
## 
## Mean item complexity =  1.3
## Test of the hypothesis that 2 factors are sufficient.
## 
## The degrees of freedom for the null model are  78  and the objective function was  3.85 with Chi Square of  589.09
## The degrees of freedom for the model are 53  and the objective function was  0.76 
## 
## The root mean square of the residuals (RMSR) is  0.06 
## The df corrected root mean square of the residuals is  0.08 
## 
## The harmonic number of observations is  122 with the empirical chi square  75.9  with prob <  0.021 
## The total number of observations was  159  with Likelihood Chi Square =  114.41  with prob <  2.1e-06 
## 
## Tucker Lewis Index of factoring reliability =  0.821
## RMSEA index =  0.089  and the 90 % confidence intervals are  0.064 0.107
## BIC =  -154.24
## Fit based upon off diagonal values = 0.95
## Measures of factor score adequacy             
##                                                   MR1  MR2
## Correlation of (regression) scores with factors   0.9 0.86
## Multiple R square of scores with factors          0.8 0.74
## Minimum correlation of possible factor scores     0.6 0.47
 bd_dip  %>% select(vars) %>% fa(nfactors = 2, rotate = "oblimin")
## Factor Analysis using method =  minres
## Call: fa(r = ., nfactors = 2, rotate = "oblimin")
## Standardized loadings (pattern matrix) based upon correlation matrix
##           MR1   MR2   h2   u2 com
## RA       0.68  0.13 0.54 0.46 1.1
## RV       0.52  0.23 0.41 0.59 1.4
## RM       0.74 -0.18 0.48 0.52 1.1
## RE       0.69  0.08 0.52 0.48 1.0
## RN       0.71  0.04 0.52 0.48 1.0
## FACES    0.14  0.35 0.18 0.82 1.3
## PAISAG   0.05  0.39 0.17 0.83 1.0
## FACILIT -0.29  0.54 0.26 0.74 1.5
## SENSA    0.08  0.59 0.39 0.61 1.0
## TRANSI   0.04  0.48 0.25 0.75 1.0
## MISTUR   0.19  0.56 0.43 0.57 1.2
## GERENC  -0.01  0.61 0.37 0.63 1.0
## RELAC    0.12  0.45 0.26 0.74 1.1
## 
##                        MR1  MR2
## SS loadings           2.53 2.25
## Proportion Var        0.19 0.17
## Cumulative Var        0.19 0.37
## Proportion Explained  0.53 0.47
## Cumulative Proportion 0.53 1.00
## 
##  With factor correlations of 
##      MR1  MR2
## MR1 1.00 0.37
## MR2 0.37 1.00
## 
## Mean item complexity =  1.1
## Test of the hypothesis that 2 factors are sufficient.
## 
## The degrees of freedom for the null model are  78  and the objective function was  3.85 with Chi Square of  589.09
## The degrees of freedom for the model are 53  and the objective function was  0.76 
## 
## The root mean square of the residuals (RMSR) is  0.06 
## The df corrected root mean square of the residuals is  0.08 
## 
## The harmonic number of observations is  122 with the empirical chi square  75.9  with prob <  0.021 
## The total number of observations was  159  with Likelihood Chi Square =  114.41  with prob <  2.1e-06 
## 
## Tucker Lewis Index of factoring reliability =  0.821
## RMSEA index =  0.089  and the 90 % confidence intervals are  0.064 0.107
## BIC =  -154.24
## Fit based upon off diagonal values = 0.95
## Measures of factor score adequacy             
##                                                    MR1  MR2
## Correlation of (regression) scores with factors   0.91 0.88
## Multiple R square of scores with factors          0.83 0.77
## Minimum correlation of possible factor scores     0.66 0.54
 m1 <- bd_dip  %>% select(vars) %>% fa(nfactors = 2, rotate = "varimax")
 m2 <- bd_dip  %>% select(vars) %>% fa(nfactors = 2, rotate = "oblimin")
 
 print.psych(m1, cut = .25, sort = TRUE)
## Factor Analysis using method =  minres
## Call: fa(r = ., nfactors = 2, rotate = "varimax")
## Standardized loadings (pattern matrix) based upon correlation matrix
##         item   MR1   MR2   h2   u2 com
## RN         5  0.70       0.52 0.48 1.1
## RM         3  0.69       0.48 0.52 1.0
## RA         1  0.69  0.25 0.54 0.46 1.3
## RE         4  0.69       0.52 0.48 1.2
## RV         2  0.55  0.32 0.41 0.59 1.6
## GERENC    12        0.60 0.37 0.63 1.1
## SENSA      9        0.60 0.39 0.61 1.2
## MISTUR    11  0.29  0.59 0.43 0.57 1.5
## TRANSI    10        0.48 0.25 0.75 1.2
## FACILIT    8        0.47 0.26 0.74 1.3
## RELAC     13        0.47 0.26 0.74 1.4
## PAISAG     7        0.39 0.17 0.83 1.2
## FACES      6        0.37 0.18 0.82 1.5
## 
##                        MR1  MR2
## SS loadings           2.51 2.26
## Proportion Var        0.19 0.17
## Cumulative Var        0.19 0.37
## Proportion Explained  0.53 0.47
## Cumulative Proportion 0.53 1.00
## 
## Mean item complexity =  1.3
## Test of the hypothesis that 2 factors are sufficient.
## 
## The degrees of freedom for the null model are  78  and the objective function was  3.85 with Chi Square of  589.09
## The degrees of freedom for the model are 53  and the objective function was  0.76 
## 
## The root mean square of the residuals (RMSR) is  0.06 
## The df corrected root mean square of the residuals is  0.08 
## 
## The harmonic number of observations is  122 with the empirical chi square  75.9  with prob <  0.021 
## The total number of observations was  159  with Likelihood Chi Square =  114.41  with prob <  2.1e-06 
## 
## Tucker Lewis Index of factoring reliability =  0.821
## RMSEA index =  0.089  and the 90 % confidence intervals are  0.064 0.107
## BIC =  -154.24
## Fit based upon off diagonal values = 0.95
## Measures of factor score adequacy             
##                                                   MR1  MR2
## Correlation of (regression) scores with factors   0.9 0.86
## Multiple R square of scores with factors          0.8 0.74
## Minimum correlation of possible factor scores     0.6 0.47
 print.psych(m2, cut = .25, sort = TRUE)
## Factor Analysis using method =  minres
## Call: fa(r = ., nfactors = 2, rotate = "oblimin")
## Standardized loadings (pattern matrix) based upon correlation matrix
##         item   MR1   MR2   h2   u2 com
## RM         3  0.74       0.48 0.52 1.1
## RN         5  0.71       0.52 0.48 1.0
## RE         4  0.69       0.52 0.48 1.0
## RA         1  0.68       0.54 0.46 1.1
## RV         2  0.52       0.41 0.59 1.4
## GERENC    12        0.61 0.37 0.63 1.0
## SENSA      9        0.59 0.39 0.61 1.0
## MISTUR    11        0.56 0.43 0.57 1.2
## FACILIT    8 -0.29  0.54 0.26 0.74 1.5
## TRANSI    10        0.48 0.25 0.75 1.0
## RELAC     13        0.45 0.26 0.74 1.1
## PAISAG     7        0.39 0.17 0.83 1.0
## FACES      6        0.35 0.18 0.82 1.3
## 
##                        MR1  MR2
## SS loadings           2.53 2.25
## Proportion Var        0.19 0.17
## Cumulative Var        0.19 0.37
## Proportion Explained  0.53 0.47
## Cumulative Proportion 0.53 1.00
## 
##  With factor correlations of 
##      MR1  MR2
## MR1 1.00 0.37
## MR2 0.37 1.00
## 
## Mean item complexity =  1.1
## Test of the hypothesis that 2 factors are sufficient.
## 
## The degrees of freedom for the null model are  78  and the objective function was  3.85 with Chi Square of  589.09
## The degrees of freedom for the model are 53  and the objective function was  0.76 
## 
## The root mean square of the residuals (RMSR) is  0.06 
## The df corrected root mean square of the residuals is  0.08 
## 
## The harmonic number of observations is  122 with the empirical chi square  75.9  with prob <  0.021 
## The total number of observations was  159  with Likelihood Chi Square =  114.41  with prob <  2.1e-06 
## 
## Tucker Lewis Index of factoring reliability =  0.821
## RMSEA index =  0.089  and the 90 % confidence intervals are  0.064 0.107
## BIC =  -154.24
## Fit based upon off diagonal values = 0.95
## Measures of factor score adequacy             
##                                                    MR1  MR2
## Correlation of (regression) scores with factors   0.91 0.88
## Multiple R square of scores with factors          0.83 0.77
## Minimum correlation of possible factor scores     0.66 0.54
  diagram(m1)

  diagram(m2)