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

rrm

Simulate Data under a Rasch model


Description

rrm simulates IRT data under a Rasch model.

Usage

rrm(theta, beta, return_setting = TRUE)

Arguments

theta

numeric vector of person parameters. Can also be a list, then a list of length length(theta) is returned, containing multiple simulated data matrices.

beta

numeric vector of item difficulty parameters.

return_setting

logical. Should a list containing slots of "beta", and "theta", as well as the simulated data matrix "data" be returned (default) or only the simulated data matrix.

Value

rrm returns either a list of the following components:

beta

numeric vector of item difficulty parameters used,

theta

numeric vector of person parameters used,

data

numeric matrix containing the simulated data,

or (if return_setting = FALSE) only the numeric matrix containing the simulated data.

See Also

Examples

set.seed(1)
## item responses under a Rasch model from
## 6 persons with three different person parameters
## 9 increasingly difficult items
ppar <- rep(-1:1, each = 2)
ipar <- seq(-2, 2, by = 0.5)
sim <- rrm(theta = ppar, beta = ipar)

## simulated item response data along with setting parameters
sim

## print and plot corresponding item response object
iresp <- itemresp(sim$data)
iresp
plot(iresp)

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.