irf_fmp: FMP Item Response Function

Description Usage Arguments Value Examples

View source: R/irf.R

Description

Find FMP item response probabilities for user-supplied item and person parameters.

Usage

1
irf_fmp(theta, bmat, maxncat = 2, returncat = NA, cvec = NULL, dvec = NULL)

Arguments

theta

Vector of latent trait parameters.

bmat

Items x parameters matrix of FMP item parameters (or a vector of FMP item parameters for a single item).

maxncat

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

returncat

Response categories for which probabilities should be returned, 0,..., maxncat - 1.

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 item response probabilities.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# plot the IRF for an item with 4 response categories and k = 2

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

theta <- seq(-3, 3, by = .01)

probability <- irf_fmp(theta = theta, bmat = bmat,
                       maxncat = 4, returncat = 0:3)

plot(theta, probability[, , 1], type = 'l', ylab = "probability")
points(theta, probability[, , 2], type = 'l')
points(theta, probability[, , 3], type = 'l')
points(theta, probability[, , 4], type = 'l')

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