# NOT RUN {
# Compute probability, information, likelihood and log-likelihood
x <- model_3pl()$gendata(20, 5)
irt_stats(x, "prob")
irt_stats(x, "prob", "people", sum)
irt_stats(x, "info")
irt_stats(x, "info", "items", sum)
irt_stats(x, "lik")
irt_stats(x, "loglik")
# subset
x <- model_3pl()$gendata(10, 5)
irt_select(x, people_index=c(1, 3, 5))
irt_select(x, item_index=c(1, 3, 5))
# sample wihtout replacement
irt_sample(x, n.people=3)
irt_sample(x, n.items=3)
# sample with replacement
irt_sample(x, n.people=30)
irt_sample(x, n.items=30)
# rescale theta
x <- model_3pl()$gendata(20, 5)
c(mean(x$people$theta), sd(x$people$theta))
y <- irt_rescale(x, "theta", 0, 1)
c(mean(y$people$theta), sd(y$people$theta))
round(abs(irt_stats(x, "prob") - irt_stats(y, "prob")), 2)
# rescale b
c(mean(x$items$b), sd(x$items$b))
y <- irt_rescale(x, "b", 0, 1)
c(mean(y$items$b), sd(y$items$b))
round(abs(irt_stats(x, "prob") - irt_stats(y, "prob")), 2)
# }
Run the code above in your browser using DataLab