View source: R/sim.data.MGPCM.R
| sim.data.MGPCM | R Documentation |
Generates polytomous (multi-category) response data from the MGPCM.
Category probabilities use the same softmax formulation as
model.MGPCM: \log P(Y=k) is proportional to
k\,\mathbf{a}_i'\boldsymbol{\theta}_j + d_{ik}.
The requested category counts are retained even when a finite sample does
not contain every possible category.
sim.data.MGPCM(
N = 500,
I = 20,
D = 2,
length.poly = 5,
Q.matrix = NULL,
Corr = NULL,
rotate = NULL,
promax_m = 4
)
N |
Integer; number of examinees (default: 500). |
I |
Integer; number of items (default: 20). |
D |
Integer; number of latent dimensions (default: 2). |
length.poly |
Integer vector or scalar; number of categories per
item. Recycled to length |
Q.matrix |
Optional |
Corr |
Optional |
rotate |
Optional rotation method (GPArotation or
|
promax_m |
Power parameter for Promax (default: 4). |
An object of class "data.MGPCM", a list containing:
data, responseN \times I integer response
matrices with categories coded from 0 to K_i - 1.
thetaN \times D matrix of true latent traits.
parI \times (D + \max_i K_i) matrix of item
parameters; discrimination columns are followed by category
intercept columns.
probabilityN \times \sum_i K_i matrix of stacked
category probabilities.
Q.matrix, length.poly, CorrDesign matrix, category counts, and latent correlation matrix used to generate the data.
model, N, I, D, callData-generating metadata.
Latent traits:
\boldsymbol{\theta}_j \sim N_D(\mathbf{0}, \boldsymbol{\Sigma}).
Item parameters:
a_{id} \sim \text{Lognormal}(0.25, 0.25) (active dimensions),
d_{i0}=0, and
d_{i1},\dots,d_{i,K_i-1} are sorted draws from
N(0,1) used as category intercepts.
Responses:
Y_{ij} \sim \text{Categorical}(P(Y_{ij} = k \mid \boldsymbol{\theta}_j))
for k = 0, \dots, K_i - 1.
fit.MGPCM, model.MGPCM
set.seed(123)
sim <- sim.data.MGPCM(N = 20, I = 5, D = 2, length.poly = 4)
str(sim$response)
dim(sim$probability)
sim$length.poly
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.