Skip to contents

Draws the probability of each response category against ability, as in the single-trait tabs of the Models menu: one coloured line per category with a marker at every ability, a gray line at a probability of 0.5, and a legend in which a click hides or shows a curve.

Usage

plot_category_curves(
  theta,
  probs,
  title = "",
  subtitle = NULL,
  ylab = "P(X=m|theta)"
)

Arguments

theta

Numeric vector of abilities.

probs

Matrix of probabilities, one row for each value of theta and one column for each category, as returned by prob_gpcm() and the other prob_*() functions; the column names label the categories.

title

Title of the plot.

subtitle

Optional note, shown on a second, smaller line of the title.

ylab

Title of the vertical axis.

Value

A plotly object.

Examples

theta <- seq(-6, 6, by = 0.1)
plot_category_curves(theta, prob_grm(theta), "Graded Response Model")
p <- prob_4pl(theta, c = 0.2) plot_category_curves(theta, cbind("1" = p, "0" = 1 - p), "3PL Model", ylab = "P(x)")