MCsimRasch: Generating initial data sample for MCMC simulation.

View source: R/MCsimRasch.R

MCsimRaschR Documentation

Generating initial data sample for MCMC simulation.

Description

This utility function generates an initial data sample according to the Rasch model.

Usage

MCsimRasch(N, splitcr, items)

Arguments

N

Total sample size for which data matrix should be generated.

splitcr

Split criterion which is a numeric vector x with length equal to number of persons and contains zeros and ones. It indicates group membership for every person. If missing splitcr, by default group 1 with covariate value 0 is set to ng1 = floor(N/2), and group 2 with covariate value 1 set to difference N - ng1.

items

A vector of item parameters.

Details

Restricted and unrestricted models are checked for the conditions of the existence and uniqueness of the CML estimates according to Fischer (1981) and for appropriate response pattern, i.e. no only 0/full responses in any item are allowed. Vector of person parameters (drawn from a specified distribution) are drawn by default at random from the standard normal distribution.

Value

A list of results.

X

Generated binary data matrix according to the Rasch model.

splitcr

see Arguments.

check

Logical value. If FALSE data matrix complies to specified conditions. See Details.

i_total

Number of iterations needed to generate data matrix.

call

The matched call.

References

none

See Also

MCboot, MCplot and MCplot_crit

Examples

## Not run: 
# Rasch model
items <- c(0, -2, -1, 0, 1, 2)
x <- c( rep(0, 15), rep(1,15))

res <- MCsimRasch(N = 30, splitcr = x, items = items)




## End(Not run)

akurz1/tclboot documentation built on Oct. 23, 2022, 9:07 p.m.