Simulate Data under a Partial Credit Model
rpcm
simulates IRT data under a partial credit model.
rpcm(theta, delta, nullcats = FALSE, return_setting = TRUE)
theta |
numeric vector of person parameters. Can also be a list, then a
list of length |
delta |
list of numeric vectors of item threshold parameters. |
nullcats |
logical. Should null categories be allowed? |
return_setting |
logical. Should a list containing slots of "delta", and "theta", as well as the simulated data matrix "data" be returned (default) or only the simulated data matrix? |
rpcm
returns either a list of the following components:
delta |
list of numeric vectors of item threshold parameters used, |
theta |
numeric vector of person parameters used, |
data |
numeric matrix containing the simulated data, |
or (if return_setting = FALSE
) only the numeric matrix containing the
simulated data.
set.seed(1) ## item responses under a partial credit model (PCM) with ## 6 persons with three different person parameters ## 8 items with different combinations of two or three threshold parameters ppar <- rep(-1:1, each = 2) tpar <- rep(list(-2:0, -1:1, 0:1, 0:2), each = 2) sim <- rpcm(theta = ppar, delta = tpar) ## simulated item response data along with setting parameters sim ## print and plot corresponding item response object iresp <- itemresp(sim$data) iresp plot(iresp)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.