sim.xdim | R Documentation |
This utility function simulates a 0-1 matrix violating the unidimensionality assumption in the Rasch model.
sim.xdim(persons, items, Sigma, weightmat, seed = NULL,
cutpoint = "randomized")
persons |
Either a matrix (each column corresponds to a dimension) 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). |
Sigma |
A positive-definite symmetric matrix specifying the covariance matrix of the variables. |
weightmat |
Matrix for item-weights for each dimension (columns). |
seed |
A seed for the random number generated can be set. |
cutpoint |
Either |
If persons
is specified as matrix, Sigma
is ignored. If 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 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.
If weightmat
is not specified, a random indicator matrix is generated where each item is a measurement
of only one dimension. For instance, the first row for a 3D-model could be (0,1,0) which means
that the first item measures the second dimension only. This corresponds to the between-item
multidimensional model presented by Adams et al. (1997).
Sigma
reflects the VC-structure for the person parameters drawn from a multivariate
standard normal distribution. Thus, the diagonal elements are typically 1 and the lower the
covariances in the off-diagonal, the stronger the model violation.
Adams, R. J., Wilson, M., & Wang, W. C. (1997). The multidimensional random coefficients multinomial logit model. Applied Psychological Measurement, 21, 1-23.
Glas, C. A. W. (1992). A Rasch model with a multivariate distribution of ability. In M. Wilson (Ed.), Objective Measurement: Foundations, Recent Developments, and Applications (pp. 236-258). Norwood, NJ: Ablex.
sim.rasch
, sim.locdep
, sim.2pl
# 500 persons, 10 items, 3 dimensions, random weights.
Sigma <- matrix(c(1, 0.01, 0.01, 0.01, 1, 0.01, 0.01, 0.01, 1), 3)
X <- sim.xdim(500, 10, Sigma)
#500 persons, 10 items, 2 dimensions, weights fixed to 0.5
itemvec <- runif(10, -2, 2)
Sigma <- matrix(c(1, 0.05, 0.05, 1), 2)
weights <- matrix(0.5, ncol = 2, nrow = 10)
X <- sim.xdim(500, itemvec, Sigma, weightmat = weights)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.