Hi Phil,
I ama new R user and of course, new on dirt package, so maybe the question is an easy one because of my inexperience.
I am trying to simulate a multidimensional IRT model with two factors (a correlation of .35 between them). The answers have to be in a Likert scale of 5 points. The code I use is:
library(mvtnorm)
library(mirt)
Theta <- rmvnorm(1000, sigma = matrix(c(1, .35, .35, 1), 2))
a <- matrix(c(rlnorm(40, .2, .3),rlnorm(40,.7,.4)),2)
diffs <- t(apply(matrix(runif(40*4, .3, 1), 40), 1, cumsum));
diffs <- -(diffs - rowMeans(diffs));
d <- diffs + rnorm(40)
datos <- simdata(a, d, 1000, Theta=Theta, itemtype = 'graded')
datos
modelo<-mirt(datos,2)
When I run the program I obtain negative coefficients in the a parameters and I do not know what is wrong?
Do you think that the program is correct? If not where can I read something to make it properly?
Thanks in advance and congratulations for the packages
Luis M. Lozano