## [1] "52 people participated to the study so far."

Help us! Answer the questionnaire HERE

Sociodemographics

Gender

Currently we have a rather balanced sample in regards to gender.

##    Gender  N
## 1 Femmina 27
## 2 Maschio 25

Age

At the moment we have manged to contact a very young sample, we will need to focus on older portions of population.

## [1] "The sample's mean age is 26.06 ± 5.64"

Correlation matrix

corMat <- dataframe %>%
  select_if(is.numeric) %>%
  cor(use = "pairwise.complete.obs") %>% 
  round(2)

  
heatmap.2(1-abs(corMat),
          Rowv = F,
          Colv = F,
          dendrogram="none",
          symm=T,
          scale="none",
          revC=F,
          cellnote=matrix(gsub("0.",".",corMat,fixed=T),ncol=ncol(corMat),nrow=ncol(corMat)),
          trace = "none",
          notecol = "black",
          notecex=0.5,
          key=F,
          keysize=0.4,
          margins = c(6,6),
          col=hcl.colors(100,"mint"),
          cexRow = 0.5,
          cexCol = 0.5,
          offsetRow = 0.01,
          offsetCol = 0.01
  )

Scale validation

Correlation matrix and reduntant items

TGMI

#matrice di correlazione per la TGMI
data[,121:172] %>%
  lapply(function(x){gsub("Fortemente in disaccordo",1,x)}) %>% 
  lapply(function(x){gsub("Abbastanza in disaccordo",2,x)}) %>%
  lapply(function(x){gsub("Un po' in disaccordo",3,x)}) %>%
  lapply(function(x){gsub("Né in disaccordo, né in accordo",4,x)}) %>%
  lapply(function(x){gsub("Un po' d'accordo",5,x)}) %>%
  lapply(function(x){gsub("Abbastanza d'accordo",6,x)}) %>%
  lapply(function(x){gsub("Fortemente d'accordo",7,x)}) %>%
  lapply(as.numeric) %>%
  do.call(cbind,.) %>%
  unname %>%
  assign("TGMI",.,1)%>%
  cor(use="pairwise.complete.obs") %>%
  round(.,2) %T>%
  assign("corMat_TGMI",.,1) %T>%
  print %>%
  #flag reduntant items
  (function(x){abs(x)>.7&abs(x)<1}) %>%
  replace_triangle(by=F) %>% 
  as.matrix %T>%
  {assign("cor",corMat_TGMI[.],1)} %>%
  which(arr.ind=T) %>%
  unname %>%
  cbind(cor) %T>%
  {print("Redundant pairs of items")} %>%
  print
##        [,1]  [,2]  [,3]  [,4]  [,5]  [,6]  [,7]  [,8]  [,9] [,10] [,11] [,12]
##  [1,]  1.00 -0.41  0.53  0.46  0.55  0.64  0.70  0.60  0.58  0.05 -0.07 -0.16
##  [2,] -0.41  1.00 -0.53 -0.40 -0.25 -0.35 -0.31 -0.29 -0.32  0.21  0.12  0.10
##  [3,]  0.53 -0.53  1.00  0.61  0.62  0.75  0.59  0.64  0.52  0.04  0.07 -0.08
##  [4,]  0.46 -0.40  0.61  1.00  0.73  0.62  0.51  0.66  0.46  0.30  0.20  0.20
##  [5,]  0.55 -0.25  0.62  0.73  1.00  0.73  0.62  0.66  0.38  0.31  0.25  0.11
##  [6,]  0.64 -0.35  0.75  0.62  0.73  1.00  0.69  0.65  0.49  0.18  0.18 -0.05
##  [7,]  0.70 -0.31  0.59  0.51  0.62  0.69  1.00  0.70  0.38  0.35 -0.02 -0.12
##  [8,]  0.60 -0.29  0.64  0.66  0.66  0.65  0.70  1.00  0.49  0.24  0.06 -0.05
##  [9,]  0.58 -0.32  0.52  0.46  0.38  0.49  0.38  0.49  1.00 -0.29  0.17  0.05
## [10,]  0.05  0.21  0.04  0.30  0.31  0.18  0.35  0.24 -0.29  1.00 -0.04  0.00
## [11,] -0.07  0.12  0.07  0.20  0.25  0.18 -0.02  0.06  0.17 -0.04  1.00  0.58
## [12,] -0.16  0.10 -0.08  0.20  0.11 -0.05 -0.12 -0.05  0.05  0.00  0.58  1.00
## [13,]  0.06  0.05  0.10  0.21  0.17  0.16  0.01  0.11  0.26 -0.23  0.62  0.59
## [14,]  0.14  0.24  0.16  0.16  0.28  0.34  0.32  0.21  0.00  0.29  0.39  0.20
## [15,]  0.18  0.00  0.20  0.36  0.38  0.44  0.21  0.31  0.18  0.19  0.46  0.24
## [16,] -0.03  0.06  0.15  0.26  0.23  0.24 -0.01  0.15  0.27 -0.08  0.59  0.61
## [17,]  0.38 -0.28  0.50  0.56  0.53  0.49  0.35  0.49  0.45  0.10  0.28  0.15
## [18,]  0.45 -0.27  0.46  0.61  0.58  0.52  0.42  0.60  0.45  0.15  0.29  0.12
## [19,]  0.41 -0.29  0.54  0.55  0.43  0.49  0.40  0.59  0.45  0.05  0.24  0.13
## [20,]  0.34 -0.15  0.40  0.47  0.46  0.43  0.50  0.54  0.45  0.17  0.34  0.17
## [21,]  0.28 -0.13  0.29  0.23  0.49  0.47  0.44  0.21  0.21  0.12  0.10  0.11
## [22,]  0.03 -0.02  0.06 -0.07  0.09  0.22  0.22 -0.10 -0.15  0.20 -0.03 -0.04
## [23,]  0.16 -0.19  0.43  0.31  0.38  0.40  0.46  0.26  0.10  0.32  0.00  0.00
## [24,]  0.18 -0.02  0.17  0.02  0.22  0.29  0.43  0.08 -0.08  0.32 -0.14 -0.16
## [25,]  0.27  0.05  0.27  0.26  0.23  0.31  0.41  0.38 -0.04  0.52 -0.19 -0.21
## [26,]  0.16  0.06  0.16  0.25  0.21  0.14  0.32  0.28 -0.09  0.33 -0.11  0.02
## [27,]  0.32 -0.05  0.56  0.42  0.51  0.59  0.53  0.62  0.31  0.27  0.15 -0.10
## [28,]  0.37 -0.12  0.56  0.50  0.55  0.49  0.54  0.57  0.24  0.28  0.14  0.11
## [29,]  0.43 -0.26  0.40  0.35  0.21  0.29  0.37  0.37  0.29  0.16 -0.20 -0.14
## [30,]  0.30 -0.13  0.29  0.31  0.18  0.27  0.36  0.32  0.29  0.24 -0.24 -0.06
## [31,]  0.63 -0.31  0.44  0.27  0.40  0.58  0.50  0.39  0.43  0.10  0.00 -0.17
## [32,]  0.20 -0.22  0.37  0.35  0.32  0.35  0.19  0.41  0.33  0.16  0.02 -0.09
## [33,]  0.48 -0.32  0.70  0.50  0.63  0.72  0.62  0.64  0.34  0.26  0.05 -0.11
## [34,]  0.48 -0.31  0.60  0.39  0.44  0.55  0.47  0.56  0.33  0.07  0.01 -0.14
## [35,]  0.36 -0.09  0.53  0.49  0.61  0.57  0.46  0.61  0.32  0.35  0.18 -0.01
## [36,]  0.32 -0.08  0.60  0.54  0.54  0.50  0.38  0.60  0.33  0.26  0.06  0.01
## [37,]  0.21 -0.28  0.25  0.21  0.12  0.13  0.17  0.23  0.10  0.06 -0.25 -0.27
## [38,]  0.58 -0.36  0.51  0.29  0.46  0.54  0.63  0.55  0.18  0.27 -0.25 -0.31
## [39,]  0.61 -0.32  0.45  0.36  0.46  0.57  0.72  0.59  0.21  0.36 -0.20 -0.35
## [40,]  0.17 -0.32  0.26  0.25  0.15  0.29  0.25  0.40  0.19  0.10 -0.01  0.01
## [41,]  0.43 -0.25  0.44  0.38  0.45  0.38  0.44  0.33  0.36  0.14  0.16  0.01
## [42,]  0.45 -0.11  0.31  0.32  0.35  0.36  0.47  0.36  0.30  0.27  0.19 -0.01
## [43,]  0.47 -0.28  0.35  0.27  0.35  0.51  0.59  0.50  0.20  0.24 -0.05 -0.06
## [44,]  0.45 -0.13  0.45  0.33  0.40  0.40  0.49  0.46  0.32  0.18 -0.05 -0.12
## [45,]  0.41 -0.10  0.26  0.32  0.42  0.41  0.35  0.35  0.38  0.08  0.21  0.07
## [46,]  0.32 -0.15  0.29  0.25  0.33  0.45  0.33  0.35  0.19  0.19  0.08 -0.10
## [47,]  0.34 -0.10  0.36  0.38  0.42  0.48  0.25  0.35  0.15  0.26  0.01 -0.01
## [48,]  0.51 -0.36  0.49  0.29  0.37  0.60  0.36  0.41  0.30 -0.07  0.01 -0.15
## [49,]  0.31 -0.21  0.31  0.52  0.42  0.28  0.40  0.53  0.32  0.20  0.23 -0.03
## [50,]  0.48 -0.35  0.38  0.39  0.50  0.58  0.64  0.52  0.23  0.30  0.14 -0.13
## [51,]  0.52 -0.44  0.56  0.40  0.40  0.51  0.55  0.44  0.35  0.07  0.05  0.08
## [52,]  0.61 -0.25  0.34  0.38  0.39  0.51  0.66  0.60  0.28  0.33 -0.08 -0.15
##       [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24]
##  [1,]  0.06  0.14  0.18 -0.03  0.38  0.45  0.41  0.34  0.28  0.03  0.16  0.18
##  [2,]  0.05  0.24  0.00  0.06 -0.28 -0.27 -0.29 -0.15 -0.13 -0.02 -0.19 -0.02
##  [3,]  0.10  0.16  0.20  0.15  0.50  0.46  0.54  0.40  0.29  0.06  0.43  0.17
##  [4,]  0.21  0.16  0.36  0.26  0.56  0.61  0.55  0.47  0.23 -0.07  0.31  0.02
##  [5,]  0.17  0.28  0.38  0.23  0.53  0.58  0.43  0.46  0.49  0.09  0.38  0.22
##  [6,]  0.16  0.34  0.44  0.24  0.49  0.52  0.49  0.43  0.47  0.22  0.40  0.29
##  [7,]  0.01  0.32  0.21 -0.01  0.35  0.42  0.40  0.50  0.44  0.22  0.46  0.43
##  [8,]  0.11  0.21  0.31  0.15  0.49  0.60  0.59  0.54  0.21 -0.10  0.26  0.08
##  [9,]  0.26  0.00  0.18  0.27  0.45  0.45  0.45  0.45  0.21 -0.15  0.10 -0.08
## [10,] -0.23  0.29  0.19 -0.08  0.10  0.15  0.05  0.17  0.12  0.20  0.32  0.32
## [11,]  0.62  0.39  0.46  0.59  0.28  0.29  0.24  0.34  0.10 -0.03  0.00 -0.14
## [12,]  0.59  0.20  0.24  0.61  0.15  0.12  0.13  0.17  0.11 -0.04  0.00 -0.16
## [13,]  1.00  0.29  0.29  0.69  0.07  0.17  0.21  0.23  0.06 -0.08 -0.09 -0.28
## [14,]  0.29  1.00  0.38  0.34  0.00  0.14  0.12  0.10  0.36  0.36  0.29  0.41
## [15,]  0.29  0.38  1.00  0.54  0.22  0.27  0.09  0.15  0.28  0.15  0.33  0.23
## [16,]  0.69  0.34  0.54  1.00  0.19  0.25  0.20  0.28  0.11 -0.02  0.11 -0.03
## [17,]  0.07  0.00  0.22  0.19  1.00  0.86  0.73  0.61  0.26 -0.13  0.24  0.09
## [18,]  0.17  0.14  0.27  0.25  0.86  1.00  0.76  0.71  0.18 -0.13  0.14  0.09
## [19,]  0.21  0.12  0.09  0.20  0.73  0.76  1.00  0.71  0.10 -0.20  0.12 -0.03
## [20,]  0.23  0.10  0.15  0.28  0.61  0.71  0.71  1.00  0.14 -0.08  0.25  0.05
## [21,]  0.06  0.36  0.28  0.11  0.26  0.18  0.10  0.14  1.00  0.63  0.58  0.67
## [22,] -0.08  0.36  0.15 -0.02 -0.13 -0.13 -0.20 -0.08  0.63  1.00  0.53  0.76
## [23,] -0.09  0.29  0.33  0.11  0.24  0.14  0.12  0.25  0.58  0.53  1.00  0.62
## [24,] -0.28  0.41  0.23 -0.03  0.09  0.09 -0.03  0.05  0.67  0.76  0.62  1.00
## [25,] -0.31  0.42  0.15 -0.12  0.12  0.14  0.09  0.15  0.21  0.32  0.31  0.44
## [26,] -0.11  0.33  0.23  0.03  0.15  0.18 -0.04  0.03  0.33  0.31  0.32  0.42
## [27,]  0.03  0.31  0.38  0.13  0.29  0.31  0.29  0.35  0.22  0.07  0.36  0.19
## [28,]  0.09  0.30  0.45  0.23  0.37  0.37  0.25  0.23  0.18  0.12  0.32  0.30
## [29,]  0.02  0.05 -0.03 -0.01  0.23  0.28  0.41  0.36  0.00 -0.06  0.10  0.15
## [30,] -0.08  0.01 -0.07 -0.01  0.27  0.33  0.29  0.28  0.09  0.00  0.12  0.18
## [31,]  0.03  0.28  0.13  0.00  0.19  0.29  0.24  0.27  0.37  0.13  0.17  0.26
## [32,] -0.08 -0.08  0.07  0.09  0.34  0.39  0.35  0.34  0.13 -0.04  0.08  0.04
## [33,] -0.07  0.17  0.26  0.06  0.58  0.55  0.47  0.42  0.31  0.11  0.37  0.32
## [34,]  0.00  0.05  0.28  0.16  0.56  0.53  0.49  0.34  0.18  0.03  0.31  0.25
## [35,]  0.07  0.45  0.24  0.22  0.54  0.62  0.58  0.48  0.29  0.11  0.41  0.33
## [36,] -0.02  0.24  0.27  0.16  0.52  0.51  0.47  0.30  0.27  0.02  0.40  0.25
## [37,] -0.14 -0.18 -0.27 -0.29  0.09  0.17  0.30  0.27  0.04 -0.04 -0.03  0.12
## [38,] -0.18  0.16  0.05 -0.10  0.32  0.45  0.44  0.36  0.29  0.20  0.28  0.41
## [39,] -0.22  0.16  0.13 -0.11  0.28  0.40  0.38  0.32  0.24  0.13  0.24  0.34
## [40,] -0.02 -0.17  0.02  0.02  0.21  0.25  0.38  0.39  0.20  0.15  0.13  0.12
## [41,]  0.12  0.04  0.11  0.05  0.38  0.35  0.16  0.30  0.22  0.20  0.20  0.18
## [42,]  0.09  0.20  0.34  0.02  0.33  0.30  0.11  0.22  0.32  0.33  0.34  0.26
## [43,] -0.04  0.10  0.30 -0.04  0.15  0.18  0.15  0.26  0.33  0.29  0.29  0.27
## [44,]  0.04  0.10  0.21  0.00  0.12  0.18  0.09  0.20  0.34  0.34  0.35  0.26
## [45,]  0.24  0.22  0.29  0.22  0.17  0.23  0.29  0.30  0.24  0.02  0.20  0.18
## [46,]  0.05  0.11  0.24  0.19  0.10  0.21  0.27  0.27  0.20  0.12  0.22  0.27
## [47,] -0.06  0.25  0.06  0.06  0.35  0.30  0.38  0.20  0.28  0.08  0.22  0.13
## [48,] -0.10  0.13  0.22  0.06  0.24  0.29  0.31  0.19  0.30  0.19  0.19  0.27
## [49,]  0.16  0.10  0.16  0.18  0.32  0.50  0.42  0.50 -0.15 -0.22  0.17 -0.12
## [50,]  0.08  0.23  0.22  0.09  0.33  0.47  0.47  0.47  0.32  0.06  0.25  0.20
## [51,]  0.04  0.20  0.11 -0.01  0.34  0.35  0.38  0.28  0.43  0.20  0.20  0.26
## [52,] -0.17  0.22  0.16 -0.04  0.19  0.37  0.34  0.39  0.14  0.04  0.08  0.21
##       [,25] [,26] [,27] [,28] [,29] [,30] [,31] [,32] [,33] [,34] [,35] [,36]
##  [1,]  0.27  0.16  0.32  0.37  0.43  0.30  0.63  0.20  0.48  0.48  0.36  0.32
##  [2,]  0.05  0.06 -0.05 -0.12 -0.26 -0.13 -0.31 -0.22 -0.32 -0.31 -0.09 -0.08
##  [3,]  0.27  0.16  0.56  0.56  0.40  0.29  0.44  0.37  0.70  0.60  0.53  0.60
##  [4,]  0.26  0.25  0.42  0.50  0.35  0.31  0.27  0.35  0.50  0.39  0.49  0.54
##  [5,]  0.23  0.21  0.51  0.55  0.21  0.18  0.40  0.32  0.63  0.44  0.61  0.54
##  [6,]  0.31  0.14  0.59  0.49  0.29  0.27  0.58  0.35  0.72  0.55  0.57  0.50
##  [7,]  0.41  0.32  0.53  0.54  0.37  0.36  0.50  0.19  0.62  0.47  0.46  0.38
##  [8,]  0.38  0.28  0.62  0.57  0.37  0.32  0.39  0.41  0.64  0.56  0.61  0.60
##  [9,] -0.04 -0.09  0.31  0.24  0.29  0.29  0.43  0.33  0.34  0.33  0.32  0.33
## [10,]  0.52  0.33  0.27  0.28  0.16  0.24  0.10  0.16  0.26  0.07  0.35  0.26
## [11,] -0.19 -0.11  0.15  0.14 -0.20 -0.24  0.00  0.02  0.05  0.01  0.18  0.06
## [12,] -0.21  0.02 -0.10  0.11 -0.14 -0.06 -0.17 -0.09 -0.11 -0.14 -0.01  0.01
## [13,] -0.31 -0.11  0.03  0.09  0.02 -0.08  0.03 -0.08 -0.07  0.00  0.07 -0.02
## [14,]  0.42  0.33  0.31  0.30  0.05  0.01  0.28 -0.08  0.17  0.05  0.45  0.24
## [15,]  0.15  0.23  0.38  0.45 -0.03 -0.07  0.13  0.07  0.26  0.28  0.24  0.27
## [16,] -0.12  0.03  0.13  0.23 -0.01 -0.01  0.00  0.09  0.06  0.16  0.22  0.16
## [17,]  0.12  0.15  0.29  0.37  0.23  0.27  0.19  0.34  0.58  0.56  0.54  0.52
## [18,]  0.14  0.18  0.31  0.37  0.28  0.33  0.29  0.39  0.55  0.53  0.62  0.51
## [19,]  0.09 -0.04  0.29  0.25  0.41  0.29  0.24  0.35  0.47  0.49  0.58  0.47
## [20,]  0.15  0.03  0.35  0.23  0.36  0.28  0.27  0.34  0.42  0.34  0.48  0.30
## [21,]  0.21  0.33  0.22  0.18  0.00  0.09  0.37  0.13  0.31  0.18  0.29  0.27
## [22,]  0.32  0.31  0.07  0.12 -0.06  0.00  0.13 -0.04  0.11  0.03  0.11  0.02
## [23,]  0.31  0.32  0.36  0.32  0.10  0.12  0.17  0.08  0.37  0.31  0.41  0.40
## [24,]  0.44  0.42  0.19  0.30  0.15  0.18  0.26  0.04  0.32  0.25  0.33  0.25
## [25,]  1.00  0.71  0.33  0.37  0.15  0.15  0.14  0.08  0.41  0.11  0.38  0.41
## [26,]  0.71  1.00  0.30  0.43 -0.04  0.03 -0.03 -0.02  0.34  0.21  0.31  0.49
## [27,]  0.33  0.30  1.00  0.50  0.25  0.17  0.34  0.40  0.68  0.47  0.54  0.61
## [28,]  0.37  0.43  0.50  1.00  0.27  0.25  0.16  0.28  0.59  0.48  0.52  0.58
## [29,]  0.15 -0.04  0.25  0.27  1.00  0.72  0.56  0.47  0.28  0.38  0.38  0.19
## [30,]  0.15  0.03  0.17  0.25  0.72  1.00  0.40  0.57  0.27  0.35  0.38  0.30
## [31,]  0.14 -0.03  0.34  0.16  0.56  0.40  1.00  0.43  0.36  0.20  0.32  0.07
## [32,]  0.08 -0.02  0.40  0.28  0.47  0.57  0.43  1.00  0.46  0.34  0.44  0.39
## [33,]  0.41  0.34  0.68  0.59  0.28  0.27  0.36  0.46  1.00  0.67  0.57  0.72
## [34,]  0.11  0.21  0.47  0.48  0.38  0.35  0.20  0.34  0.67  1.00  0.53  0.64
## [35,]  0.38  0.31  0.54  0.52  0.38  0.38  0.32  0.44  0.57  0.53  1.00  0.72
## [36,]  0.41  0.49  0.61  0.58  0.19  0.30  0.07  0.39  0.72  0.64  0.72  1.00
## [37,]  0.21  0.07  0.02  0.13  0.39  0.17  0.14  0.40  0.22  0.14  0.23  0.21
## [38,]  0.33  0.16  0.24  0.31  0.51  0.44  0.52  0.33  0.54  0.53  0.49  0.36
## [39,]  0.36  0.23  0.42  0.32  0.39  0.29  0.46  0.22  0.52  0.45  0.48  0.37
## [40,]  0.13  0.09  0.26  0.19  0.29  0.29  0.18  0.64  0.37  0.31  0.32  0.31
## [41,]  0.20  0.28  0.36  0.48  0.28  0.34  0.34  0.30  0.48  0.43  0.35  0.32
## [42,]  0.32  0.40  0.42  0.43  0.18  0.16  0.33  0.13  0.42  0.31  0.26  0.29
## [43,]  0.35  0.28  0.42  0.26  0.34  0.27  0.45  0.29  0.46  0.38  0.23  0.17
## [44,]  0.37  0.47  0.47  0.40  0.20  0.17  0.33  0.26  0.50  0.38  0.28  0.48
## [45,]  0.07 -0.02  0.35  0.21  0.19 -0.02  0.32  0.06  0.35  0.23  0.39  0.27
## [46,]  0.18  0.06  0.43  0.21  0.32  0.27  0.44  0.42  0.48  0.33  0.38  0.30
## [47,]  0.38  0.30  0.37  0.30  0.13  0.23  0.26  0.33  0.46  0.29  0.48  0.49
## [48,]  0.30  0.19  0.45  0.28  0.16  0.14  0.42  0.36  0.56  0.38  0.34  0.39
## [49,]  0.00 -0.08  0.29  0.31  0.20  0.05  0.20  0.18  0.20  0.28  0.34  0.19
## [50,]  0.11 -0.10  0.35  0.21  0.23  0.16  0.49  0.27  0.44  0.34  0.33  0.18
## [51,]  0.32  0.29  0.35  0.35  0.29  0.25  0.33  0.22  0.45  0.41  0.38  0.45
## [52,]  0.54  0.32  0.34  0.35  0.26  0.27  0.40  0.26  0.44  0.23  0.37  0.31
##       [,37] [,38] [,39] [,40] [,41] [,42] [,43] [,44] [,45] [,46] [,47] [,48]
##  [1,]  0.21  0.58  0.61  0.17  0.43  0.45  0.47  0.45  0.41  0.32  0.34  0.51
##  [2,] -0.28 -0.36 -0.32 -0.32 -0.25 -0.11 -0.28 -0.13 -0.10 -0.15 -0.10 -0.36
##  [3,]  0.25  0.51  0.45  0.26  0.44  0.31  0.35  0.45  0.26  0.29  0.36  0.49
##  [4,]  0.21  0.29  0.36  0.25  0.38  0.32  0.27  0.33  0.32  0.25  0.38  0.29
##  [5,]  0.12  0.46  0.46  0.15  0.45  0.35  0.35  0.40  0.42  0.33  0.42  0.37
##  [6,]  0.13  0.54  0.57  0.29  0.38  0.36  0.51  0.40  0.41  0.45  0.48  0.60
##  [7,]  0.17  0.63  0.72  0.25  0.44  0.47  0.59  0.49  0.35  0.33  0.25  0.36
##  [8,]  0.23  0.55  0.59  0.40  0.33  0.36  0.50  0.46  0.35  0.35  0.35  0.41
##  [9,]  0.10  0.18  0.21  0.19  0.36  0.30  0.20  0.32  0.38  0.19  0.15  0.30
## [10,]  0.06  0.27  0.36  0.10  0.14  0.27  0.24  0.18  0.08  0.19  0.26 -0.07
## [11,] -0.25 -0.25 -0.20 -0.01  0.16  0.19 -0.05 -0.05  0.21  0.08  0.01  0.01
## [12,] -0.27 -0.31 -0.35  0.01  0.01 -0.01 -0.06 -0.12  0.07 -0.10 -0.01 -0.15
## [13,] -0.14 -0.18 -0.22 -0.02  0.12  0.09 -0.04  0.04  0.24  0.05 -0.06 -0.10
## [14,] -0.18  0.16  0.16 -0.17  0.04  0.20  0.10  0.10  0.22  0.11  0.25  0.13
## [15,] -0.27  0.05  0.13  0.02  0.11  0.34  0.30  0.21  0.29  0.24  0.06  0.22
## [16,] -0.29 -0.10 -0.11  0.02  0.05  0.02 -0.04  0.00  0.22  0.19  0.06  0.06
## [17,]  0.09  0.32  0.28  0.21  0.38  0.33  0.15  0.12  0.17  0.10  0.35  0.24
## [18,]  0.17  0.45  0.40  0.25  0.35  0.30  0.18  0.18  0.23  0.21  0.30  0.29
## [19,]  0.30  0.44  0.38  0.38  0.16  0.11  0.15  0.09  0.29  0.27  0.38  0.31
## [20,]  0.27  0.36  0.32  0.39  0.30  0.22  0.26  0.20  0.30  0.27  0.20  0.19
## [21,]  0.04  0.29  0.24  0.20  0.22  0.32  0.33  0.34  0.24  0.20  0.28  0.30
## [22,] -0.04  0.20  0.13  0.15  0.20  0.33  0.29  0.34  0.02  0.12  0.08  0.19
## [23,] -0.03  0.28  0.24  0.13  0.20  0.34  0.29  0.35  0.20  0.22  0.22  0.19
## [24,]  0.12  0.41  0.34  0.12  0.18  0.26  0.27  0.26  0.18  0.27  0.13  0.27
## [25,]  0.21  0.33  0.36  0.13  0.20  0.32  0.35  0.37  0.07  0.18  0.38  0.30
## [26,]  0.07  0.16  0.23  0.09  0.28  0.40  0.28  0.47 -0.02  0.06  0.30  0.19
## [27,]  0.02  0.24  0.42  0.26  0.36  0.42  0.42  0.47  0.35  0.43  0.37  0.45
## [28,]  0.13  0.31  0.32  0.19  0.48  0.43  0.26  0.40  0.21  0.21  0.30  0.28
## [29,]  0.39  0.51  0.39  0.29  0.28  0.18  0.34  0.20  0.19  0.32  0.13  0.16
## [30,]  0.17  0.44  0.29  0.29  0.34  0.16  0.27  0.17 -0.02  0.27  0.23  0.14
## [31,]  0.14  0.52  0.46  0.18  0.34  0.33  0.45  0.33  0.32  0.44  0.26  0.42
## [32,]  0.40  0.33  0.22  0.64  0.30  0.13  0.29  0.26  0.06  0.42  0.33  0.36
## [33,]  0.22  0.54  0.52  0.37  0.48  0.42  0.46  0.50  0.35  0.48  0.46  0.56
## [34,]  0.14  0.53  0.45  0.31  0.43  0.31  0.38  0.38  0.23  0.33  0.29  0.38
## [35,]  0.23  0.49  0.48  0.32  0.35  0.26  0.23  0.28  0.39  0.38  0.48  0.34
## [36,]  0.21  0.36  0.37  0.31  0.32  0.29  0.17  0.48  0.27  0.30  0.49  0.39
## [37,]  1.00  0.40  0.29  0.57  0.07 -0.20  0.10  0.08  0.18  0.19  0.19  0.24
## [38,]  0.40  1.00  0.82  0.38  0.32  0.25  0.45  0.42  0.32  0.43  0.33  0.48
## [39,]  0.29  0.82  1.00  0.35  0.24  0.32  0.49  0.38  0.37  0.41  0.33  0.41
## [40,]  0.57  0.38  0.35  1.00  0.14  0.04  0.45  0.25  0.18  0.53  0.29  0.39
## [41,]  0.07  0.32  0.24  0.14  1.00  0.76  0.33  0.67  0.26  0.25  0.25  0.30
## [42,] -0.20  0.25  0.32  0.04  0.76  1.00  0.41  0.75  0.17  0.15  0.17  0.19
## [43,]  0.10  0.45  0.49  0.45  0.33  0.41  1.00  0.49  0.11  0.39  0.06  0.33
## [44,]  0.08  0.42  0.38  0.25  0.67  0.75  0.49  1.00  0.18  0.28  0.14  0.28
## [45,]  0.18  0.32  0.37  0.18  0.26  0.17  0.11  0.18  1.00  0.59  0.38  0.51
## [46,]  0.19  0.43  0.41  0.53  0.25  0.15  0.39  0.28  0.59  1.00  0.46  0.61
## [47,]  0.19  0.33  0.33  0.29  0.25  0.17  0.06  0.14  0.38  0.46  1.00  0.60
## [48,]  0.24  0.48  0.41  0.39  0.30  0.19  0.33  0.28  0.51  0.61  0.60  1.00
## [49,]  0.13  0.26  0.33  0.07  0.29  0.23  0.12  0.19  0.26  0.11  0.04  0.03
## [50,]  0.07  0.49  0.57  0.32  0.17  0.26  0.42  0.20  0.32  0.47  0.22  0.29
## [51,]  0.25  0.40  0.44  0.45  0.34  0.30  0.40  0.41  0.14  0.18  0.28  0.36
## [52,]  0.24  0.48  0.61  0.32  0.21  0.25  0.54  0.35  0.21  0.34  0.35  0.47
##       [,49] [,50] [,51] [,52]
##  [1,]  0.31  0.48  0.52  0.61
##  [2,] -0.21 -0.35 -0.44 -0.25
##  [3,]  0.31  0.38  0.56  0.34
##  [4,]  0.52  0.39  0.40  0.38
##  [5,]  0.42  0.50  0.40  0.39
##  [6,]  0.28  0.58  0.51  0.51
##  [7,]  0.40  0.64  0.55  0.66
##  [8,]  0.53  0.52  0.44  0.60
##  [9,]  0.32  0.23  0.35  0.28
## [10,]  0.20  0.30  0.07  0.33
## [11,]  0.23  0.14  0.05 -0.08
## [12,] -0.03 -0.13  0.08 -0.15
## [13,]  0.16  0.08  0.04 -0.17
## [14,]  0.10  0.23  0.20  0.22
## [15,]  0.16  0.22  0.11  0.16
## [16,]  0.18  0.09 -0.01 -0.04
## [17,]  0.32  0.33  0.34  0.19
## [18,]  0.50  0.47  0.35  0.37
## [19,]  0.42  0.47  0.38  0.34
## [20,]  0.50  0.47  0.28  0.39
## [21,] -0.15  0.32  0.43  0.14
## [22,] -0.22  0.06  0.20  0.04
## [23,]  0.17  0.25  0.20  0.08
## [24,] -0.12  0.20  0.26  0.21
## [25,]  0.00  0.11  0.32  0.54
## [26,] -0.08 -0.10  0.29  0.32
## [27,]  0.29  0.35  0.35  0.34
## [28,]  0.31  0.21  0.35  0.35
## [29,]  0.20  0.23  0.29  0.26
## [30,]  0.05  0.16  0.25  0.27
## [31,]  0.20  0.49  0.33  0.40
## [32,]  0.18  0.27  0.22  0.26
## [33,]  0.20  0.44  0.45  0.44
## [34,]  0.28  0.34  0.41  0.23
## [35,]  0.34  0.33  0.38  0.37
## [36,]  0.19  0.18  0.45  0.31
## [37,]  0.13  0.07  0.25  0.24
## [38,]  0.26  0.49  0.40  0.48
## [39,]  0.33  0.57  0.44  0.61
## [40,]  0.07  0.32  0.45  0.32
## [41,]  0.29  0.17  0.34  0.21
## [42,]  0.23  0.26  0.30  0.25
## [43,]  0.12  0.42  0.40  0.54
## [44,]  0.19  0.20  0.41  0.35
## [45,]  0.26  0.32  0.14  0.21
## [46,]  0.11  0.47  0.18  0.34
## [47,]  0.04  0.22  0.28  0.35
## [48,]  0.03  0.29  0.36  0.47
## [49,]  1.00  0.56  0.05  0.33
## [50,]  0.56  1.00  0.38  0.55
## [51,]  0.05  0.38  1.00  0.49
## [52,]  0.33  0.55  0.49  1.00
## [1] "Redundant pairs of items"
##              cor
##  [1,]  4  5 0.73
##  [2,]  3  6 0.75
##  [3,]  5  6 0.73
##  [4,] 17 18 0.86
##  [5,] 17 19 0.73
##  [6,] 18 19 0.76
##  [7,] 18 20 0.71
##  [8,] 19 20 0.71
##  [9,] 22 24 0.76
## [10,] 25 26 0.71
## [11,] 29 30 0.72
## [12,]  6 33 0.72
## [13,] 33 36 0.72
## [14,] 35 36 0.72
## [15,]  7 39 0.72
## [16,] 38 39 0.82
## [17,] 41 42 0.76
## [18,] 42 44 0.75
#item response distribution TGMI
par(mfrow=c(3,4))
for(i in 1:ncol(TGMI)){
  hist(TGMI[,i],main=paste("Item",i))
}

PAI

#PAI
data[,63:81] %>%
  lapply(function(x){gsub("Fortemente in disaccordo",1,x)}) %>% 
  lapply(function(x){gsub("In disaccordo",2,x)}) %>%
  lapply(function(x){gsub("Né in accordo né in disaccordo",3,x)}) %>%
  lapply(function(x){gsub("D'accordo",4,x)}) %>%
  lapply(function(x){gsub("Fortemente d'accordo",5,x)}) %>%
  lapply(as.numeric) %>%
  do.call(cbind,.) %>%
  unname %T>%
  assign("PAI",.,1) %>%
  cor(use="pairwise.complete.obs") %>%
  round(.,2) %T>%
  assign("corMat_PAI",.,1) %T>%
  print %>%
  #flag reduntant items
  (function(x){abs(x)>.7&abs(x)<1}) %>%
  replace_triangle(by=F) %>% 
  as.matrix %T>%
  {assign("cor",corMat_PAI[.],1)} %>%
  which(arr.ind=T) %>%
  unname %>%
  cbind(cor) %>%
  assign("flagReduntant_PAI",.,1) %>%
  print
##        [,1]  [,2]  [,3]  [,4]  [,5]  [,6]  [,7]  [,8] [,9] [,10] [,11] [,12]
##  [1,]  1.00  0.28  0.09  0.26  0.23  0.38  0.24  0.37 0.36  0.35  0.18  0.27
##  [2,]  0.28  1.00  0.34  0.46  0.49  0.30  0.38  0.48 0.27  0.14  0.15  0.16
##  [3,]  0.09  0.34  1.00  0.63  0.55  0.15  0.23  0.58 0.35  0.23  0.57  0.02
##  [4,]  0.26  0.46  0.63  1.00  0.52  0.41  0.24  0.71 0.39  0.26  0.55  0.24
##  [5,]  0.23  0.49  0.55  0.52  1.00  0.40  0.29  0.62 0.48  0.32  0.43  0.05
##  [6,]  0.38  0.30  0.15  0.41  0.40  1.00  0.37  0.45 0.18  0.19  0.06  0.28
##  [7,]  0.24  0.38  0.23  0.24  0.29  0.37  1.00  0.31 0.06 -0.03  0.06  0.24
##  [8,]  0.37  0.48  0.58  0.71  0.62  0.45  0.31  1.00 0.42  0.30  0.50  0.25
##  [9,]  0.36  0.27  0.35  0.39  0.48  0.18  0.06  0.42 1.00  0.67  0.54  0.16
## [10,]  0.35  0.14  0.23  0.26  0.32  0.19 -0.03  0.30 0.67  1.00  0.52  0.12
## [11,]  0.18  0.15  0.57  0.55  0.43  0.06  0.06  0.50 0.54  0.52  1.00  0.17
## [12,]  0.27  0.16  0.02  0.24  0.05  0.28  0.24  0.25 0.16  0.12  0.17  1.00
## [13,]  0.10 -0.04  0.31  0.31  0.28  0.16 -0.13  0.37 0.18  0.18  0.22  0.12
## [14,]  0.12  0.05  0.44  0.36  0.34  0.22 -0.08  0.42 0.28  0.28  0.31  0.26
## [15,]  0.10 -0.17 -0.02 -0.06  0.08 -0.05  0.11 -0.07 0.27  0.12  0.08  0.07
## [16,]  0.08  0.05  0.03  0.16  0.21 -0.06  0.06  0.17 0.19  0.08  0.18  0.03
## [17,]  0.36  0.10  0.48  0.49  0.39  0.33 -0.01  0.32 0.38  0.46  0.41  0.23
## [18,] -0.15 -0.40  0.08 -0.10 -0.09 -0.13 -0.17  0.00 0.02  0.10  0.18  0.03
## [19,] -0.10  0.08  0.02  0.06  0.08 -0.12  0.19  0.10 0.19 -0.11 -0.03 -0.01
##       [,13] [,14] [,15] [,16] [,17] [,18] [,19]
##  [1,]  0.10  0.12  0.10  0.08  0.36 -0.15 -0.10
##  [2,] -0.04  0.05 -0.17  0.05  0.10 -0.40  0.08
##  [3,]  0.31  0.44 -0.02  0.03  0.48  0.08  0.02
##  [4,]  0.31  0.36 -0.06  0.16  0.49 -0.10  0.06
##  [5,]  0.28  0.34  0.08  0.21  0.39 -0.09  0.08
##  [6,]  0.16  0.22 -0.05 -0.06  0.33 -0.13 -0.12
##  [7,] -0.13 -0.08  0.11  0.06 -0.01 -0.17  0.19
##  [8,]  0.37  0.42 -0.07  0.17  0.32  0.00  0.10
##  [9,]  0.18  0.28  0.27  0.19  0.38  0.02  0.19
## [10,]  0.18  0.28  0.12  0.08  0.46  0.10 -0.11
## [11,]  0.22  0.31  0.08  0.18  0.41  0.18 -0.03
## [12,]  0.12  0.26  0.07  0.03  0.23  0.03 -0.01
## [13,]  1.00  0.82  0.17  0.08  0.40  0.24  0.02
## [14,]  0.82  1.00  0.01 -0.05  0.46  0.23 -0.11
## [15,]  0.17  0.01  1.00  0.56  0.24  0.48  0.52
## [16,]  0.08 -0.05  0.56  1.00  0.16  0.47  0.49
## [17,]  0.40  0.46  0.24  0.16  1.00  0.07 -0.10
## [18,]  0.24  0.23  0.48  0.47  0.07  1.00  0.23
## [19,]  0.02 -0.11  0.52  0.49 -0.10  0.23  1.00
##             cor
## [1,]  4  8 0.71
## [2,] 13 14 0.82
#item response distribution TGMI
par(mfrow=c(3,4))
for(i in 1:ncol(PAI)){
  hist(PAI[,i],main=paste("Item",i))
}

Number of factors

fa.parallel(TGMI,fa="fa",main="TGMI")
## Warning in cor.smooth(r): Matrix was not positive definite, smoothing was done
## Warning in fa.stats(r = r, f = f, phi = phi, n.obs = n.obs, np.obs = np.obs, :
## The estimated weights for the factor scores are probably incorrect.  Try a
## different factor score estimation method.
## In factor.scores, the correlation matrix is singular, the pseudo inverse is  used
## In smc, smcs > 1 were set to 1.0
## In smc, smcs > 1 were set to 1.0
## Warning in cor.smooth(r): Matrix was not positive definite, smoothing was done
## In smc, smcs > 1 were set to 1.0
## In smc, smcs < 0 were set to .0
## In smc, smcs > 1 were set to 1.0
## In smc, smcs < 0 were set to .0
## Warning in cor.smooth(r): Matrix was not positive definite, smoothing was done
## Warning in cor.smooth(r): The estimated weights for the factor scores are
## probably incorrect.  Try a different factor score estimation method.
## In smc, smcs > 1 were set to 1.0
## In smc, smcs < 0 were set to .0
## In smc, smcs > 1 were set to 1.0
## In smc, smcs < 0 were set to .0
## Warning in cor.smooth(r): Matrix was not positive definite, smoothing was done
## Warning in cor.smooth(r): The estimated weights for the factor scores are
## probably incorrect.  Try a different factor score estimation method.
## In smc, smcs > 1 were set to 1.0
## In smc, smcs < 0 were set to .0
## In smc, smcs > 1 were set to 1.0
## In smc, smcs < 0 were set to .0
## Warning in cor.smooth(r): Matrix was not positive definite, smoothing was done
## Warning in cor.smooth(r): The estimated weights for the factor scores are
## probably incorrect.  Try a different factor score estimation method.
## In smc, smcs > 1 were set to 1.0
## In smc, smcs < 0 were set to .0
## In smc, smcs > 1 were set to 1.0
## In smc, smcs < 0 were set to .0
## Warning in cor.smooth(r): Matrix was not positive definite, smoothing was done
## Warning in cor.smooth(r): The estimated weights for the factor scores are
## probably incorrect.  Try a different factor score estimation method.
## In smc, smcs > 1 were set to 1.0
## In smc, smcs > 1 were set to 1.0
## Warning in cor.smooth(r): Matrix was not positive definite, smoothing was done
## Warning in cor.smooth(r): The estimated weights for the factor scores are
## probably incorrect.  Try a different factor score estimation method.
## In smc, smcs > 1 were set to 1.0
## In smc, smcs > 1 were set to 1.0
## Warning in cor.smooth(r): Matrix was not positive definite, smoothing was done
## Warning in cor.smooth(r): The estimated weights for the factor scores are
## probably incorrect.  Try a different factor score estimation method.
## In smc, smcs > 1 were set to 1.0
## In smc, smcs < 0 were set to .0
## In smc, smcs > 1 were set to 1.0
## In smc, smcs < 0 were set to .0
## Warning in cor.smooth(r): Matrix was not positive definite, smoothing was done
## In smc, smcs > 1 were set to 1.0
## In smc, smcs < 0 were set to .0
## In smc, smcs > 1 were set to 1.0
## In smc, smcs < 0 were set to .0
## Warning in cor.smooth(r): Matrix was not positive definite, smoothing was done
## In smc, smcs > 1 were set to 1.0
## In smc, smcs > 1 were set to 1.0
## Warning in cor.smooth(r): Matrix was not positive definite, smoothing was done
## In smc, smcs > 1 were set to 1.0
## In smc, smcs < 0 were set to .0
## In smc, smcs > 1 were set to 1.0
## In smc, smcs < 0 were set to .0
## Warning in cor.smooth(r): Matrix was not positive definite, smoothing was done
## In smc, smcs > 1 were set to 1.0
## In smc, smcs < 0 were set to .0
## In smc, smcs > 1 were set to 1.0
## In smc, smcs < 0 were set to .0
## Warning in cor.smooth(r): Matrix was not positive definite, smoothing was done
## In smc, smcs > 1 were set to 1.0
## In smc, smcs < 0 were set to .0
## In smc, smcs > 1 were set to 1.0
## In smc, smcs < 0 were set to .0
## Warning in cor.smooth(r): Matrix was not positive definite, smoothing was done
## Warning in cor.smooth(r): The estimated weights for the factor scores are
## probably incorrect.  Try a different factor score estimation method.
## In smc, smcs > 1 were set to 1.0
## In smc, smcs < 0 were set to .0
## In smc, smcs > 1 were set to 1.0
## In smc, smcs < 0 were set to .0
## Warning in cor.smooth(r): Matrix was not positive definite, smoothing was done
## Warning in cor.smooth(r): The estimated weights for the factor scores are
## probably incorrect.  Try a different factor score estimation method.
## In smc, smcs > 1 were set to 1.0
## In smc, smcs < 0 were set to .0
## In smc, smcs > 1 were set to 1.0
## In smc, smcs < 0 were set to .0
## Warning in cor.smooth(r): Matrix was not positive definite, smoothing was done
## Warning in cor.smooth(r): The estimated weights for the factor scores are
## probably incorrect.  Try a different factor score estimation method.
## In smc, smcs > 1 were set to 1.0
## In smc, smcs < 0 were set to .0
## In smc, smcs > 1 were set to 1.0
## In smc, smcs < 0 were set to .0
## Warning in cor.smooth(r): Matrix was not positive definite, smoothing was done
## Warning in cor.smooth(r): The estimated weights for the factor scores are
## probably incorrect.  Try a different factor score estimation method.
## In smc, smcs > 1 were set to 1.0
## In smc, smcs > 1 were set to 1.0
## Warning in cor.smooth(r): Matrix was not positive definite, smoothing was done
## In smc, smcs > 1 were set to 1.0
## In smc, smcs < 0 were set to .0
## In smc, smcs > 1 were set to 1.0
## In smc, smcs < 0 were set to .0
## Warning in cor.smooth(r): Matrix was not positive definite, smoothing was done
## In smc, smcs > 1 were set to 1.0
## In smc, smcs < 0 were set to .0
## In smc, smcs > 1 were set to 1.0
## In smc, smcs < 0 were set to .0
## Warning in cor.smooth(r): Matrix was not positive definite, smoothing was done
## In smc, smcs > 1 were set to 1.0
## In smc, smcs < 0 were set to .0
## In smc, smcs > 1 were set to 1.0
## In smc, smcs < 0 were set to .0
## Warning in cor.smooth(r): Matrix was not positive definite, smoothing was done

## Parallel analysis suggests that the number of factors =  3  and the number of components =  NA
fa.parallel(PAI,fa="fa",main="PAI")
## Warning in fa.stats(r = r, f = f, phi = phi, n.obs = n.obs, np.obs = np.obs, :
## The estimated weights for the factor scores are probably incorrect.  Try a
## different factor score estimation method.

## Parallel analysis suggests that the number of factors =  3  and the number of components =  NA