if (FALSE) {
# 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))
# specify test booklet design with three items
design <- matrix(c(1, 1, 0, 1, 0, 1, 0, 1, 1), ncol = 3)
# 100 persons in each booklet
# person parameter drawn from a normal distribution: N(0, 1.5)
# item parameters equally spaced between [-3, 3]
simul.rasch(100, items = 3, design = design)
# 100 persons in each booklet
# person parameter drawn from a uniform distribution: U[-4, 4]
# item parameters equally spaced between [-3, 3]
simul.rasch(runif(100, -4, 4), items = 3, design = design)
# 10 persons in booklet 1 / 20 persons in booklet 2 / 30 persons in booklet 3
# person parameter drawn from a normal distribution: N(0, 1.5)
# item parameters equally spaced between [-3, 3]
simul.rasch(list(10, 20, 30), items = 3, design = design)
# 10 persons in booklet 1 / 20 persons in booklet 2 / 30 persons in booklet 3
# person parameter drawn from a uniform distribution: U[-4, 4]
# item parameters equally spaced between [-4, 4]
simul.rasch(list(runif(10, -4, 4), runif(20, -4, 4), runif(30, -4, 4)),
items = seq(-4, 4, length.out = 3), design = design)
}
Run the code above in your browser using DataLab