| sim_mixed | R Documentation |
This function returns an integer matrix of simulated responses for a test with dichotomous (1/2/3/4-PL) and polytomous (GPCM) items, with the item parameters in the layout of PPall.
sim_mixed(thres, alpha = NULL, lowerA = NULL, upperA = NULL, theta)
thres |
A numeric matrix with the thresholds of each item in its columns, as in |
alpha |
A numeric vector of slope parameters. If |
lowerA |
A numeric vector of lower asymptotes (4PL items). If |
upperA |
A numeric vector of upper asymptotes (4PL items). If |
theta |
A numeric vector which contains person parameters. |
alpha, lowerA and upperA may also be single numbers, which are then used for every item. lowerA and upperA only apply to the 4PL items. A person with NA as person parameter gets a row of NA. The data of a pure 4PL or GPCM test are the same as those of sim_4pl or sim_gpcm with the same seed.
An integer matrix with one row per person and one column per item.
sim_4pl, sim_gpcm, PPall
set.seed(1800)
# four 3PL items and two GPCM items with three categories
thres <- rbind(0, c(-1, -0.3, 0.4, 1.2, -0.5, 0.2), c(NA, NA, NA, NA, 0.8, 1.4))
x <- sim_mixed(thres = thres, alpha = c(1, 1.2, 0.8, 1.1, 1, 0.9),
lowerA = c(0.2, 0.1, 0.15, 0.2, 0, 0), theta = rnorm(300))
head(x)
# and back: estimate the persons with the same parameters
res <- PPall(x, thres = thres, slopes = c(1, 1.2, 0.8, 1.1, 1, 0.9),
lowerA = c(0.2, 0.1, 0.15, 0.2, 0, 0))
summary(res$estimates$estimate)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.