## Section 3.1 library("mokken") data("acl") X <- acl[,1:10] summary(check.iio(X)) ## Section 3.2 scale.normal <- aisp(X) scale.ga <- aisp(X, search = "ga") cbind(scale.normal, scale.ga) ## Section 3.3 set.seed(1) library("MASS") X <- sign(mvrnorm(10000, c(0, -3), matrix(c(1, .1, .1, 1), 2, 2))) / 2 + .5 coefH(X)$H table(X[, 1], X[, 2]) ## Section 4 data("transreas") X <- transreas[, -1] coefH(X) scale.normal <- aisp(X) scale.ga <- aisp(X, search = "ga") cbind(scale.normal, scale.ga) Y <- X[, scale.normal == 1] coefH(Y) check.reliability(Y, LCRC = TRUE) set.seed(1) rXX <- check.reliability(Y, LCRC = TRUE)$LCRC sigmaX <- sd(apply(Y, 1, sum)) cat(" Lower bound:", round(4 - 1.96 * sigmaX * sqrt(1 - rXX), 4), "\n", "Upper bound:", round(4 + 1.96 * sigmaX * sqrt(1 - rXX), 4), fill = TRUE) summary(check.iio(Y)) X <- acl[, 101:110] data.frame(Item = 101:110, Mean = round(apply(X, 2, mean), 2)) X <- X[, -c(2, 7)] summary(check.iio(X, method = "MIIO")) plot(check.iio(X), item.pairs = 28) summary(check.iio(X, method = "MSCPM")) summary(check.iio(X, method = "IT")) ## Section 5 test.scores <- apply(Y, 1, sum) hist(test.scores) Hij <- coefH(Y, se = FALSE)$Hij apply(Hij, 1, function(x) sum(x < 0))