simdata-Nominal response model

16 views
Skip to first unread message

Serpil çelikten

unread,
Feb 12, 2025, 4:43:33 AMFeb 12
to mirt-package
Dear Phil,
I run the codes below to simulate data under the nominal response model:
n_persons <- 3000
n_items <- 10
n_categories <- 4
a <- matrix(runif(n_items * (n_categories - 1), 0.5, 2), nrow = n_items)
b <- matrix(rnorm(n_items * (n_categories - 1), mean = 0, sd = 3), nrow = n_items)
ak <- matrix(seq(-1, 1, length.out = n_categories-1), nrow = n_items, ncol = n_categories-1, byrow = TRUE)
ThetaNormal <- matrix(rnorm(3000))
sim_data <- simdata(a, b, N = n_persons, itemtype = "nominal", nominal=ak, Theta = ThetaNormal)

But the code resulted in the errır below:

The input Theta matrix does not have the correct dimensions
then, I arrange the a - parameter code as below by specifying the number of coulmns as one:

a <- matrix(runif(n_items * (n_categories - 1), 0.5, 2), nrow = n_items, ncol = 1)

then a-parameters were generated as only one column although the nominal model requires parameters for each category. I am not sure whether it is correct or not.

How can I deal with this problem?
--
Dr. Serpil ÇELİKTEN DEMİREL
Dicle Üniversitesi
Eğitimde Ölçme ve Değerlendirme Anabilim Dalı

Phil Chalmers

unread,
Feb 23, 2025, 11:12:19 AMFeb 23
to Serpil çelikten, mirt-package
You've generated a set of slopes (a) that should be paired with each column in Theta, however your Theta structure is only unidimensional while the a's imply the model is three dimensional. I'm not sure which should be fixed as it depends on whether you're generating a unidimensional or three-dimensional model, but that's the culprit. 

Phil


--
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...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/mirt-package/CAP%2BEo2Yf9xvpTqrD8mhHEuGHg1DMPKoT7Z6mR3%2Bh_2KQfjbxoQ%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages