This utility function returns a 01 matrix violating the local independence assumption.
1 2  sim.locdep(persons, items, it.cor = 0.25, seed = NULL,
cutpoint = "randomized")

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). 
it.cor 
Either a single correlation value between 0 and 1 or a positive semidefinite VC matrix. 
seed 
A seed for the random number generated can be set. 
cutpoint 
Either 
If persons
or items
is an integer value, the corresponding parameter vector
is drawn from N(0,1). The cutpoint
argument refers to the transformation of the theoretical
probabilities into a 01 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 01 scoring is carried out according to the same rule.
The argument it.cor
reflects the pairwise interitem correlation. If this should be constant
across the items, a single value between 0 (i.e. Rasch model) and 1 (strong violation) can be specified.
Alternatively, a symmetric VCmatrix of dimension number of items can be defined.
Jannarone, R. J. (1986). Conjunctive item response theory kernels. Psychometrika, 51, 357373.
Su\'arezFalc\'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, 127143.
sim.rasch
, sim.2pl
, sim.xdim
1 2 3 4 5 6 7 8  #simulating locallydependent data
#500 persons, 10 items, interitem correlation of 0.5
X < sim.locdep(500, 10, it.cor = 0.5)
#500 persons, 4 items, correlation matrix specified
sigma < matrix(c(1,0.2,0.2,0.3,0.2,1,0.4,0.1,0.2,0.4,1,0.8,0.3,0.1,0.8,1),
ncol = 4)
X < sim.locdep(500, 4, it.cor = sigma)

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
All documentation is copyright its authors; we didn't write any of that.