sim_data {flexmet}R Documentation

Simulate FMP Data

Description

Simulate data according to user-specified FMP item parameters and latent trait parameters.

Usage

sim_data(bmat, theta, maxncat = 2, cvec = NULL, dvec = NULL)

Arguments

bmat

Matrix of FMP item parameters.

theta

Vector of latent trait values.

maxncat

Maximum number of response categories (the first maxncat - 1 columns of bmat are intercepts)

cvec

Optional vector of lower asymptote parameters. If cvec = NULL, then all lower asymptotes set to 0.

dvec

Optional vector of upper asymptote parameters. If dvec = NULL, then all upper asymptotes set to 1.

Value

Matrix of randomly generated binary item responses.

Examples


## generate 5-category item responses for normally distributed theta
##   and 5 items with k = 2

set.seed(2342)
bmat <- sim_bmat(n_items = 5, k = 2, ncat = 5)$bmat

theta <- rnorm(50)
dat <- sim_data(bmat = bmat, theta = theta, maxncat = 5)


[Package flexmet version 1.1 Index]