Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

Sim3PL

Simulated Data for fitting a 3PL and 3PLu


Description

Simulated responses of 10000 persons to 10 dichotomous items under two different simulation conditions.

Usage

data("Sim3PL", package = "psychotools")

Format

A data frame containing 10000 observations on 2 variables.

resp

Item response matrix with 10 items (see details below).

resp2

Item response matrix with 10 items (see details below).

Details

Data were simulated under the 3PL (resp) and 3PLu (resp2) (see plmodel). For the 3PL scenario, the random number generator's seed was set to 277. For the 3PLu scenario, the random number generator's seed was set to 167. Person parameters θ_{i} of 10000 persons were drawn from the standard normal distribution. Item difficulties b_{j} of 10 items (under the classical IRT parametrization) were drawn from the standard normal distribution. Item discrimination parameters a_{j} were drawn from a log-normal distribution with a mean of 0 and a variance of 0.0625 on the log scale. For the 3PL, guessing parameters g_{j} were drawn from a uniform distribution with a lower limit of 0.1 and an upper limit of 0.2. For the 3PLu, upper asymptote parameters u_{j} were drawn from a uniform distribution with a lower limit of 0.8 and an upper limit of 0.9. In both scenarios, a 10000 x 10 matrix based on realizations of a uniform distribution with a lower limit of 0 and an upper limit of 1 was generated and compared to a 10000 x 10 matrix based on the probability function under the respective model. If the probability of person i solving item j exceeded the corresponding realization of the uniform distribution, this cell of the matrix was set to 1, e.g., person i solved item j.

See Also

Examples

## overview
data("Sim3PL", package = "psychotools")
str(Sim3PL)

## data generation
M <- 10000
N <- 10

## 3PL scenario
set.seed(277)
theta <- rnorm(M, 0, 1)
a <- rlnorm(N, 0, 0.25)
b <- rnorm(N, 0, 1)
g <- runif(N, 0.1, 0.2)
u <- rep(1, N)
probs <- matrix(g, M, N, byrow = TRUE) + matrix(u - g, M, N, byrow = TRUE) *
  plogis(matrix(a, M, N, byrow = TRUE) * outer(theta, b, "-"))
resp <- (probs > matrix(runif(M * N, 0, 1), M, N)) + 0
all.equal(resp, Sim3PL$resp, check.attributes = FALSE)

## 3PLu scenario
set.seed(167)
theta <- rnorm(M, 0, 1)
a <- rlnorm(N, 0, 0.25)
b <- rnorm(N, 0, 1)
g <- rep(0, N)
u <- runif(N, 0.8, 0.9)
probs <- matrix(g, M, N, byrow = TRUE) + matrix(u - g, M, N, byrow = TRUE) *
  plogis(matrix(a, M, N, byrow = TRUE) * outer(theta, b, "-"))
resp2 <- (probs > matrix(runif(M * N, 0, 1), M, N)) + 0
all.equal(resp2, Sim3PL$resp2, check.attributes = FALSE)

psychotools

Psychometric Modeling Infrastructure

v0.6-0
GPL-2 | GPL-3
Authors
Achim Zeileis [aut, cre] (<https://orcid.org/0000-0003-0918-3766>), Carolin Strobl [aut], Florian Wickelmaier [aut], Basil Komboz [aut], Julia Kopf [aut], Lennart Schneider [aut] (<https://orcid.org/0000-0003-4152-5308>), Rudolf Debelak [aut]
Initial release
2020-11-16

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.