generated data for 5 items (with 3 categories) that have fixed slope/int parameters and applying GRM

43 views
Skip to first unread message

Todd McKay

unread,
Feb 21, 2017, 5:46:14 PM2/21/17
to mirt-package
Hi everyone,

I'm running into a wall on a task. I want to generate data for five items (each of which has 3 categories [0, 1, 2]), using fixed slope and parameter estimates, and then analyze the data with the graded-response model. I can't figure out what I'm doing wrong and what to do next. Here is some of the information I am working with. Any help with this?

# Items = 5
Categs  = 3
Model   = graded
Slope   = (0.5, 1.0, 1.5, 2.0, 2.5)
Int#1   = (0.5, 0.8, 0.9, 0.8, 0.5)
Int#2   = (-0.1, -0.4, -0.9, -1.6, -2.5)
# Obs   = 1000
Theta   = -6 to 6

My code so far looks like this (admittedly, a bit of a mess). I'm very new to irt with R (mirt), so patience much appreciated! 

set.seed(1234)

nitem <- 5
a     <- matrix(c(0.5, 1, 1.5, 2, 2.5))
d     <- matrix(c(0.5, 0.8, 0.9, 0.8, 0.5), 32, 5)
c     <- seq(-6, 6, length.out = 32)

Group <- expand.grid( rep( list(0:2), nitem)) [, nitem:1]

N <- c(41, 11, 11, 11, 29, 5, 8, 22, 31, 10, 13, 21, 34, 15, 26, 84, 47, 7, 15, 12, 29, 14, 17, 53, 41, 11, 17, 38, 26, 36,                42, 223)
CData4 <- Group[rep(1:2^nitem, N), ]

mod1 <- mirt(CData4, 1, itemtype = "graded", SE = T)

data <- simdata(a, d + c, 1000, itemtype = rep("graded", 32))


Phil Chalmers

unread,
Feb 23, 2017, 9:56:49 AM2/23/17
to Todd McKay, mirt-package
On Tue, Feb 21, 2017 at 5:46 PM, Todd McKay <mckay...@gmail.com> wrote:
Hi everyone,

I'm running into a wall on a task. I want to generate data for five items (each of which has 3 categories [0, 1, 2]), using fixed slope and parameter estimates, and then analyze the data with the graded-response model. I can't figure out what I'm doing wrong and what to do next. Here is some of the information I am working with. Any help with this?

# Items = 5
Categs  = 3
Model   = graded
Slope   = (0.5, 1.0, 1.5, 2.0, 2.5)
Int#1   = (0.5, 0.8, 0.9, 0.8, 0.5)
Int#2   = (-0.1, -0.4, -0.9, -1.6, -2.5)
# Obs   = 1000
Theta   = -6 to 6

My code so far looks like this (admittedly, a bit of a mess). I'm very new to irt with R (mirt), so patience much appreciated! 

set.seed(1234)

nitem <- 5
a     <- matrix(c(0.5, 1, 1.5, 2, 2.5))
d     <- matrix(c(0.5, 0.8, 0.9, 0.8, 0.5), 32, 5)

The lengths of these objects don't match. If you want 5 items, then a and d should both have only 5 rows. Also, the intercepts are not ordered in this graded response model. They need to be ordered from highest to lowest in order for the model to make any sense. Perhaps try playing around with the itemplot(shiny=TRUE) interface to get a feel for the parameterisation. 
 
c     <- seq(-6, 6, length.out = 32)

Group <- expand.grid( rep( list(0:2), nitem)) [, nitem:1]

N <- c(41, 11, 11, 11, 29, 5, 8, 22, 31, 10, 13, 21, 34, 15, 26, 84, 47, 7, 15, 12, 29, 14, 17, 53, 41, 11, 17, 38, 26, 36,                42, 223)
CData4 <- Group[rep(1:2^nitem, N), ]

mod1 <- mirt(CData4, 1, itemtype = "graded", SE = T)

data <- simdata(a, d + c, 1000, itemtype = rep("graded", 32))


--
You received this message because you are subscribed to the Google Groups "mirt-package" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mirt-package+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages