Description Usage Arguments Details Value Author(s) References See Also Examples
This command generates item responses patterns for a given matrix of item parameters of any specified dichotomous or polytomous IRT model and a given ability value.
1 2 | genPattern(th, it, model = NULL, D = 1, seed = NULL)
|
th |
numeric: the ability value. |
it |
numeric: a suitable matrix of item parameters. See Details. |
model |
either |
D |
numeric: the metric constant. Default is |
seed |
either the random seed value or |
This function permits to randomly generate item responses for a given ability level, specified by the argument thr
, and for a given matrix of item parameters, specified by the argument it
. Both dichotomous and polytomous IRT models can be considered and item responses are generated accordingly.
For dichotomous models, item responses are generated from Bernoulli draws, , using the rbinom
function. For polytomous models they are generated from darws from a multinomial distribution, using the rmultinom
function. In both cases, success probabilities are obtained from the Pi
function.
Note that for polytomous models, item responses are coded as 0 (for the first response category), 1 (for the second category), ..., until g_j (for the last category), in agreement with the notations used in the help files of, e.g., the genPolyMatrix
function.
Dichotomous IRT models are considered whenever model
is set to NULL
(default value). In this case, it
must be a matrix with one row per item and four columns, with the values of the discrimination, the difficulty, the pseudo-guessing and the inattention parameters (in this order). These are the parameters of the four-parameter logistic (4PL) model
(Barton and Lord, 1981).
Polytomous IRT models are specified by their respective acronym: "GRM"
for Graded Response Model, "MGRM"
for Modified Graded Response Model, "PCM"
for Partical Credit Model, "GPCM"
for Generalized Partial Credit Model, "RSM"
for Rating Scale Model and "NRM"
for Nominal Response Model. The it
still holds one row per item, end the number of columns and their content depends on the model. See genPolyMatrix
for further information and illustrative examples of suitable polytomous item banks.
The random pattern generation can be fixed by setting seed
to some numeric value. By default, seed
is NULL
and the random seed is not fixed.
A vector with the item responses in the order of appearance of the items in the it
matrix.
David Magis
Department of Psychology, University of Liege, Belgium
david.magis@uliege.be
Barton, M.A., and Lord, F.M. (1981). An upper asymptote for the three-parameter logistic item-response model. Research Bulletin 81-20. Princeton, NJ: Educational Testing Service.
Haley, D.C. (1952). Estimation of the dosage mortality relationship when the dose is subject to error. Technical report no 15. Palo Alto, CA: Applied Mathematics and Statistics Laboratory, Stanford University.
Magis, D., and Raiche, G. (2012). Random Generation of Response Patterns under Computerized Adaptive Testing with the R Package catR. Journal of Statistical Software, 48 (8), 1-31. URL http://www.jstatsoft.org/v48/i08/
rbinom
and rmultinom
for random draws; genPolyMatrix
, Pi
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | ## Dichotomous models ##
# Generation of an item bank under 3PL with 100 items
m.3PL <- genDichoMatrix(100, model = "3PL")
m.3PL <- as.matrix(m.3PL)
# Generation of a response pattern for ability level 0
genPattern(th = 0, m.3PL)
# Generation of a single response for the first item only
genPattern(th = 0, m.3PL[1,])
## Polytomous models ##
# Generation of an item bank under GRM with 100 items and at most 4 categories
m.GRM <- genPolyMatrix(100, 4, "GRM")
m.GRM <- as.matrix(m.GRM)
# Generation of a response pattern for ability level 0
genPattern(0, m.GRM, model = "GRM")
# Generation of a single response for the first item only
genPattern(0, m.GRM[1,], model = "GRM")
# Generation of a item bank under PCM with 20 items and at most 3 categories
m.PCM <- genPolyMatrix(20, 3, "PCM")
m.PCM <- as.matrix(m.PCM)
# Generation of a response pattern for ability level 0
genPattern(0, m.PCM, model = "PCM")
# Generation of a single response for the first item only
genPattern(0, m.PCM[1,], model = "PCM")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.