Generates binary item responses from the model plogis(d + a * theta).
Examples
set.seed(1)
pars <- data.frame(a = c(1, 1.2), d = c(0, -0.5))
simulate_2pl(rnorm(5), pars)
#> 1 2
#> [1,] 0 0
#> [2,] 1 1
#> [3,] 0 1
#> [4,] 1 1
#> [5,] 0 1
Generates binary item responses from the model plogis(d + a * theta).
set.seed(1)
pars <- data.frame(a = c(1, 1.2), d = c(0, -0.5))
simulate_2pl(rnorm(5), pars)
#> 1 2
#> [1,] 0 0
#> [2,] 1 1
#> [3,] 0 1
#> [4,] 1 1
#> [5,] 0 1