Introdução ao R para TRI

Instalando pacotes

As análises serão feitas com as rotinas dos pacotes psych e ltm. A importação dos dados será feita usando rotinas do pacote foreign

install.packages("psych").
install.packages("ltm").
install.packages("foreign").

Antes de começar as análises é preciso “chamar” os pacotes

library(foreign)
library(psych)
library(ltm)

Importando dados do SPSS e EXCEL

Configurando o diretório a partir do qual o R irá ler e salvar os arquivos das análises

getwd()
## [1] "/Users/rprimi/Dropbox/TRI/ri_rld"
setwd("~/Dropbox/TRI/ri_rld/")

Lendo um arquivo do SPSS

ri <- read.spss("ri_exerc1.sav", to.data.frame = TRUE, use.missings = TRUE)
## re-encoding from CP1252

Lendo dados copiados do EXCEL para o clipboard

ri.keys <- read.clipboard.tab()
ri.keys <- as.vector(ri.keys$Key)

“Vendo” o conteúdo do arquivo

ri.keys
##  [1] 6 8 1 6 2 1 4 5 3 8 2 5 4 4 2 1
names(ri)
##  [1] "id"  "i01" "i02" "i03" "i04" "i05" "i06" "i07" "i08" "i09" "i10"
## [12] "i11" "i12" "i13" "i14" "i15" "i16"
head(ri)
##      id i01 i02 i03 i04 i05 i06 i07 i08 i09 i10 i11 i12 i13 i14 i15 i16
## 1 B0001   6   8   1   6   2   1   5   5   8   8   2  NA   1   4   1   3
## 2 B0004   6   8  NA   6   2   2   4   2   3   8   5   5   1   4   2   1
## 3 B0005   1   8   1   6   2   1   4   5   3   8   5   5   1   3   2   1
## 4 B0009   6   8   1   6   2   1   2   5   3   8   5   3   8   2   3   8
## 5 B0010   6   8   1   6   2   1   2   5   3   8   5   6   1   3   3   5
## 6 B0011   1   8   1   6   2   1   2   5   4   8   5   3   1   3   2   8
tail(ri)
##        id i01 i02 i03 i04 i05 i06 i07 i08 i09 i10 i11 i12 i13 i14 i15 i16
## 435 B1425   6   5   6  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA
## 436 B1431   6   8   1  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA
## 437 B1433   6   8   1   6   4   1   4   8  NA  NA  NA  NA  NA  NA  NA  NA
## 438 B1437   6   8   5   6   2   1   5   8  NA  NA  NA  NA  NA  NA  NA  NA
## 439 B1438   6   4   4   5   6   3   5   8   3   6  NA  NA  NA  NA  NA  NA
## 440 B1441   6   7   1   5   2   7   4   3   5   8   2   5   6   1   6   3
describe(ri)
##     var   n   mean     sd median trimmed    mad min max range  skew
## id*   1 440 220.50 127.16  220.5  220.50 163.09   1 440   439  0.00
## i01   2 433   5.82   1.33    6.0    6.07   0.00   1   8     7 -2.34
## i02   3 435   7.27   1.80    8.0    7.81   0.00   1   8     7 -2.39
## i03   4 428   1.70   1.67    1.0    1.23   0.00   1   8     7  2.63
## i04   5 432   5.48   1.35    6.0    5.82   0.00   1   8     7 -2.21
## i05   6 430   3.06   1.67    2.0    2.78   0.00   1   8     7  1.21
## i06   7 428   1.69   1.37    1.0    1.38   0.00   1   8     7  2.45
## i07   8 427   3.77   1.21    4.0    3.72   0.00   2   8     6  0.65
## i08   9 428   5.22   1.48    5.0    5.24   0.00   1   8     7  0.03
## i09  10 418   3.69   1.85    3.0    3.43   0.00   1   8     7  1.50
## i10  11 416   6.32   2.78    8.0    6.76   0.00   1   8     7 -1.19
## i11  12 405   4.28   2.04    5.0    4.12   2.97   1   8     7  0.30
## i12  13 405   4.73   1.47    5.0    4.76   0.00   1   8     7 -0.36
## i13  14 407   3.22   2.18    4.0    2.95   4.45   1   8     7  0.61
## i14  15 401   3.68   1.48    4.0    3.60   1.48   1   8     7  0.67
## i15  16 391   3.30   1.99    2.0    3.02   1.48   1   8     7  1.11
## i16  17 397   4.19   2.61    4.0    4.12   4.45   1   8     7  0.09
##     kurtosis   se
## id*    -1.21 6.06
## i01     6.02 0.06
## i02     4.12 0.09
## i03     6.16 0.08
## i04     4.49 0.07
## i05     0.28 0.08
## i06     6.44 0.07
## i07     2.30 0.06
## i08     0.91 0.07
## i09     1.20 0.09
## i10    -0.37 0.14
## i11    -0.96 0.10
## i12     0.01 0.07
## i13    -0.53 0.11
## i14     1.11 0.07
## i15     0.15 0.10
## i16    -1.49 0.13

Análises psicométricas clássicas com o psych

ri_classicas1 <- score.multiple.choice(ri.keys, ri[, c(2:17)], score = FALSE, 
    short = FALSE)
ri_classicas2 <- score.multiple.choice(ri.keys, ri[, c(2:17)], score = TRUE, 
    short = FALSE)
head(ri_classicas1)
##      i01 i02 i03 i04 i05 i06 i07 i08 i09 i10 i11 i12 i13 i14 i15 i16
## [1,]   1   1   1   1   1   1   0   1   0   1   1  NA   0   1   0   0
## [2,]   1   1  NA   1   1   0   1   0   1   1   0   1   0   1   1   1
## [3,]   0   1   1   1   1   1   1   1   1   1   0   1   0   0   1   1
## [4,]   1   1   1   1   1   1   0   1   1   1   0   0   0   0   0   0
## [5,]   1   1   1   1   1   1   0   1   1   1   0   0   0   0   0   0
## [6,]   0   1   1   1   1   1   0   1   0   1   0   0   0   0   1   0
head(ri_classicas2)
## $scores
## Averages     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA> 
##   0.6875   0.7500   0.7500   0.5625   0.5625   0.5000   0.3750   0.3750 
##     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA> 
##   0.7500   0.6875   0.0000   0.1250   0.5000   0.1875   0.8125   0.7500 
##     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA> 
##   0.5000   0.6250   0.3750   0.5000   0.6875   0.4375   0.3750   0.6250 
##     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA> 
##   0.6875   0.4375   0.7500   0.8125   0.9375   0.7500   0.6250   0.6250 
##     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA> 
##   0.5000   0.2500   0.5000   0.5625   0.3125   0.6250   0.6250   0.6250 
##     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA> 
##   0.6250   0.6875   0.6250   0.6875   0.7500   0.9375   0.9375   0.7500 
##     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA> 
##   0.8750   0.6250   0.6250   0.8750   0.8750   0.8125   0.6875   0.6875 
##     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA> 
##   0.6875   0.6875   0.1875   0.6250   0.1875   0.4375   0.0625   0.3750 
##     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA> 
##   0.5625   0.4375   0.6250   0.8125   0.3750   0.4375   0.3125   0.8125 
##     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA> 
##   0.1250   0.5000   0.8125   0.3750   0.4375   0.5000   0.1250   0.8125 
##     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA> 
##   0.3125   0.6250   0.9375   0.8750   0.8125   0.8125   1.0000   0.5000 
##     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA> 
##   0.8125   0.3750   0.3750   0.8750   0.6875   0.7500   0.6875   0.3750 
##     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA> 
##   0.0625   0.5625   0.4375   0.8750   0.6875   0.8125   0.4375   0.1875 
##     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA> 
##   0.3125   0.1875   0.6250   0.7500   0.5625   0.6250   0.6875   0.8125 
##     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA> 
##   0.5625   0.5625   0.7500   0.6875   0.6250   1.0000   0.8125   0.6875 
##     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA> 
##   0.3125   0.3125   0.6250   0.7500   0.1875   0.5625   0.4375   0.4375 
##     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA> 
##   0.8750   0.9375   0.8750   0.8125   0.6250   0.8125   0.5625   0.8125 
##     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA> 
##   0.8125   0.3125   0.5625   0.5625   0.6250   0.5625   0.8125   0.2500 
##     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA> 
##   0.5625   0.1875   0.5625   0.6250   0.3750   0.3125   0.0000   0.3750 
##     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA> 
##   0.7500   0.4375   0.6250   0.9375   0.6875   0.8125   0.7500   0.5000 
##     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA> 
##   0.5000   0.8750   0.5625   0.6250   0.6875   0.6250   0.9375   0.6250 
##     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA> 
##   0.6250   0.3750   0.3125   0.5625   0.6250   0.8750   0.6875   0.8750 
##     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA> 
##   0.8125   0.8125   0.7500   0.6875   1.0000   0.7500   0.8750   0.5625 
##     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA> 
##   0.4375   0.6875   0.8125   0.8750   0.8125   0.1250   0.4375   0.6250 
##     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA> 
##   0.5625   0.5000   0.6875   0.6875   0.6875   0.3750   0.2500   0.5625 
##     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA> 
##   0.2500   0.4375   0.5625   0.0625   0.7500   0.8125   0.6250   0.7500 
##     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA> 
##   0.3750   0.5625   0.2500   0.5000   0.6250   0.4375   0.6875   0.6875 
##     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA> 
##   0.6250   0.9375   0.5625   0.7500   0.9375   0.8750   0.6875   0.5625 
##     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA> 
##   0.7500   0.4375   0.6875   0.6250   0.6875   0.8125   0.3125   0.6875 
##     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA> 
##   0.3125   0.1875   0.6875   0.2500   0.8125   1.0000   0.6875   0.7500 
##     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA> 
##   0.8125   0.6250   0.6875   0.5625   0.8125   0.5000   0.4375   0.6875 
##     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA> 
##   0.8125   0.3750   0.8125   0.2500   0.6875   0.7500   0.2500   0.6875 
##     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA> 
##   0.6250   0.2500   0.6875   0.6875   0.5625   0.2500   0.7500   0.4375 
##     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA> 
##   0.3125   0.5625   0.6250   0.4375   0.2500   0.3750   0.8125   0.6250 
##     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA> 
##   0.6875   0.8750   0.6250   0.7500   0.6250   0.1875   0.7500   0.3750 
##     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA> 
##   0.5625   0.5625   0.5000   0.6250   0.7500   0.8750   0.8750   0.8750 
##     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA> 
##   0.6875   0.7500   0.6875   0.4375   0.8125   0.6250   0.1875   0.1875 
##     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA> 
##   0.3125   0.5000   0.5625   0.9375   0.6250   0.2500   0.3750   0.6250 
##     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA> 
##   0.6875   0.2500   0.5000   0.3125   0.6250   0.7500   0.7500   0.5000 
##     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA> 
##   0.6875   0.1875   0.5000   0.6250   0.7500   0.7500   0.2500   0.8750 
##     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA> 
##   0.3750   0.1875   0.5625   0.8750   0.6250   0.1250   0.4375   0.7500 
##     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA> 
##   0.6250   0.7500   0.5625   0.7500   0.8125   0.5625   0.0625   0.4375 
##     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA> 
##   0.5000   0.8125   0.5625   0.6875   0.4375   0.3750   0.5000   0.3125 
##     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA> 
##   0.2500   0.5625   0.6875   0.4375   0.5625   0.5625   0.8125   1.0000 
##     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA> 
##   0.5000   0.6875   0.9375   0.5625   0.7500   0.6250   0.4375   0.6875 
##     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA> 
##   0.8125   0.8750   0.5000   0.3750   0.7500   0.8125   0.8750   0.5000 
##     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA> 
##   0.8750   0.5000   0.7500   0.0625   0.5000   0.3750   0.9375   0.6250 
##     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA> 
##   0.8125   0.9375   0.8750   0.8750   0.6875   0.6250   0.1250   0.7500 
##     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA> 
##   0.6250   0.3750   0.3125   0.7500   0.8750   0.9375   0.6875   0.3750 
##     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA> 
##   0.5000   0.4375   0.7500   0.8125   0.2500   0.7500   0.8125   0.6250 
##     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA> 
##   0.6875   0.4375   0.7500   0.8750   0.6875   0.6250   0.6875   0.6875 
##     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA> 
##   0.7500   0.6875   0.6250   0.6875   0.5625   0.4375   0.5625   0.6875 
##     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA> 
##   0.6875   0.3125   0.5625   0.5625   0.5000   0.1875   0.4375   0.3750 
##     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA> 
##   0.2500   0.1875   0.2500   0.2500   0.6875   0.6875   0.2500   0.4375 
##     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA> 
##   0.5625   0.5625   0.5625   0.6875   0.5625   0.5000   0.1875   0.4375 
## 
## $missing
##   [1]  1  1  0  0  0  0  0  0  0  0  1  0  2  0  0  0  0  0  0  0 16  0  0
##  [24]  0  0  0  0  0  0  0  0  0  0  0  0  0  1  2  0  1  0  0  0  0  1  0
##  [47]  0  0  0  0  0  0  0  0  0  0  1  0  1  0  0  1  0  0  0  0  0  0  0
##  [70]  0  0  0  0  0  0  0  1  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
##  [93]  1  0  0  0  0  0  0  0  0  0  0  0  0  2  0  0  0  0  0  0  0  6  0
## [116]  0  0  1  0  0  0  0  3  1  0  0  0  0  0  0  0  0  0  0  0  1  0  0
## [139]  0  0  0  0  0  0  0  0  0  0  0  1  0  0  0  0  0  0  0  0  0  0  3
## [162]  0  0  0  0  0  0  0  1  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## [185]  1  0  0  0  0  4  0  0  0  0  0  0  0  0  0  0  0  0  0  1  0  0  0
## [208]  0  0  0  0  0  0  0  0  0  2  0  0  2  0  3  0  0  0  0  0  0  1  0
## [231]  0  0  0  0  0  0  0  0  0  0  0  0  0  6  0  0  0  0  0  1  3  0  0
## [254]  4  0  2  0  4  0 16  5  0  0  0  0  0  0  0  0  0  0  4 16  1  0  1
## [277]  0  0  1  1  0  0  0  1  0  0  0  0  1  0  0  0  0  0  0  1  0  0  0
## [300]  0  0  0  0  0  0  0  2  0  0  1  4  0  0  0  0  0  0  0  1  0  0  0
## [323]  2  0  2  0  7  0  0  0  0  0  0  0  0  0  1  0  0  0  0  0  0  0  0
## [346]  0  4  0  0  0  0  4  0  0  0  0  1  4  0  0  0  0  0  0  0  0  0  0
## [369]  0  0  0  0  1  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  1  0  0
## [392]  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  6
## [415]  8 12  9  4  7  7  6  2 10  4  3  0  7  4  8 11  5 12 12  7 13 13  8
## [438]  8  6  0
## 
## $item.stats
##     key    1    2    3    4    5    6    7    8 miss    r   n mean   sd
## i01   6 0.04 0.01 0.03 0.01 0.01 0.73 0.13 0.03 0.02 0.52 433 0.73 0.44
## i02   8 0.00 0.08 0.01 0.01 0.00 0.03 0.06 0.80 0.01 0.57 435 0.80 0.40
## i03   1 0.79 0.03 0.07 0.02 0.01 0.03 0.00 0.04 0.03 0.52 428 0.79 0.40
## i04   6 0.05 0.02 0.03 0.02 0.09 0.76 0.01 0.02 0.02 0.53 432 0.76 0.43
## i05   2 0.01 0.67 0.00 0.04 0.21 0.02 0.03 0.02 0.02 0.56 430 0.67 0.47
## i06   1 0.72 0.07 0.14 0.03 0.02 0.00 0.02 0.01 0.03 0.46 428 0.72 0.45
## i07   4 0.00 0.23 0.01 0.63 0.10 0.00 0.01 0.02 0.03 0.40 427 0.63 0.48
## i08   5 0.02 0.04 0.05 0.03 0.67 0.01 0.06 0.13 0.03 0.52 428 0.67 0.47
## i09   3 0.05 0.05 0.67 0.06 0.03 0.01 0.01 0.13 0.05 0.45 418 0.67 0.47
## i10   8 0.18 0.00 0.01 0.05 0.04 0.00 0.01 0.70 0.05 0.46 416 0.70 0.46
## i11   2 0.01 0.35 0.02 0.04 0.40 0.02 0.05 0.11 0.08 0.39 405 0.35 0.48
## i12   5 0.03 0.02 0.20 0.03 0.50 0.07 0.13 0.01 0.08 0.47 405 0.50 0.50
## i13   4 0.40 0.01 0.05 0.37 0.02 0.04 0.05 0.06 0.07 0.36 407 0.37 0.48
## i14   4 0.08 0.05 0.33 0.36 0.05 0.06 0.03 0.03 0.09 0.48 401 0.36 0.48
## i15   2 0.09 0.44 0.11 0.16 0.02 0.08 0.03 0.07 0.11 0.46 391 0.44 0.50
## i16   1 0.29 0.03 0.14 0.08 0.11 0.04 0.18 0.13 0.10 0.44 397 0.29 0.45
##      skew kurtosis   se
## i01 -1.04    -0.91 0.02
## i02 -1.53     0.35 0.02
## i03 -1.45     0.11 0.02
## i04 -1.21    -0.54 0.02
## i05 -0.71    -1.50 0.02
## i06 -0.96    -1.08 0.02
## i07 -0.52    -1.74 0.02
## i08 -0.72    -1.48 0.02
## i09 -0.71    -1.50 0.02
## i10 -0.89    -1.21 0.02
## i11  0.61    -1.63 0.02
## i12  0.00    -2.00 0.02
## i13  0.55    -1.70 0.02
## i14  0.56    -1.69 0.02
## i15  0.23    -1.95 0.03
## i16  0.94    -1.12 0.02
## 
## $alpha
## [1] 0.77
## 
## $av.r
## [1] 0.17


print.psych(ri_classicas2, short = FALSE)
## Call: NULL
## 
## (Unstandardized) Alpha:
## [1] 0.77
## 
## Average item correlation:
## [1] 0.17
## 
## item statistics 
##     key    1    2    3    4    5    6    7    8 miss    r   n mean   sd
## i01   6 0.04 0.01 0.03 0.01 0.01 0.73 0.13 0.03 0.02 0.52 433 0.73 0.44
## i02   8 0.00 0.08 0.01 0.01 0.00 0.03 0.06 0.80 0.01 0.57 435 0.80 0.40
## i03   1 0.79 0.03 0.07 0.02 0.01 0.03 0.00 0.04 0.03 0.52 428 0.79 0.40
## i04   6 0.05 0.02 0.03 0.02 0.09 0.76 0.01 0.02 0.02 0.53 432 0.76 0.43
## i05   2 0.01 0.67 0.00 0.04 0.21 0.02 0.03 0.02 0.02 0.56 430 0.67 0.47
## i06   1 0.72 0.07 0.14 0.03 0.02 0.00 0.02 0.01 0.03 0.46 428 0.72 0.45
## i07   4 0.00 0.23 0.01 0.63 0.10 0.00 0.01 0.02 0.03 0.40 427 0.63 0.48
## i08   5 0.02 0.04 0.05 0.03 0.67 0.01 0.06 0.13 0.03 0.52 428 0.67 0.47
## i09   3 0.05 0.05 0.67 0.06 0.03 0.01 0.01 0.13 0.05 0.45 418 0.67 0.47
## i10   8 0.18 0.00 0.01 0.05 0.04 0.00 0.01 0.70 0.05 0.46 416 0.70 0.46
## i11   2 0.01 0.35 0.02 0.04 0.40 0.02 0.05 0.11 0.08 0.39 405 0.35 0.48
## i12   5 0.03 0.02 0.20 0.03 0.50 0.07 0.13 0.01 0.08 0.47 405 0.50 0.50
## i13   4 0.40 0.01 0.05 0.37 0.02 0.04 0.05 0.06 0.07 0.36 407 0.37 0.48
## i14   4 0.08 0.05 0.33 0.36 0.05 0.06 0.03 0.03 0.09 0.48 401 0.36 0.48
## i15   2 0.09 0.44 0.11 0.16 0.02 0.08 0.03 0.07 0.11 0.46 391 0.44 0.50
## i16   1 0.29 0.03 0.14 0.08 0.11 0.04 0.18 0.13 0.10 0.44 397 0.29 0.45
##      skew kurtosis   se
## i01 -1.04    -0.91 0.02
## i02 -1.53     0.35 0.02
## i03 -1.45     0.11 0.02
## i04 -1.21    -0.54 0.02
## i05 -0.71    -1.50 0.02
## i06 -0.96    -1.08 0.02
## i07 -0.52    -1.74 0.02
## i08 -0.72    -1.48 0.02
## i09 -0.71    -1.50 0.02
## i10 -0.89    -1.21 0.02
## i11  0.61    -1.63 0.02
## i12  0.00    -2.00 0.02
## i13  0.55    -1.70 0.02
## i14  0.56    -1.69 0.02
## i15  0.23    -1.95 0.03
## i16  0.94    -1.12 0.02
irt.responses(ri_classicas2$scores, ri[, c(2:17)], breaks = 11)

plot of chunk unnamed-chunk-7 plot of chunk unnamed-chunk-7 plot of chunk unnamed-chunk-7 plot of chunk unnamed-chunk-7 plot of chunk unnamed-chunk-7 plot of chunk unnamed-chunk-7 plot of chunk unnamed-chunk-7 plot of chunk unnamed-chunk-7 plot of chunk unnamed-chunk-7 plot of chunk unnamed-chunk-7 plot of chunk unnamed-chunk-7 plot of chunk unnamed-chunk-7 plot of chunk unnamed-chunk-7 plot of chunk unnamed-chunk-7 plot of chunk unnamed-chunk-7 plot of chunk unnamed-chunk-7

Calibração dos parâmetros TRI de modelo TRI de 3 parâmetros com o ltm e fazendo os gráficos das CCI's

ri_descri <- descript(ri_classicas1, n.print = 10)
print(ri_descri)
## 
## Descriptive statistics for the 'ri_classicas1' data-set
## 
## Sample:
##  16 items and 440 sample units; 359 missing values
## 
## Proportions for each level of response:
##                     logit
## i01 0.2679 0.7321  1.0053
## i02 0.1954 0.8046  1.4153
## i03 0.2056 0.7944  1.3516
## i04 0.2407 0.7593  1.1486
## i05 0.3326 0.6674  0.6966
## i06 0.2827 0.7173  0.9311
## i07 0.3747 0.6253  0.5121
## i08 0.3294 0.6706  0.7107
## i09 0.3325 0.6675  0.6967
## i10 0.2957 0.7043  0.8680
## i11 0.6469 0.3531 -0.6055
## i12 0.4988 0.5012  0.0049
## i13 0.6339 0.3661 -0.5490
## i14 0.6359 0.3641 -0.5577
## i15 0.5575 0.4425 -0.2312
## i16 0.7128 0.2872 -0.9092
## 
## Missing responses:
##        i01   i02    i03   i04    i05    i06    i07    i08 i09    i10
## Freq 7.000 5.000 12.000 8.000 10.000 12.000 13.000 12.000  22 24.000
## (%)  1.591 1.136  2.727 1.818  2.273  2.727  2.954  2.727   5  5.455
##         i11    i12  i13    i14   i15    i16
## Freq 35.000 35.000 33.0 39.000 49.00 43.000
## (%)   7.955  7.955  7.5  8.864 11.14  9.773
## 
## 
## Frequencies of total scores:
##      0 1 2  3  4  5  6  7  8  9 10 11 12 13 14 15 16
## Freq 1 4 5 11 14 14 23 24 22 35 44 45 33 38 24 14  3
## 
## 
## Point Biserial correlation with Total Score:
##     Included Excluded
## i01   0.5289   0.4256
## i02   0.5588   0.4730
## i03   0.4873   0.3928
## i04   0.5291   0.4320
## i05   0.5677   0.4627
## i06   0.4228   0.3073
## i07   0.4075   0.2809
## i08   0.5334   0.4263
## i09   0.4613   0.3433
## i10   0.4492   0.3348
## i11   0.3717   0.2423
## i12   0.4690   0.3435
## i13   0.3423   0.2087
## i14   0.4628   0.3415
## i15   0.4628   0.3375
## i16   0.4398   0.3241
## 
## 
## Cronbach's alpha:
##                value
## All Items     0.7980
## Excluding i01 0.7868
## Excluding i02 0.7801
## Excluding i03 0.7837
## Excluding i04 0.7837
## Excluding i05 0.7813
## Excluding i06 0.7876
## Excluding i07 0.7916
## Excluding i08 0.7821
## Excluding i09 0.7884
## Excluding i10 0.7835
## Excluding i11 0.7952
## Excluding i12 0.7873
## Excluding i13 0.7970
## Excluding i14 0.7886
## Excluding i15 0.7894
## Excluding i16 0.7919
## 
## 
## Pairwise Associations:
##    Item i Item j p.value
## 1       5     13   0.266
## 2      13     16   0.264
## 3      11     16   0.244
## 4       9     11   0.224
## 5      12     13   0.181
## 6       9     15   0.142
## 7       7     10   0.134
## 8      10     11   0.117
## 9       4     13   0.090
## 10      9     10   0.086
rim3 <- tpm(ri_classicas1, max.guessing = 0.4, IRT.param = TRUE)
plot(ri_descri, includeFirstLast = TRUE, type = "b", lty = 1, pch = 1:6)

plot of chunk unnamed-chunk-8

plot(rim3, lwd = 2, legend = TRUE, ncol = 2)

plot of chunk unnamed-chunk-8

print(rim3)
## 
## Call:
## tpm(data = ri_classicas1, max.guessing = 0.4, IRT.param = TRUE)
## 
## Coefficients:
##      Gussng  Dffclt  Dscrmn
## i01   0.227  -0.526   1.841
## i02   0.001  -1.082   2.238
## i03   0.101  -1.013   1.843
## i04   0.000  -1.063   1.478
## i05   0.000  -0.639   1.470
## i06   0.212  -0.581   1.269
## i07   0.000  -0.742   0.758
## i08   0.008  -0.720   1.235
## i09   0.191  -0.361   1.275
## i10   0.107  -0.729   1.189
## i11   0.015   0.979   0.760
## i12   0.000   0.007   1.049
## i13   0.000   0.979   0.623
## i14   0.000   0.639   1.151
## i15   0.081   0.461   1.294
## i16   0.000   1.062   1.065
## 
## Log.Lik: -3740

Salvando os objetos

save.image("~/Dropbox/TRI/ri_rld/ri_exemplo.RData")