Skip to contents

Draws the response surface of prob_mirt() seen from above, as labelled contour lines of equal probability, with the zero lines of both axes, a thick line at one probability (usually halfway between the asymptotes) and, optionally, the item vector as a blue arrow. Both axes have the same scale, so the angle of the arrow is true.

Usage

plot_mirt_contour(
  theta1,
  theta2,
  z,
  nlevels = 10,
  level = NULL,
  arrow = NULL,
  xlab = NULL,
  ylab = NULL
)

Arguments

theta1, theta2

Abilities on the two dimensions.

z

Matrix with one row for each value of theta1 and one column for each value of theta2.

nlevels

Approximate number of contour levels.

level

Probability of the thick line, or NULL for none; every piece of it is drawn, and none when the grid does not reach it.

arrow

Item vector from item_vector(), or NULL; it is drawn when it lies inside the plotted grid.

xlab, ylab

Titles of the axes; NULL labels the abilities with the Greek letter theta, as theta1 and theta2.

Value

A plotly object.

Examples

theta <- seq(-4, 4, length.out = 50)
plot_mirt_contour(theta, theta, prob_mirt(theta, theta), level = 0.5, arrow = item_vector())