sim.2pl {eRm} | R Documentation |
Simulation of 2-PL Data
Description
This utility function returns a 0-1 matrix violating the parallel ICC assumption in the Rasch model.
Usage
sim.2pl(persons, items, discrim = 0.25, seed = NULL, cutpoint = "randomized")
Arguments
persons |
Either a vector of person parameters or an integer indicating the number of persons (see details). |
items |
Either a vector of item parameters or an integer indicating the number of items (see details). |
discrim |
Standard deviation on the log scale. |
seed |
A seed for the random number generated can be set. |
cutpoint |
Either |
Details
If persons
and/or items
(using single integers) are specified to determine the number of subjects or items, the corresponding parameter vector is drawn from N(0,1).
The cutpoint
argument refers to the transformation of the theoretical probabilities into a 0-1 data matrix.
A randomized assingment implies that for each cell an additional random number is drawn.
If the model probability is larger than this value, the person gets 1 on this particular item, if smaller, 0 is assigned.
Alternatively, a numeric probability cutpoint can be assigned and the 0-1 scoring is carried out according to the same rule.
The discrim
argument can be specified either as a vector of length items
defining the item discrimination parameters in the 2-PL (e.g., c(1,1,0.5,1,1.5)
), or as a single value.
In that case, the discrimination parameters are drawn from a lognormal distribution with meanlog = 0
, where the specified value in discrim
refers to the standard deviation on the log-scale.
The larger the values, the stronger the degree of Rasch violation.
Reasonable values are up to 0.5.
If 0, the data are Rasch homogeneous.
References
Su\'arez-Falc\'on, J. C., & Glas, C. A. W. (2003). Evaluation of global testing procedures for item fit to the Rasch model. British Journal of Mathematical and Statistical Society, 56, 127-143.
See Also
sim.rasch
, sim.locdep
, sim.xdim
Examples
#simulating 2-PL data
#500 persons, 10 items, sdlog = 0.30, randomized cutpoint
X <- sim.2pl(500, 10, discrim = 0.30)
#item and discrimination parameters from uniform distribution,
#cutpoint fixed
dpar <- runif(50, 0, 2)
ipar <- runif(50, -1.5, 1.5)
X <- sim.2pl(500, ipar, dpar, cutpoint = 0.5)