Abre banco
  load("ex2/enem_2015.RData")
Testando DIF em relação ao gênero
  names(enem_2015)
##   [1] "NU_INSCRICAO"                "NU_ANO"                     
##   [3] "CO_MUNICIPIO_RESIDENCIA"     "NO_MUNICIPIO_RESIDENCIA"    
##   [5] "CO_UF_RESIDENCIA"            "SG_UF_RESIDENCIA"           
##   [7] "IN_ESTUDA_CLASSE_HOSPITALAR" "IN_TREINEIRO"               
##   [9] "CO_ESCOLA"                   "CO_MUNICIPIO_ESC"           
##  [11] "NO_MUNICIPIO_ESC"            "CO_UF_ESC"                  
##  [13] "SG_UF_ESC"                   "TP_DEPENDENCIA_ADM_ESC"     
##  [15] "TP_LOCALIZACAO_ESC"          "TP_SIT_FUNC_ESC"            
##  [17] "NU_IDADE"                    "TP_SEXO"                    
##  [19] "TP_NACIONALIDADE"            "CO_MUNICIPIO_NASCIMENTO"    
##  [21] "NO_MUNICIPIO_NASCIMENTO"     "CO_UF_NASCIMENTO"           
##  [23] "SG_UF_NASCIMENTO"            "TP_ST_CONCLUSAO"            
##  [25] "TP_ANO_CONCLUIU"             "TP_ESCOLA"                  
##  [27] "TP_ENSINO"                   "TP_ESTADO_CIVIL"            
##  [29] "TP_COR_RACA"                 "IN_BAIXA_VISAO"             
##  [31] "IN_CEGUEIRA"                 "IN_SURDEZ"                  
##  [33] "IN_DEFICIENCIA_AUDITIVA"     "IN_SURDO_CEGUEIRA"          
##  [35] "IN_DEFICIENCIA_FISICA"       "IN_DEFICIENCIA_MENTAL"      
##  [37] "IN_DEFICIT_ATENCAO"          "IN_DISLEXIA"                
##  [39] "IN_GESTANTE"                 "IN_LACTANTE"                
##  [41] "IN_IDOSO"                    "IN_DISCALCULIA"             
##  [43] "IN_AUTISMO"                  "IN_VISAO_MONOCULAR"         
##  [45] "IN_SABATISTA"                "IN_OUTRA_DEF"               
##  [47] "IN_SEM_RECURSO"              "IN_NOME_SOCIAL"             
##  [49] "IN_BRAILLE"                  "IN_AMPLIADA_24"             
##  [51] "IN_AMPLIADA_18"              "IN_LEDOR"                   
##  [53] "IN_ACESSO"                   "IN_TRANSCRICAO"             
##  [55] "IN_LIBRAS"                   "IN_LEITURA_LABIAL"          
##  [57] "IN_MESA_CADEIRA_RODAS"       "IN_MESA_CADEIRA_SEPARADA"   
##  [59] "IN_APOIO_PERNA"              "IN_GUIA_INTERPRETE"         
##  [61] "IN_MACA"                     "IN_COMPUTADOR"              
##  [63] "IN_CADEIRA_ESPECIAL"         "IN_CADEIRA_CANHOTO"         
##  [65] "IN_CADEIRA_ACOLCHOADA"       "IN_PROVA_DEITADO"           
##  [67] "IN_MOBILIARIO_OBESO"         "IN_LAMINA_OVERLAY"          
##  [69] "IN_PROTETOR_AURICULAR"       "IN_MEDIDOR_GLICOSE"         
##  [71] "IN_MAQUINA_BRAILE"           "IN_SOROBAN"                 
##  [73] "IN_MARCA_PASSO"              "IN_SONDA"                   
##  [75] "IN_MEDICAMENTOS"             "IN_SALA_INDIVIDUAL"         
##  [77] "IN_SALA_ESPECIAL"            "IN_SALA_ACOMPANHANTE"       
##  [79] "IN_MOBILIARIO_ESPECIFICO"    "IN_MATERIAL_ESPECIFICO"     
##  [81] "IN_CERTIFICADO"              "NO_ENTIDADE_CERTIFICACAO"   
##  [83] "CO_UF_ENTIDADE_CERTIFICACAO" "SG_UF_ENTIDADE_CERTIFICACAO"
##  [85] "CO_MUNICIPIO_PROVA"          "NO_MUNICIPIO_PROVA"         
##  [87] "CO_UF_PROVA"                 "SG_UF_PROVA"                
##  [89] "TP_PRESENCA_CN"              "TP_PRESENCA_CH"             
##  [91] "TP_PRESENCA_LC"              "TP_PRESENCA_MT"             
##  [93] "CO_PROVA_CN"                 "CO_PROVA_CH"                
##  [95] "CO_PROVA_LC"                 "CO_PROVA_MT"                
##  [97] "NU_NOTA_CN"                  "NU_NOTA_CH"                 
##  [99] "NU_NOTA_LC"                  "NU_NOTA_MT"                 
## [101] "TX_RESPOSTAS_CN"             "TX_RESPOSTAS_CH"            
## [103] "TX_RESPOSTAS_LC"             "TX_RESPOSTAS_MT"            
## [105] "TP_LINGUA"                   "TX_GABARITO_CN"             
## [107] "TX_GABARITO_CH"              "TX_GABARITO_LC"             
## [109] "TX_GABARITO_MT"              "TP_STATUS_REDACAO"          
## [111] "NU_NOTA_COMP1"               "NU_NOTA_COMP2"              
## [113] "NU_NOTA_COMP3"               "NU_NOTA_COMP4"              
## [115] "NU_NOTA_COMP5"               "NU_NOTA_REDACAO"            
## [117] "Q001"                        "Q002"                       
## [119] "Q003"                        "Q004"                       
## [121] "Q005"                        "Q006"                       
## [123] "Q007"                        "Q008"                       
## [125] "Q009"                        "Q010"                       
## [127] "Q011"                        "Q012"                       
## [129] "Q013"                        "Q014"                       
## [131] "Q015"                        "Q016"                       
## [133] "Q017"                        "Q018"                       
## [135] "Q019"                        "Q020"                       
## [137] "Q021"                        "Q022"                       
## [139] "Q023"                        "Q024"                       
## [141] "Q025"                        "Q026"                       
## [143] "Q027"                        "Q028"                       
## [145] "Q029"                        "Q030"                       
## [147] "Q031"                        "Q032"                       
## [149] "Q033"                        "Q034"                       
## [151] "Q035"                        "Q036"                       
## [153] "Q037"                        "Q038"                       
## [155] "Q039"                        "Q040"                       
## [157] "Q041"                        "Q042"                       
## [159] "Q043"                        "Q044"                       
## [161] "Q045"                        "Q046"                       
## [163] "Q047"                        "Q048"                       
## [165] "Q049"                        "Q050"                       
## [167] "totCH"                       "NU_NOTA_CHz"                
## [169] "theta_ch1"                   "theta_ch2"                  
## [171] "theta_ch3"                   "theta_ch4"
  library(jmv)
  
  descriptives(formula = NU_NOTA_MT ~ TP_SEXO, enem_2015, hist=T, box=T)
## 
##  DESCRIPTIVES
## 
##  Descriptives                         
##  ──────────────────────────────────── 
##               TP_SEXO    NU_NOTA_MT   
##  ──────────────────────────────────── 
##    N          F               70204   
##               M               49623   
##    Missing    F                   0   
##               M                   0   
##    Mean       F                 452   
##               M                 485   
##    Median     F                 435   
##               M                 459   
##    Minimum    F                0.00   
##               M                0.00   
##    Maximum    F                 982   
##               M                 992   
##  ────────────────────────────────────

  descriptives(formula = NU_NOTA_CH ~ TP_SEXO, enem_2015, hist=T, box=T)
## 
##  DESCRIPTIVES
## 
##  Descriptives                         
##  ──────────────────────────────────── 
##               TP_SEXO    NU_NOTA_CH   
##  ──────────────────────────────────── 
##    N          F               70204   
##               M               49623   
##    Missing    F                   0   
##               M                   0   
##    Mean       F                 551   
##               M                 570   
##    Median     F                 556   
##               M                 578   
##    Minimum    F                0.00   
##               M                0.00   
##    Maximum    F                 797   
##               M                 823   
##  ────────────────────────────────────

  descriptives(formula = NU_NOTA_LC ~ TP_SEXO, enem_2015, hist=T, box=T)
## 
##  DESCRIPTIVES
## 
##  Descriptives                         
##  ──────────────────────────────────── 
##               TP_SEXO    NU_NOTA_LC   
##  ──────────────────────────────────── 
##    N          F               70204   
##               M               49623   
##    Missing    F                   0   
##               M                   0   
##    Mean       F                 505   
##               M                 505   
##    Median     F                 508   
##               M                 509   
##    Minimum    F                0.00   
##               M                0.00   
##    Maximum    F                 778   
##               M                 789   
##  ────────────────────────────────────

  descriptives(formula = NU_NOTA_CN ~ TP_SEXO, enem_2015, hist=T, box=T)
## 
##  DESCRIPTIVES
## 
##  Descriptives                         
##  ──────────────────────────────────── 
##               TP_SEXO    NU_NOTA_CN   
##  ──────────────────────────────────── 
##    N          F               70204   
##               M               49623   
##    Missing    F                   0   
##               M                   0   
##    Mean       F                 470   
##               M                 497   
##    Median     F                 462   
##               M                 493   
##    Minimum    F                0.00   
##               M                0.00   
##    Maximum    F                 810   
##               M                 824   
##  ────────────────────────────────────

  ttestIS(formula = NU_NOTA_MT ~ TP_SEXO, enem_2015, meanDiff = T, effectSize = T)
## 
##  INDEPENDENT SAMPLES T-TEST
## 
##  Independent Samples T-Test                                                                                      
##  ─────────────────────────────────────────────────────────────────────────────────────────────────────────────── 
##                                 statistic    df        p         Mean difference    SE difference    Cohen's d   
##  ─────────────────────────────────────────────────────────────────────────────────────────────────────────────── 
##    NU_NOTA_MT    Student's t      -51.9 ᵃ    119825    < .001              -32.2            0.619       -0.305   
##  ─────────────────────────────────────────────────────────────────────────────────────────────────────────────── 
##    ᵃ Levene's test is significant (p < .05), suggesting a violation of the assumption of equal variances
  ttestIS(formula = NU_NOTA_CH ~ TP_SEXO, enem_2015, meanDiff = T, effectSize = T)
## 
##  INDEPENDENT SAMPLES T-TEST
## 
##  Independent Samples T-Test                                                                                      
##  ─────────────────────────────────────────────────────────────────────────────────────────────────────────────── 
##                                 statistic    df        p         Mean difference    SE difference    Cohen's d   
##  ─────────────────────────────────────────────────────────────────────────────────────────────────────────────── 
##    NU_NOTA_CH    Student's t      -46.4 ᵃ    119825    < .001              -19.0            0.410       -0.272   
##  ─────────────────────────────────────────────────────────────────────────────────────────────────────────────── 
##    ᵃ Levene's test is significant (p < .05), suggesting a violation of the assumption of equal variances
  ttestIS(formula = NU_NOTA_LC ~ TP_SEXO, enem_2015, meanDiff = T, effectSize = T)
## 
##  INDEPENDENT SAMPLES T-TEST
## 
##  Independent Samples T-Test                                                                                     
##  ────────────────────────────────────────────────────────────────────────────────────────────────────────────── 
##                                 statistic    df        p        Mean difference    SE difference    Cohen's d   
##  ────────────────────────────────────────────────────────────────────────────────────────────────────────────── 
##    NU_NOTA_LC    Student's t      0.845 ᵃ    119825    0.398              0.354            0.419      0.00495   
##  ────────────────────────────────────────────────────────────────────────────────────────────────────────────── 
##    ᵃ Levene's test is significant (p < .05), suggesting a violation of the assumption of equal variances
  ttestIS(formula = NU_NOTA_CN ~ TP_SEXO, enem_2015, meanDiff = T, effectSize = T)
## 
##  INDEPENDENT SAMPLES T-TEST
## 
##  Independent Samples T-Test                                                                                      
##  ─────────────────────────────────────────────────────────────────────────────────────────────────────────────── 
##                                 statistic    df        p         Mean difference    SE difference    Cohen's d   
##  ─────────────────────────────────────────────────────────────────────────────────────────────────────────────── 
##    NU_NOTA_CN    Student's t      -66.1 ᵃ    119825    < .001              -27.2            0.411       -0.388   
##  ─────────────────────────────────────────────────────────────────────────────────────────────────────────────── 
##    ᵃ Levene's test is significant (p < .05), suggesting a violation of the assumption of equal variances
library(difNLR) 
library(difR) 
library(ShinyItemAnalysis)
library(tidyverse)

library(sjmisc)

dif_mt <- difLogistic(Data = score_mt, 
                      group = enem_2015$TP_SEXO, 
                      focal.name = "M")

plot(dif_mt, item = 9)

## The plot was not captured!
dif_mt 
## 
## Detection of both types of Differential Item Functioning
## using Logistic regression method, without item purification
## and with LRT DIF statistic
## 
## Matching variable: test score 
##  
## No set of anchor items was provided 
##  
## No p-value adjustment for multiple comparisons 
##  
## Logistic regression DIF statistic: 
##  
##       Stat.    P-value     
## mt_1    5.4104   0.0669 .  
## mt_2    6.6516   0.0359 *  
## mt_3   55.4907   0.0000 ***
## mt_4   56.4363   0.0000 ***
## mt_5   86.6963   0.0000 ***
## mt_6    7.6229   0.0221 *  
## mt_7   19.7332   0.0001 ***
## mt_8  969.6798   0.0000 ***
## mt_9  244.0284   0.0000 ***
## mt_10  59.6655   0.0000 ***
## mt_11  43.9151   0.0000 ***
## mt_12  36.2578   0.0000 ***
## mt_13  52.4714   0.0000 ***
## mt_14  50.1734   0.0000 ***
## mt_15  84.7759   0.0000 ***
## mt_16  35.3886   0.0000 ***
## mt_17  27.9540   0.0000 ***
## mt_18  53.1997   0.0000 ***
## mt_19  15.1048   0.0005 ***
## mt_20   5.1470   0.0763 .  
## mt_21  26.9458   0.0000 ***
## mt_22  69.9924   0.0000 ***
## mt_23   3.0749   0.2149    
## mt_24  40.4738   0.0000 ***
## mt_25  97.9958   0.0000 ***
## mt_26  18.6090   0.0001 ***
## mt_27   1.2043   0.5476    
## mt_28  64.9706   0.0000 ***
## mt_29  48.6880   0.0000 ***
## mt_30  24.9621   0.0000 ***
## mt_31 291.2781   0.0000 ***
## mt_32  76.2519   0.0000 ***
## mt_33  20.7539   0.0000 ***
## mt_34 354.4533   0.0000 ***
## mt_35   8.6630   0.0131 *  
## mt_36  10.7153   0.0047 ** 
## mt_37  59.1848   0.0000 ***
## mt_38  53.8092   0.0000 ***
## mt_39  35.7827   0.0000 ***
## mt_40  20.3393   0.0000 ***
## mt_41  78.0314   0.0000 ***
## mt_42  14.1198   0.0009 ***
## mt_43 519.4857   0.0000 ***
## mt_44   6.2372   0.0442 *  
## mt_45   9.3163   0.0095 ** 
## 
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1  
## 
## Detection threshold: 5.9915 (significance level: 0.05)
## 
## Items detected as DIF items:
##       
##  mt_2 
##  mt_3 
##  mt_4 
##  mt_5 
##  mt_6 
##  mt_7 
##  mt_8 
##  mt_9 
##  mt_10
##  mt_11
##  mt_12
##  mt_13
##  mt_14
##  mt_15
##  mt_16
##  mt_17
##  mt_18
##  mt_19
##  mt_21
##  mt_22
##  mt_24
##  mt_25
##  mt_26
##  mt_28
##  mt_29
##  mt_30
##  mt_31
##  mt_32
##  mt_33
##  mt_34
##  mt_35
##  mt_36
##  mt_37
##  mt_38
##  mt_39
##  mt_40
##  mt_41
##  mt_42
##  mt_43
##  mt_44
##  mt_45
## 
##  
## Effect size (Nagelkerke's R^2): 
##  
## Effect size code: 
##  'A': negligible effect 
##  'B': moderate effect 
##  'C': large effect 
##  
##       R^2   ZT JG
## mt_1  0e+00 A  A 
## mt_2  0e+00 A  A 
## mt_3  0e+00 A  A 
## mt_4  0e+00 A  A 
## mt_5  0e+00 A  A 
## mt_6  0e+00 A  A 
## mt_7  0e+00 A  A 
## mt_8  0e+00 A  A 
## mt_9  0e+00 A  A 
## mt_10 5e-04 A  A 
## mt_11 0e+00 A  A 
## mt_12 0e+00 A  A 
## mt_13 0e+00 A  A 
## mt_14 4e-04 A  A 
## mt_15 0e+00 A  A 
## mt_16 0e+00 A  A 
## mt_17 0e+00 A  A 
## mt_18 0e+00 A  A 
## mt_19 0e+00 A  A 
## mt_20 0e+00 A  A 
## mt_21 0e+00 A  A 
## mt_22 0e+00 A  A 
## mt_23 0e+00 A  A 
## mt_24 0e+00 A  A 
## mt_25 0e+00 A  A 
## mt_26 0e+00 A  A 
## mt_27 0e+00 A  A 
## mt_28 0e+00 A  A 
## mt_29 0e+00 A  A 
## mt_30 2e-04 A  A 
## mt_31 0e+00 A  A 
## mt_32 0e+00 A  A 
## mt_33 0e+00 A  A 
## mt_34 0e+00 A  A 
## mt_35 0e+00 A  A 
## mt_36 0e+00 A  A 
## mt_37 0e+00 A  A 
## mt_38 0e+00 A  A 
## mt_39 0e+00 A  A 
## mt_40 0e+00 A  A 
## mt_41 6e-04 A  A 
## mt_42 0e+00 A  A 
## mt_43 0e+00 A  A 
## mt_44 0e+00 A  A 
## mt_45 0e+00 A  A 
## 
## Effect size codes: 
##  Zumbo & Thomas (ZT): 0 'A' 0.13 'B' 0.26 'C' 1 
##  Jodoin & Gierl (JG): 0 'A' 0.035 'B' 0.07 'C' 1 
## 
##  Output was not captured!
enem_2015$fem <- ifelse(enem_2015$TP_SEXO =="F", 1, 0)

plotDIFLogistic(data = score_mt, group = enem_2015$fem, item = 8 )

 fit <-  ddfMLR(Data = resp_mt, focal.name = 1,
      group = enem_2015$fem, key = gabMT)
 
 plot(fit, item = 8)
## [[1]]

Item 8

Item 8

plotDIFLogistic(data = score_mt, group = enem_2015$fem, item = 9 )

plotDIFLogistic(data = score_mt, group = enem_2015$fem, item = 31)

plotDIFLogistic(data = score_mt, group = enem_2015$fem, item = 34 )

plotDIFLogistic(data = score_mt, group = enem_2015$fem, item = 43 )

Resolvendo DIF

Exercício 5 Tente Você