View source: R/sim.data.MGGUM.R
| sim.data.MGGUM | R Documentation |
Generates polytomous responses from the same distance-based MGGUM
probability function used by model.MGGUM and
fit.MGGUM. For each item, active discriminations are drawn
from U(0.5, 2), active locations follow the sign of the Q-matrix,
\tau_{i0}=0, and the remaining \tau values are ordered
negative thresholds.
sim.data.MGGUM(
N = 500,
I = 20,
D = 2,
length.poly = 5,
Q.matrix = NULL,
Corr = NULL
)
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 indicating the number of
categories for each item. A scalar is recycled to length |
Q.matrix |
Optional
The sign controls the item-location side, not the sign of discrimination.
If |
Corr |
Optional |
An object of class "data.MGGUM", 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 (2D + \max_i K_i) matrix of GGUM item
parameters: discrimination columns, location columns, and stacked
threshold 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.
N, I, D, callData-generating metadata.
Draw latent traits from
N_D(\mathbf{0}, \boldsymbol{\Sigma}).
Generate discrimination, location, and threshold parameters under
the sign constraints encoded by Q.matrix.
Compute stacked category probabilities with
model.MGGUM.
Sample one ordinal response per person and item. A category can be
absent in a finite sample; length.poly retains the intended
support.
fit.MGGUM, model.MGGUM
set.seed(123)
sim <- sim.data.MGGUM(N = 20, I = 5, D = 2, length.poly = 4)
str(sim$response)
dim(sim$par)
table(sim$response[, 1])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.