| sim_gpcm | R Documentation |
This function returns an integer matrix of simulated responses under given item and person parameters.
sim_gpcm(thres, alpha, theta)
thres |
A numeric matrix which contains threshold parameters for each item. The first row may contain zeroes only (as in |
alpha |
A numeric vector, which contains the slope parameters - one parameter per item is expected. |
theta |
A numeric vector which contains person parameters. |
alpha may also be a single number, which is then used for every item.
A person with NA as person parameter gets a row of NA.
An integer matrix with one row per person and one column per item.
sim_4pl, sim_mixed, PP_gpcm
set.seed(1750)
# thresholds of six items with three categories (the row of zeroes is optional)
thres <- rbind(0, matrix(c(-2, -1.23, 1.11, 3.48, 1, 2, -1, -0.2, 0.5, 1.3, -0.8, 1.5),
nrow = 2))
x <- sim_gpcm(thres = thres, alpha = c(0.5, 1, 1.5, 1.1, 1, 0.98), theta = rnorm(100))
head(x)
# the last two items get a fourth category
thres4 <- rbind(thres, c(NA, NA, NA, NA, 1.7, 1))
apply(sim_gpcm(thres = thres4, alpha = 1, theta = rnorm(100)), 2, max)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.