## Not run:
# # ex. 1: 2 forms, 10 items, maximize b parmaters
# items <- irt.model(model="3pl")$gen.data(1, 100)$items
# items$content <- sample(1:3, nrow(items), replace=TRUE)
# items$time <- round(rlnorm(nrow(items), log(60), .2), 0)
# x <- ata(items, 2, debug=TRUE)
# x <- ata.obj.relative(x, "b", "max")
# x <- ata.constraint(x, 1, 10, 10)
# x <- ata.item.maxselect(x, 1)
# x <- ata.solve(x)
# plot(x)
# y <- ata.get.items(x, as.list=TRUE)
# mean(y[[1]]$b)
# mean(y[[2]]$b)
# # ex. 2: 2 forms, 10 items, minimize b parmaeters
# x <- ata(items, 2, len=10, maxselect=1, debug=TRUE)
# x <- ata.obj.relative(x, "b", "min", negative=TRUE)
# x <- ata.solve(x)
# plot(x)
# y <- ata.get.items(x, as.list=TRUE)
# mean(y[[1]]$b)
# mean(y[[2]]$b)
# # ex. 3: 2 forms, 10 items, maximize information at -0.5 and 0.5
# # content distribution: 3, 3, 4; response time: avg. 55--65s
# x <- ata(items, 2, len=10, maxselect=1, debug=TRUE)
# x <- ata.obj.relative(x, c(-0.5, 0.5), "max")
# x <- ata.constraint(x, "content", 3, 3, 1)
# x <- ata.constraint(x, "content", 3, 3, 2)
# x <- ata.constraint(x, "content", 4, 4, 3)
# x <- ata.constraint(x, "time", 55*10, 65*10)
# x <- ata.solve(x)
# plot(x)
# y <- ata.get.items(x, TRUE)
# freq(y[[1]]$content, 1:3)$n
# mean(y[[1]]$time)
# freq(y[[2]]$content, 1:3)$n
# mean(y[[2]]$time)
# # ex. 4: 2 forms, 10 items, mean(b) = 0.5, sd(b) = 1.0, content = (3, 3, 4)
# x <- ata(items, 2, len=10, maxselect=1, debug=TRUE)
# x <- ata.obj.absolute(x, "b", 0.5 * 10)
# x <- ata.obj.absolute(x, (x$pool$b - 0.5)^2, 1.0 * 10)
# x <- ata.constraint(x, "content", 3, 3, 1)
# x <- ata.constraint(x, "content", 3, 3, 2)
# x <- ata.constraint(x, "content", 4, 4, 3)
# x <- ata.solve(x)
# plot(x)
# y <- ata.get.items(x, TRUE)
# c(mean(y[[1]]$b), sd(y[[1]]$b))
# freq(y[[1]]$content, 1:3)$n
# c(mean(y[[2]]$b), sd(y[[2]]$b))
# freq(y[[2]]$content, 1:3)$n
# # ex. 5: 2 forms, 10 items, flat TIF over [-1, 1]
# x <- ata(items, 2, len=10, maxselect=1, debug=TRUE)
# x <- ata.obj.relative(x, seq(-1, 1, .5), "max", negative=FALSE, flatten=.1)
# x <- ata.solve(x)
# y <- ata.get.items(x, TRUE)
# plot(irt.model.3pl(items=y[[1]]), stats="information", total=TRUE)
# plot(irt.model.3pl(items=y[[2]]), stats="information", total=TRUE)
# ## End(Not run)
Run the code above in your browser using DataLab