sim_data: Simulate FMP Data

Description Usage Arguments Value Examples

View source: R/sim_data.R

Description

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

Usage

1
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

1
2
3
4
5
6
7
8
## 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)

flexmet documentation built on July 14, 2021, 1:06 a.m.