simra {pairwise} | R Documentation |
Simulate Response Pattern under Dichotomous and Polytomous Rasch Model
Description
function for simulation of response patterns following the dichotomous and/or polytomous Rasch model based on the category probabilities given the model parameters.
At default, when just calling simra()
1 replication of responses to 5 items with difficulties -2, -1, 0, 1, 2 from 100 persons with ability drawn from N(0|1) are sampled.
Usage
simra(
itempar = matrix(seq(-2, 2, length = 5)),
theta = 100,
pers_obj = NULL,
replicate = 1,
seed = seq(1, replicate, 1),
...
)
Arguments
itempar |
a "matrix" with |
theta |
either one of the following (1) a numeric vector of length |
pers_obj |
an object of class |
replicate |
an integer defining how many replicates (data matrices) |
seed |
a numeric vector with legnth of number of replications used for |
... |
arguments passed through. |
Details
no details in the moment.
Value
an array with dim(n,k,r)
response patterns (k
items in colums n
persons in rows and r
replications in the third dimension).
Examples
########
simra() # 100 dichotomous probabilistic response pattern
### 100 polytomous response pattern (4 items; each 4 answer categories)
v <- c(-1.0,-0.5,0.0,0.5,-0.75,-0.25,0.25,0.75,-0.5,0.0,0.5,1.0)
itempar <- matrix(v,nrow = 4,ncol = 3)
simra(itempar = itempar)
simra(itempar = itempar,replicate = 10) # draw 10 replications