pool <- gen.irt(1, 100)$items
pool$content <- sample(1:3, nrow(pool), replace=TRUE)
pool$time <- round(exp(rnorm(nrow(pool), log(20), .1)))
# assemble two 10-item forms to maximize information at theta=(-.5, .5)
x <- ata(pool, 2)
x <- ata.maxselect(x, 1)
x <- ata.constraint(x, "len", NA, 10, 10)
x <- ata.obj.rel(x, -0.5, "max")
x <- ata.obj.rel(x, 0.5, "max")
x <- ata.solve(x)
y1 <- x$rs.items[[1]]
y2 <- x$rs.items[[2]]
y1
y2
with(y1, plot(irt(c(-.5, .5), a, b, c), type="information"))
with(y2, plot(irt(c(-.5, .5), a, b, c), type="information"))
# assemble two 10-item forms to maximize difficulty without any items from content 1
x <- ata(pool, 2)
x <- ata.maxselect(x, 1)
x <- ata.constraint(x, "len", NA, 10, 10)
x <- ata.constraint(x, "content", 1, 0, 0)
x <- ata.obj.rel(x, "b", "max")
x <- ata.solve(x)
y1 <- x$rs.items[[1]]
y2 <- x$rs.items[[2]]
with(y1, plot(irt(0, a, b, c), type="information"))
with(y2, plot(irt(0, a, b, c), type="information"))
# assemble two 10-item forms to have have information (3.5, 3.5, 3.5) at (-.5, 0, .5)
x <- ata(pool, 2)
x <- ata.maxselect(x, 1)
x <- ata.constraint(x, "len", NA, 10, 10)
x <- ata.obj.abs(x, -0.5, 3.5)
x <- ata.obj.abs(x, 0.0, 3.5)
x <- ata.obj.abs(x, 0.5, 3.5)
x <- ata.solve(x)
y1 <- x$rs.items[[1]]
y2 <- x$rs.items[[2]]
with(y1, plot(irt(c(-.5,0,.5),a,b,c), type="information"))
with(y2, plot(irt(c(-.5,0,.5),a,b,c), type="information"))
# assemble two 10-item forms in which mean(b)=1, sd(b)=1
x <- ata(pool, 2)
x <- ata.maxselect(x, 1)
x <- ata.constraint(x, "len", NA, 10, 10)
x <- ata.obj.abs(x, "b", 1.0 * 10)
x <- ata.obj.abs(x, (pool$b-1.0)^2, 1.0 * 10)
x <- ata.solve(x)
y1 <- x$rs.items[[1]]
mean(y1$b)
sd(y1$b)
y2 <- x$rs.items[[2]]
mean(y2$b)
sd(y2$b)
x$rs.items
with(y1, plot(irt(0, a, b, c), type="information"))
with(y2, plot(irt(0, a, b, c), type="information"))
Run the code above in your browser using DataLab