Análise fatorial exploratória de escalas (variáveis categóricas)
Lendo os dados
library(readxl)
# setwd("~/Dropbox/R Stat/")
# save.image("senna54xm.RData")
load("senna54xm.RData")
bd <- read_excel("senna54xm.xlsx", sheet = "base")
dic <- read_excel("senna54xm.xlsx", sheet = "dic_itens")

source("http://www.labape.com.br/rprimi/R/score_tests.R")
source("http://www.labape.com.br/rprimi/R/save_item_psicom.R")
source("http://www.labape.com.br/rprimi/R/save_loadings.R")
Análise psicométrica
psicom <-  score_tests(data = bd, item_dic = dic, min = 1, max = 5, run_scrub = TRUE)
print.psych(psicom)
## Call: scoreItems(keys = keys, items = data[, rownames(keys)], missing = TRUE, 
##     impute = "none", digits = 3)
## 
## (Standardized) Alpha:
##          A    C    E    N   NV    O
## alpha 0.69 0.73 0.41 0.68 0.45 0.75
## 
## Standard errors of unstandardized Alpha:
##           A     C     E     N    NV     O
## ASE   0.015 0.014 0.025 0.015 0.024 0.014
## 
## Standardized Alpha of observed scales:
##                   A    C    E    N   NV    O
## alpha.observed 0.69 0.73 0.41 0.68 0.45 0.75
## 
## Average item correlation:
##              A    C     E    N    NV    O
## average.r 0.18 0.23 0.071 0.17 0.094 0.27
## 
##  Guttman 6* reliability: 
##             A    C    E    N   NV    O
## Lambda.6 0.73 0.77 0.52 0.74 0.52 0.76
## 
## Signal/Noise based upon av.r : 
##                A   C    E   N   NV   O
## Signal/Noise 2.2 2.7 0.68 2.1 0.83 2.9
## 
## Scale intercorrelations corrected for attenuation 
##  raw correlations below the diagonal, alpha on the diagonal 
##  corrected correlations above the diagonal:
## 
## Note that these are the correlations of the complete scales based on the correlation matrix,
##  not the observed scales based on the raw items.
##       A     C     E     N     NV     O
## A  0.69  0.70 0.832  0.51  0.018 0.685
## C  0.50  0.73 0.525  0.62 -0.383 0.481
## E  0.44  0.29 0.406  0.26  0.191 0.944
## N  0.35  0.43 0.136  0.68 -0.652 0.084
## NV 0.01 -0.22 0.082 -0.36  0.453 0.487
## O  0.49  0.36 0.519  0.06  0.283 0.746
## 
##  In order to see the item by scale loadings and frequency counts of the data
##  print with the short option = FALSE
# save_item_psicom(psychObj = psicom, item_dic = dic, filename = "psicom.xlsx")
Explorando as correlações com visualizações do d3heatmap
library(d3heatmap)
d3heatmap(cor(bd[ , 5:58], use="pair"), 
          symn= TRUE,  symm = TRUE, 
          k_row = 6, k_col = 6)
## Loading required namespace: colorspace