philchalmers / mirtCAT

Computerized Adaptive Testing with Multidimensional Item Response Theory
http://philchalmers.github.io/mirtCAT/
89 stars 28 forks source link

Item selection for polytomous Items #2

Closed thersites9 closed 9 years ago

thersites9 commented 9 years ago

Hi,

I think there is a bug in the item selection mechanism für polytomous items:

# simulate data for a GRM
a <- matrix(rlnorm(20,.2,.3))
diffs <- t(apply(matrix(runif(20*4, .3, 1), 20), 1, cumsum))
diffs <- -(diffs - rowMeans(diffs))
d <- diffs + rnorm(20)
dat <- simdata(a, d, 500, itemtype = 'graded')

# estimate parameters
fit <- mirt(dat, model=mirt.model('F1=1-20'),
            itemtype="graded")

Item selection using maximum Fisher Information works fine:

design <- list(min_SEM = .02, min_items = 10, max_items = 10)
cat1a  <- mirtCAT(mo=fit, local_pattern = dat[1:10,],
                  start_item = 'MI', method="EAP",
                  criteria   = 'MI', design = design)

However, any other criterion (e.g. MPWI, MEI), fails:

cat1b  <- mirtCAT(mo=fit, local_pattern = dat[1:10,],
                  start_item = 'MI', method="EAP",
                  criteria   = 'MPWI', design = design)
Error in .Primitive("+")(0.00447009764530175, 0.00305388243702458, 0.00115289027322516,  : 
  operator needs one or two arguments

Best, Timo

philchalmers commented 9 years ago

Thanks for the report! I've made a patch for this. It was related to how the do.call() function worked (I wasn't aware that the '+' operator with it only worked on two elements at a time). Cheers.

thersites9 commented 9 years ago

That was quick. :)

Thanks for the great packages!

Best, Timo