############################################ ## Section 4.2 Psych 101 ############################################ library("KernSmoothIRT") data("Psych101", package = "KernSmoothIRT") Psych1 <- ksIRT(responses = Psychresponses, key = Psychkey, format = 1) Psych1 plot(Psych1, plottype = "OCC", item = c(24, 25, 92, 96)) plot(Psych1, plottype = "EIS", item = c(24, 25, 92, 96)) plot(Psych1, plottype = "tetrahedron", items = c(24, 92)) plot(Psych1, plottype = "triangle", items = c(24, 92)) plot(Psych1, plottype = "PCA") plot(Psych1, plottype = "RCC", subjects = c(13, 92, 111, 33)) subjscore(Psych1) subjscoreML(Psych1) plot(Psych1, plottype = "expected") plot(Psych1, plottype = "sd") plot(Psych1, plottype = "density") ############################################ ## Section 4.3 Voluntary HIV-1 counseling ... ############################################ data("HIV", package = "KernSmoothIRT") head(HIV) attach(HIV) HIVres <- ksIRT(HIV[, -(1:3)], key = HIVkey, format = 2, miss = "omit") plot(HIVres, plottype = "OCC", item = 9) plot(HIVres, plottype = "EIS", item = 9) plot(HIVres, plottype = "tetrahedron", item = 9) DIF1 <- ksIRT(res = HIV[, -(1:3)], key = HIVkey, format = 2, groups = GENDER, miss = "omit") plot(DIF1, plottype = "expectedDIF", lwd = 2) plot(DIF1, plottype = "densityDIF", lwd = 2) plot(DIF1, plottype = "OCCDIF", cex = 0.5, item = 3) plot(DIF1, plottype = "EISDIF", cex = 0.5, item = 3) DIF2 <- ksIRT(res = HIV[, -(1:3)], key = HIVkey, format = 2, groups = SITE, miss = "omit") plot(DIF2, plottype = "expectedDIF", lwd = 2) plot(DIF2, plottype = "densityDIF", lwd = 2) plot(DIF2, plottype = "EISDIF", item = c(6 ,11))