Hi Phil, I'm toying with one way to simulate NRM items without having to specify the response intercepts, and am getting some counter-intuitive results. I was wondering if you might know why. Here's the simulation script:
library(psych)
library(mirt)
# Simulate a 20-item test with 10000 examinees using the basic 2PL.
# All 20 items load 0.95 on a single factor, and difficulties range
# from -1.5 to 1.5. This results in a matrix of binary responses
# (0 = incorrect; 1 = correct).
x <- sim.structure(fx=matrix(0.95,20,1),items=TRUE,cat=1,d=round(runif(20,-1.5,1.5),0),n=10000)$observed
# Now replace the incorrect responses (zeros) with random integers
# between 2 and 5. So when examinees get an item incorrect, they
# do so by choosing some option other than 1. Thus, the correct
# answer to every item is 1, possible response options include
# 1/2/3/4/5, and there are no distractor response options.
for (i in 1:10000) {
for (j in 1:20) {
if (x[i,j] == 0) {x[i,j] <- round(runif(1,1.50001,5.49999),0)}
}}
# Estimate the NRM using 'mirt'
mod <- mirt(x,1,itemtype="nominal")
itemplot(mod,1)
You'll notice that response option 1 (the correct response) has the opposite slope to what I was hoping - i.e. it looks like a person has to be low-ability before selecting 1.
Now if I change the script to this (where 5 is the correct response and incorrect responses are random integers between 1 and 4), it seems to work fine:
x <- sim.structure(fx=matrix(0.95,20,1),items=TRUE,cat=1,d=round(runif(20,-1.5,1.5),0),n=10000)$observed
for (i in 1:10000) {
for (j in 1:20) {
if (x[i,j] == 1) {x[i,j] <- 5}
if (x[i,j] == 0) {x[i,j] <- round(runif(1,0.5,4.49999),0)}
}}
mod <- mirt(x,1,itemtype="nominal")
itemplot(mod,1)
Any idea why results are different when all correct responses are 1?
Thanks!
Tyler