Learn R Programming

PROsetta (version 0.4.1)

computeResponseProbability: (internal) compute response probability

Description

computeResponseProbability is an internal function for computing response probability from a set of item parameters.

Usage

computeResponseProbability(ipar, model, theta_grid)

Value

computeResponseProbability returns an item-wise list of probability matrices.

Arguments

ipar

a data.frame containing item parameters.

model

the item model to use. Accepts grm or gpcm.

theta_grid

theta values to compute probability values at.

Examples

Run this code
ipar <- PROsetta:::extractAnchorParameters(data_asq, FALSE)
theta_q <- seq(-4, 4, .1)
p <- PROsetta:::computeResponseProbability(ipar, "grm", theta_q)

plot(
  0, 0, type = "n", xlim = c(-4, 4), ylim = c(0, 1),
  xlab = "Theta", ylab = "Response probability"
)
lines(theta_q, p[[1]][, 1])
lines(theta_q, p[[1]][, 2])
lines(theta_q, p[[1]][, 3])
lines(theta_q, p[[1]][, 4])
lines(theta_q, p[[1]][, 5])

Run the code above in your browser using DataLab