| sim_4pl | R Documentation |
This function returns a dichotomous matrix of simulated responses under given item and person parameters.
sim_4pl(beta, alpha, lowerA, upperA, theta)
beta |
A numeric vector which contains the difficulty parameters for each item. |
alpha |
A numeric vector, which contains the slope parameters for each item. |
lowerA |
A numeric vector, which contains the lower asymptote parameters (kind of guessing parameter) for each item. |
upperA |
numeric vector, which contains the upper asymptote parameters for each item. |
theta |
A numeric vector which contains person parameters. |
alpha, lowerA and upperA may also be single numbers,
which are 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.
Manuel Reif
sim_gpcm, sim_mixed, PP_4pl
set.seed(1700)
theta <- rnorm(200)
b <- seq(-2, 2, length.out = 7)
# 1PL (Rasch) model: slopes 1, no asymptotes
x1 <- sim_4pl(beta = b, alpha = 1, lowerA = 0, upperA = 1, theta = theta)
colMeans(x1)
# 4PL model
x4 <- sim_4pl(beta = b, alpha = c(1, 1.1, 0.9, 0.9, 1.5, 1.1, 1),
lowerA = c(0, 0, 0.2, 0.15, 0.04, 0, 0.21),
upperA = c(0.9, 0.98, 0.97, 1, 1, 1, 0.97), theta = theta)
head(x4)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.