class: center, middle, inverse, title-slide .title[ # Item Response Theory for beginners ] .subtitle[ ## Stimare, scegliere i modelli e verificare le assunzioni in R ] .author[ ### Dr. Ottavia M. Epifania ] .institute[ ### Bressanone ] .date[ ### Corso IRT @ Università Libera di Bolzano, 17-18 Gennaio 2023 ] --- <style type="text/css"> pre { max-height: 700px; overflow-y: auto; } pre[class] { max-height: 500px; } .scroll-100 { max-height: 500px; overflow-y: auto; } .inverse { background-color: #272822; color: #d6d6d6; text-shadow: 0 0 20px #333; } .scrollable { height: 500px; overflow-y: auto; } .scrollable-auto { height: 80%; overflow-y: auto; } .remark-slide-number { display: none; } </style> --- class: section, center, middle # Getting started --- ## Create a new project I New file `\(\rightarrow\)` New project <img src="img/project1.png" width="90%" style="display: block; margin: auto;" /> --- ## Create a new project II .pull-left[ <img src="img/project2.png" width="90%" style="display: block; margin: auto;" /> ] .pull-right[ <img src="img/project3.png" width="90%" style="display: block; margin: auto;" /> ] --- ## Pacchetti .pull-left[ .center[Installazione] ```r install.packages("lavaan") install.packages("TAM") install.packages("mokken") install.packages("difR") install.packages("ggplot2") ``` ] .pull-right[ .center[Caricamento] ```r library("lavaan") library("TAM") library("mokken") library("difR") library("ggplot2") ``` ] --- ## Codici utili ```r # questa funzione calcola la probabilità di risposta corretta dato un certo theta e determinati valori dell'item IRT <- function(theta, a = 1, b = 0, c = 0,e = 1) { y <- c + (e - c) * exp(a * (theta - b)) / (1 + exp(a * (theta - b))) y[is.na(y)] = 1 return(y) } ``` --- ## Codici utili II .scrollable[ ```r # questa funzione estrae tutti gli item e i loro parametri e calcola la probabilità di risposta corretta per ogni item per ogni livello di theta # restituisce una lista con dentro il dataset usatoe un grafico in ggplot irt.icc = function(model) { item_par = model$item est_theta = seq(-4,4, length.out=1000) item_prob = list() if (any(grep("guess", colnames(item_par))) == F) { for (i in 1:nrow(item_par)) { item_prob[[i]] = data.frame(theta = est_theta) item_prob[[i]]$it_p = IRT(item_prob[[i]]$theta, b = item_par[i, "xsi.item"], a = item_par[i, "B.Cat1.Dim1"]) item_prob[[i]]$item = item_par[i, "item"] } } else { for (i in 1:nrow(item_par)) { item_prob[[i]] = data.frame(theta = est_theta) item_prob[[i]]$it_p = IRT(item_prob[[i]]$theta, b = item_par[i, "AXsi_.Cat1"], a = item_par[i, "B.Cat1.Dim1"], c = item_par[i, "guess"]) item_prob[[i]]$item = item_par[i, "item"] } } p = do.call("rbind", item_prob) gp = ggplot(p, aes(x = theta, y = it_p, group = item, col = item)) + geom_line(lwd = 1) object = list(prob.data = p, icc.graph = gp) return(object) } ``` ] --- ## Codici utili III .scrollable[ ```r irt.iif = function(model) { est_theta = IRT.factor.scores(model, type = "EAP")$EAP ii = IRT.informationCurves(model, theta = est_theta) test_info = data.frame(theta = est_theta, info = ii$test_info_curve, se = ii$se_curve) iif_info = list() for(i in 1:nrow(ii$info_curves_item)) { iif_info[[i]] = data.frame(theta = est_theta) iif_info[[i]]$ii_item = ii$info_curves_item[i, ] iif_info[[i]]$item = dimnames(ii$info_curves_item)[[1]][i] } dat_info = do.call("rbind", iif_info) info_tot = list(test_info = test_info, item_info = dat_info) return(info_tot) } ``` ] --- --- class: section, center, middle # Importare i dati --- ## Caricare i dati in R .scrollable[ Scaricare il file `dataClass.csv` dalla cartella [Dati](https://drive.google.com/drive/folders/1PXDG7HhjRDMdFEQjk5WQQWdiorDpSgtw?usp=sharing) Salvarlo all'interno della sottocartella `Dati` del progetto `R` che avete creato per il corso Usate questo codice: ```r data = read.csv("Dati/dataClass.csv", header = T, sep = ",") ``` ] --- ## Look at the data - Item I .scrollable[ ```r vis_data = data vis_data$id = paste0("s", 1:nrow(data)) vis_data = vis_data[, c(ncol(vis_data), 1:ncol(data))] vis_data = reshape(vis_data, idvar = "id", direction = "long", varying = list(2:ncol(vis_data)), v.names = "resp", times = names(vis_data)[-1], timevar = "item") prop_data = data.frame(table(vis_data$item, vis_data$resp)) colnames(prop_data)[1:2] = c("item", "response") prop_data$proportion = prop_data$Freq/nrow(data) ggplot(prop_data, aes(x = item, y=proportion, fill = response)) + geom_bar(stat = "identity") + theme(axis.text = element_text(angle = 90)) + geom_hline(aes(yintercept=.50)) + theme_bw() ``` <img src="stimareImodelli_files/figure-html/unnamed-chunk-11-1.png" width="90%" style="display: block; margin: auto;" /> ] --- ## Look at the data - Respondents .scrollable[ ```r sbj_data = data sbj_data$id = paste0("s", 1:nrow(data)) sbj_data = sbj_data[, c(ncol(sbj_data), 1:ncol(data))] sbj_data$sum = rowSums(sbj_data[,-1]) boxplot(sbj_data$sum) ``` <img src="stimareImodelli_files/figure-html/unnamed-chunk-12-1.png" width="90%" style="display: block; margin: auto;" /> ] --- class: section, center, middle # Stima dei modelli --- ## 1PL - Stima .scrollable[ ```r m1pl = tam.mml(data, verbose = F) summary(m1pl) ``` ```{.scroll-100} ## ------------------------------------------------------------ ## TAM 4.0-16 (2022-05-13 13:23:23) ## R version 4.2.2 (2022-10-31 ucrt) x86_64, mingw32 | nodename=LAPTOP-OTTAVIA | login=huawei ## ## Date of Analysis: 2023-01-17 08:09:53 ## Time difference of 0.09267402 secs ## Computation time: 0.09267402 ## ## Multidimensional Item Response Model in TAM ## ## IRT Model: 1PL ## Call: ## tam.mml(resp = data, verbose = F) ## ## ------------------------------------------------------------ ## Number of iterations = 34 ## Numeric integration with 21 integration points ## ## Deviance = 5413.25 ## Log likelihood = -2706.63 ## Number of persons = 1000 ## Number of persons used = 1000 ## Number of items = 5 ## Number of estimated parameters = 6 ## Item threshold parameters = 5 ## Item slope parameters = 0 ## Regression parameters = 0 ## Variance/covariance parameters = 1 ## ## AIC = 5425 | penalty=12 | AIC=-2*LL + 2*p ## AIC3 = 5431 | penalty=18 | AIC3=-2*LL + 3*p ## BIC = 5455 | penalty=41.45 | BIC=-2*LL + log(n)*p ## aBIC = 5436 | penalty=22.37 | aBIC=-2*LL + log((n-2)/24)*p (adjusted BIC) ## CAIC = 5461 | penalty=47.45 | CAIC=-2*LL + [log(n)+1]*p (consistent AIC) ## AICc = 5425 | penalty=12.08 | AICc=-2*LL + 2*p + 2*p*(p+1)/(n-p-1) (bias corrected AIC) ## GHP = 0.54253 | GHP=( -LL + p ) / (#Persons * #Items) (Gilula-Haberman log penalty) ## ## ------------------------------------------------------------ ## EAP Reliability ## [1] 0.713 ## ------------------------------------------------------------ ## Covariances and Variances ## [,1] ## [1,] 3.937 ## ------------------------------------------------------------ ## Correlations and Standard Deviations (in the diagonal) ## [,1] ## [1,] 1.984 ## ------------------------------------------------------------ ## Regression Coefficients ## [,1] ## [1,] 0 ## ------------------------------------------------------------ ## Item Parameters -A*Xsi ## item N M xsi.item AXsi_.Cat1 B.Cat1.Dim1 ## 1 I01 1000 0.572 -0.498 -0.498 1 ## 2 I02 1000 0.442 0.370 0.370 1 ## 3 I03 1000 0.729 -1.623 -1.623 1 ## 4 I04 1000 0.262 1.685 1.685 1 ## 5 I05 1000 0.295 1.421 1.421 1 ## ## Item Parameters in IRT parameterization ## item alpha beta ## 1 I01 1 -0.498 ## 2 I02 1 0.370 ## 3 I03 1 -1.623 ## 4 I04 1 1.685 ## 5 I05 1 1.421 ``` ] --- ## 1PL - FIT ```r f.m1pl = tam.modelfit(m1pl, progress = F) f.m1pl$statlist ``` ```{.scroll-100} ## X100.MADCOV SRMR SRMSR MADaQ3 pmaxX2 ## 1 1.415162 0.06452616 0.08729947 0.06260904 3.64464e-11 ``` ```r f.m1pl$modelfit.test ``` ```{.scroll-100} ## maxX2 Npairs p.holm ## 1 48.3069 10 3.64464e-11 ``` --- ## 1PL - Item fit .scrollable[ ```r item.fit.1pl = IRT.itemfit(m1pl) item.fit.1pl$chisquare_stat ``` ```{.scroll-100} ## item Group1 ## 1 I01 11.2578889 ## 2 I02 14.6178740 ## 3 I03 6.8620373 ## 4 I04 0.5385041 ## 5 I05 10.7291513 ``` ```r item.fit.1pl$RMSD ``` ```{.scroll-100} ## item Group1 ## 1 I01 0.033633418 ## 2 I02 0.045644930 ## 3 I03 0.020356685 ## 4 I04 0.008875834 ## 5 I05 0.035963344 ``` ```r item.fit.1pl$RMSD_summary ``` ```{.scroll-100} ## Parm M SD Min Max ## 1 Group1 0.02889484 0.01437571 0.008875834 0.04564493 ``` ] --- ## 1PL - ICC .scrollable[ ```r irt.icc(m1pl)$icc.graph + theme_classic() ``` <img src="stimareImodelli_files/figure-html/unnamed-chunk-16-1.png" width="90%" style="display: block; margin: auto;" /> ] --- ## 2PL .scrollable[ ```r m2pl = tam.mml.2pl(data, irtmodel = "2PL", verbose = F) summary(m2pl) ``` ```{.scroll-100} ## ------------------------------------------------------------ ## TAM 4.0-16 (2022-05-13 13:23:23) ## R version 4.2.2 (2022-10-31 ucrt) x86_64, mingw32 | nodename=LAPTOP-OTTAVIA | login=huawei ## ## Date of Analysis: 2023-01-17 08:09:54 ## Time difference of 0.247611 secs ## Computation time: 0.247611 ## ## Multidimensional Item Response Model in TAM ## ## IRT Model: 2PL ## Call: ## tam.mml.2pl(resp = data, irtmodel = "2PL", verbose = F) ## ## ------------------------------------------------------------ ## Number of iterations = 66 ## Numeric integration with 21 integration points ## ## Deviance = 5308.52 ## Log likelihood = -2654.26 ## Number of persons = 1000 ## Number of persons used = 1000 ## Number of items = 5 ## Number of estimated parameters = 10 ## Item threshold parameters = 5 ## Item slope parameters = 5 ## Regression parameters = 0 ## Variance/covariance parameters = 0 ## ## AIC = 5329 | penalty=20 | AIC=-2*LL + 2*p ## AIC3 = 5339 | penalty=30 | AIC3=-2*LL + 3*p ## BIC = 5378 | penalty=69.08 | BIC=-2*LL + log(n)*p ## aBIC = 5346 | penalty=37.28 | aBIC=-2*LL + log((n-2)/24)*p (adjusted BIC) ## CAIC = 5388 | penalty=79.08 | CAIC=-2*LL + [log(n)+1]*p (consistent AIC) ## AICc = 5329 | penalty=20.22 | AICc=-2*LL + 2*p + 2*p*(p+1)/(n-p-1) (bias corrected AIC) ## GHP = 0.53285 | GHP=( -LL + p ) / (#Persons * #Items) (Gilula-Haberman log penalty) ## ## ------------------------------------------------------------ ## EAP Reliability ## [1] 0.729 ## ------------------------------------------------------------ ## Covariances and Variances ## [,1] ## [1,] 1 ## ------------------------------------------------------------ ## Correlations and Standard Deviations (in the diagonal) ## [,1] ## [1,] 1 ## ------------------------------------------------------------ ## Regression Coefficients ## [,1] ## [1,] 0 ## ------------------------------------------------------------ ## Item Parameters -A*Xsi ## item N M xsi.item AXsi_.Cat1 B.Cat1.Dim1 ## 1 I01 1000 0.572 -0.382 -0.382 1.299 ## 2 I02 1000 0.442 0.695 0.695 4.178 ## 3 I03 1000 0.729 -1.365 -1.365 1.460 ## 4 I04 1000 0.262 1.620 1.620 1.855 ## 5 I05 1000 0.295 2.206 2.206 3.616 ## ## Item Parameters in IRT parameterization ## item alpha beta ## 1 I01 1.299 -0.294 ## 2 I02 4.178 0.166 ## 3 I03 1.460 -0.935 ## 4 I04 1.855 0.874 ## 5 I05 3.616 0.610 ``` ] --- ## 2PL - Fit ```r f.m2pl = tam.modelfit(m2pl, progress = F) f.m2pl$statlist ``` ```{.scroll-100} ## X100.MADCOV SRMR SRMSR MADaQ3 pmaxX2 ## 1 0.2043301 0.009127058 0.01265885 0.07103058 1 ``` ```r f.m2pl$modelfit.test ``` ```{.scroll-100} ## maxX2 Npairs p.holm ## 1 0.8595675 10 1 ``` --- ## 2PL - Item fit .scrollable[ ```r item.fit.2pl = IRT.itemfit(m2pl) item.fit.2pl$chisquare_stat ``` ```{.scroll-100} ## item Group1 ## 1 I01 0.4296817 ## 2 I02 0.2003800 ## 3 I03 1.4600113 ## 4 I04 1.3387959 ## 5 I05 0.3435749 ``` ```r item.fit.1pl$RMSD ``` ```{.scroll-100} ## item Group1 ## 1 I01 0.033633418 ## 2 I02 0.045644930 ## 3 I03 0.020356685 ## 4 I04 0.008875834 ## 5 I05 0.035963344 ``` ```r item.fit.1pl$RMSD_summary ``` ```{.scroll-100} ## Parm M SD Min Max ## 1 Group1 0.02889484 0.01437571 0.008875834 0.04564493 ``` ] --- ## 2PL - ICC .scrollable[ ```r irt.icc(m2pl)$icc.graph + theme_classic() ``` <img src="stimareImodelli_files/figure-html/unnamed-chunk-20-1.png" width="90%" style="display: block; margin: auto;" /> ] --- ## 3PL .scrollable[ ```r m3pl = tam.mml.3pl(data, est.guess = colnames(data), verbose = F) summary(m3pl) ``` ```{.scroll-100} ## ------------------------------------------------------------ ## TAM 4.0-16 (2022-05-13 13:23:23) ## R version 4.2.2 (2022-10-31 ucrt) x86_64, mingw32 | nodename=LAPTOP-OTTAVIA | login=huawei ## ## Date of Analysis: 2023-01-17 08:10:05 ## Time difference of 10.2115 secs ## Computation time: 10.2115 ## ## Multidimensional Item Response Model in TAM ## ## IRT Model 2PL (Function 'tam.mml.3pl') ## Call: ## tam.mml.3pl(resp = data, est.guess = colnames(data), verbose = F) ## ## ------------------------------------------------------------ ## Number of iterations = 576 ## ## Skill space: Normal Distribution ## Numeric integration with 21 integration points ## ## Deviance = 5309.64 | Log Likelihood = -2654.82 ## Number of persons = 1000 ## Number of persons used = 1000 ## Number of items = 5 ## Number of estimated parameters = 16 ## Item threshold parameters = 5 ## Item slope parameters = 5 ## Non-active item slopes = 0 ## Item guessing parameters = 5 ## Regression parameters = 0 ## Variance/covariance parameters = 1 ## Delta parameters = 0 ## ## AIC = 5342 | penalty=32 | AIC=-2*LL + 2*p ## AIC3 = 5358 | penalty=48 | AIC3=-2*LL + 3*p ## BIC = 5420 | penalty=110.52 | BIC=-2*LL + log(n)*p ## aBIC = 5369 | penalty=59.64 | aBIC=-2*LL + log((n-2)/24)*p (adjusted BIC) ## CAIC = 5436 | penalty=126.52 | CAIC=-2*LL + [log(n)+1]*p (consistent AIC) ## AICc = 5342 | penalty=32.55 | AICc=-2*LL + 2*p + 2*p*(p+1)/(n-p-1) (bias corrected AIC) ## GHP = 0.53416 | GHP=( -LL + p ) / (#Persons * #Items) (Gilula-Haberman log penalty) ## ## ------------------------------------------------------------ ## EAP Reliability ## [1] 0.728 ## ------------------------------------------------------------ ## Covariances and Variances ## [,1] ## [1,] 1.481 ## ------------------------------------------------------------ ## Correlations and Standard Deviations (in the diagonal) ## [,1] ## [1,] 1.217 ## ------------------------------------------------------------ ## Regression Coefficients ## [,1] ## [1,] 0 ## ------------------------------------------------------------ ## Item Parameters -A*Xsi ## item N M est.guess guess AXsi_.Cat1 B.Cat1.Dim1 ## 1 I01 1000 0.572 1 0.072 -0.332 1.095 ## 2 I02 1000 0.442 2 0.030 0.802 3.544 ## 3 I03 1000 0.729 3 0.068 -1.324 1.195 ## 4 I04 1000 0.262 4 0.053 1.809 1.669 ## 5 I05 1000 0.295 5 0.062 2.278 3.016 ## ## Gammaslope Parameters ## [1] 1.095 3.544 1.195 1.669 3.016 ``` ] --- ## 3PL - Fit .scrollable[ ```r f.m3pl = tam.modelfit(m3pl) ``` ```{.scroll-100} ## **** Calculate Residuals ## **** Calculate Counts ## **** Calculate Covariances ``` ```r f.m3pl$statlist ``` ```{.scroll-100} ## X100.MADCOV SRMR SRMSR MADaQ3 pmaxX2 ## 1 3.481883 0.135382 0.137495 0.06034752 0 ``` ```r f.m3pl$modelfit.test ``` ```{.scroll-100} ## maxX2 Npairs p.holm ## 1 116.1181 10 0 ``` ] --- ## 3PL - Item fit .scrollable[ ```r item.fit.3pl = IRT.itemfit(m3pl) item.fit.3pl$chisquare_stat ``` ```{.scroll-100} ## item Group1 ## 1 I01 21.67682 ## 2 I02 Inf ## 3 I03 27.58752 ## 4 I04 86.01963 ## 5 I05 Inf ``` ```r item.fit.3pl$RMSD ``` ```{.scroll-100} ## item Group1 ## 1 I01 0.06361902 ## 2 I02 0.13848673 ## 3 I03 0.07387837 ## 4 I04 0.12824780 ## 5 I05 0.22998383 ``` ```r item.fit.3pl$RMSD_summary ``` ```{.scroll-100} ## Parm M SD Min Max ## 1 Group1 0.1268432 0.06629122 0.06361902 0.2299838 ``` ] --- ## 3PL - ICC .scrollable[ ```r irt.icc(m3pl)$icc.graph + theme_bw() ``` <img src="stimareImodelli_files/figure-html/unnamed-chunk-24-1.png" width="90%" style="display: block; margin: auto;" /> ] --- class: section, center, middle # Scelta del modello --- ## Confronto tra modelli ```r IRT.compareModels(m1pl, m2pl, m3pl) ``` ```{.scroll-100} ## $IC ## Model loglike Deviance Npars Nobs AIC BIC AIC3 AICc ## 1 m1pl -2706.625 5413.250 6 1000 5425.250 5454.697 5431.250 5425.335 ## 2 m2pl -2654.262 5308.525 10 1000 5328.525 5377.602 5338.525 5328.747 ## 3 m3pl -2654.822 5309.644 16 1000 5341.644 5420.168 5357.644 5342.197 ## CAIC GHP ## 1 5460.697 0.5425250 ## 2 5387.602 0.5328525 ## 3 5436.168 0.5341644 ## ## $LRtest ## Model1 Model2 Chi2 df p ## 1 m1pl m2pl 104.725382 4 0 ## 2 m1pl m3pl 103.606273 10 0 ## 3 m2pl m3pl -1.119109 6 1 ## ## attr(,"class") ## [1] "IRT.compareModels" ``` --- ## Scelta del modello Il 2PL è il modello migliore --- class: section, center, middle # Verifica delle assunzioni --- ## Unidimensionalità .scrollable[ ```r item_lab = paste(colnames(data), collapse = " + ") form = paste("latent =~", item_lab) form ``` ```{.scroll-100} ## [1] "latent =~ I01 + I02 + I03 + I04 + I05" ``` ```r model = cfa(form, data = data, ordered = colnames(data)) summary(model, fit.measures = T) ``` ```{.scroll-100} ## lavaan 0.6-12 ended normally after 15 iterations ## ## Estimator DWLS ## Optimization method NLMINB ## Number of model parameters 10 ## ## Number of observations 1000 ## ## Model Test User Model: ## Standard Robust ## Test Statistic 1.643 3.095 ## Degrees of freedom 5 5 ## P-value (Chi-square) 0.896 0.685 ## Scaling correction factor 0.551 ## Shift parameter 0.115 ## simple second-order correction ## ## Model Test Baseline Model: ## ## Test statistic 2945.814 2439.475 ## Degrees of freedom 10 10 ## P-value 0.000 0.000 ## Scaling correction factor 1.208 ## ## User Model versus Baseline Model: ## ## Comparative Fit Index (CFI) 1.000 1.000 ## Tucker-Lewis Index (TLI) 1.002 1.002 ## ## Robust Comparative Fit Index (CFI) NA ## Robust Tucker-Lewis Index (TLI) NA ## ## Root Mean Square Error of Approximation: ## ## RMSEA 0.000 0.000 ## 90 Percent confidence interval - lower 0.000 0.000 ## 90 Percent confidence interval - upper 0.019 0.034 ## P-value RMSEA <= 0.05 0.999 0.995 ## ## Robust RMSEA NA ## 90 Percent confidence interval - lower 0.000 ## 90 Percent confidence interval - upper NA ## ## Standardized Root Mean Square Residual: ## ## SRMR 0.014 0.014 ## ## Parameter Estimates: ## ## Standard errors Robust.sem ## Information Expected ## Information saturated (h1) model Unstructured ## ## Latent Variables: ## Estimate Std.Err z-value P(>|z|) ## latent =~ ## I01 1.000 ## I02 1.516 0.096 15.845 0.000 ## I03 1.035 0.088 11.716 0.000 ## I04 1.180 0.083 14.202 0.000 ## I05 1.436 0.088 16.291 0.000 ## ## Intercepts: ## Estimate Std.Err z-value P(>|z|) ## .I01 0.000 ## .I02 0.000 ## .I03 0.000 ## .I04 0.000 ## .I05 0.000 ## latent 0.000 ## ## Thresholds: ## Estimate Std.Err z-value P(>|z|) ## I01|t1 -0.181 0.040 -4.549 0.000 ## I02|t1 0.146 0.040 3.665 0.000 ## I03|t1 -0.610 0.042 -14.364 0.000 ## I04|t1 0.637 0.043 14.915 0.000 ## I05|t1 0.539 0.042 12.885 0.000 ## ## Variances: ## Estimate Std.Err z-value P(>|z|) ## .I01 0.618 ## .I02 0.123 ## .I03 0.591 ## .I04 0.468 ## .I05 0.212 ## latent 0.382 0.044 8.740 0.000 ## ## Scales y*: ## Estimate Std.Err z-value P(>|z|) ## I01 1.000 ## I02 1.000 ## I03 1.000 ## I04 1.000 ## I05 1.000 ``` ] --- ## Monotonicità ```r mono_check = check.monotonicity(data) summary(mono_check) ``` ```{.scroll-100} ## ItemH #ac #vi #vi/#ac maxvi sum sum/#ac zmax #zsig crit ## I01 0.47 10 0 0.0 0.00 0.00 0.0000 0.00 0 0 ## I02 0.65 10 0 0.0 0.00 0.00 0.0000 0.00 0 0 ## I03 0.55 10 1 0.1 0.05 0.05 0.0049 1.56 0 18 ## I04 0.55 10 0 0.0 0.00 0.00 0.0000 0.00 0 0 ## I05 0.63 6 0 0.0 0.00 0.00 0.0000 0.00 0 0 ``` --- ## Indipendenza Locale ```r f.m2pl$Q3_summary ``` ```{.scroll-100} ## type M SD min max SGDDM wSGDDM ## 1 Q3 -1.686040e-01 0.09870174 -0.4230942 -0.06357212 0.16860403 0.16860403 ## 2 aQ3 -3.552714e-18 0.09870174 -0.2544902 0.10503191 0.07103058 0.07103058 ``` --- class: section, center, middle # Item Information Function --- ## IIF per il 2PL .scrollable[ ```r info2pl = irt.iif(m2pl) ggplot(info2pl$item_info, aes(x = theta, y = ii_item, group = item, color = item)) + geom_line(lwd = 1) + theme_bw() ``` <img src="stimareImodelli_files/figure-html/unnamed-chunk-30-1.png" width="90%" style="display: block; margin: auto;" /> ] --- ## TIF per il 2PL .scrollable[ ```r ggplot(info2pl$test_info, aes(x = theta, y = info)) + geom_line(lwd = 2) + theme_bw() ``` <img src="stimareImodelli_files/figure-html/unnamed-chunk-31-1.png" width="60%" style="display: block; margin: auto;" /> ] --- ## SE per il 2PL .scrollable[ ```r ggplot(info2pl$test_info, aes(x = theta, y = se, col = "red")) + geom_line(lwd = 2) + theme_bw() + theme(legend.position = "none") ``` <img src="stimareImodelli_files/figure-html/unnamed-chunk-32-1.png" width="60%" style="display: block; margin: auto;" /> ] --- --- class: section, center, middle # Esercitazione --- ## Esercitazione stima Scaricare il dataset `dataES_stima.csv` dalla cartella [Dati](https://drive.google.com/drive/folders/1PXDG7HhjRDMdFEQjk5WQQWdiorDpSgtw?usp=sharing) Look at the data! Fittare i modelli IRT Scegliere il modello più appropriato Valutarne la fit (sia del modello sia degli item) Valutare le assunzioni IIC, IIF, TIF ---