# Simulate 1000 persons and 5 items with 2 levels (Rasch model)
set.seed(123)
simulated_data <- sim.PCM(pN = 1000, iN = 5, lN = 2)
# Extract simulated item responses and abilities
observed_responses <- simulated_data$resp - 1
person_abilities <- simulated_data$theta
item_params <- cbind(simulated_data$delta[,2],rep(0.08),5)
# Defining a 0.08 of error for the item parameters,
# this usually would be estimated.
# Plot the ICC for the first item using the Quantile method
ICCfit(itemNumber = 1,
observedResponses = observed_responses,
personEstimates = person_abilities,
itemParameters = item_params,
method = "Quantile",
NQtiles = 10)
Run the code above in your browser using DataLab