# set a seed to replicate the results
set.seed(999)
# Simulate person and item parameters
true_theta <- rnorm(1000)
b <- runif(30, -3, 3)
a <- runif(30, 0.6, 2)
parameters <- data.frame(b, a)
# simulate data
data <- sirt::sim.raschtype(true_theta, b = b, fixed.a = a)
stf <- uip(data, starting_theta = true_theta, item_par = parameters, num_item = 5)
# plot the test information function of the full-length test
plot_tif(stf, tif = "full")
# plot the test information of the full-length test and of the short test form
plot_tif(stf, tif = "both")
Run the code above in your browser using DataLab