Learn R Programming

pwrRasch (version 0.1-2)

simul.rasch: Simulate data according to the Rasch model

Description

This function simulates data according to the Rasch model based on user-specified item and person parameters.

Usage

simul.rasch(persons, items, sum0 = TRUE)

Arguments

persons
Either a vector of specified person parameters or an integer indicating the number of persons.
items
Either a vector of specified item parameters or an integer indicating the number of items.
sum0
If TRUE, specified item parameters need to be normalized to sum-0.

Value

Returns a 0-1 matrix according to the Rasch model.

Details

If persons is an integer value, the corresponding parameter vector is drawn from N(0, 1.5). If items is an integer value, the corresponding parameter vector is equally spaced between [-3, 3]. Note that item parameters need to be normalized to sum-0. This precondition can be overruled using argument sum0 = FALSE.

References

Kubinger, K. D., Rasch, D., & Yanagida, T. (2009). On designing data-sampling for Rasch model calibrating an achievement test. Psychology Science Quarterly, 51, 370-384.

Kubinger, K. D., Rasch, D., & Yanagida, T. (2011). A new approach for testing the Rasch model. Educational Research and Evaluation, 17, 321-333.

See Also

aov.rasch, pwr.rasch

Examples

Run this code
## Not run: 
# 
# # simulate Rasch model based data
# # 100 persons, 20 items,
# # person parameter drawn from a normal distribution: N(0,1.5)
# # item parameters equally spaced between [-3, 3]
# simul.rasch(100, items = 20)
# 
# # simulate Rasch model based data
# # 100 persons, 17 items
# # person parameter drawn from a uniform distribution: U[-4, 4]
# # item parameters: [-4.0, -3.5, -3.0, ... , 3.0, 3.5, 4.0]
# simul.rasch(runif(100, -4, 4), items = seq(-4, 4, by = 0.5))
# ## End(Not run)

Run the code above in your browser using DataLab