% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/mc.R
\name{plot_distractors}
\alias{plot_distractors}
\title{Plot multiple-choice option curves}
\usage{
plot_distractors(fit, item, n_groups = fit$n_groups)
}
\arguments{
\item{fit}{A fitted object from \code{\link{rasch}} run with a \code{key}.}

\item{item}{Keyed item name.}

\item{n_groups}{Number of class intervals.}
}
\value{
Called for its plotting side effect; invisibly \code{NULL}.
}
\description{
The proportion choosing each response option across class intervals of the
rest measure (the person estimate from the other items), with the keyed
option drawn solid and bold. The keyed option should rise with the trait
and every distractor should fall; a rising distractor is the graphical
signature of a miskey or an ambiguous option.
}
\examples{
set.seed(1); Np <- 400
th <- rnorm(Np)
raw <- sapply(seq(-1, 1, length.out = 6), function(d) {
  ok <- rbinom(Np, 1, plogis(th - d))
  ifelse(ok == 1, "A", sample(c("B", "C", "D"), Np, replace = TRUE))
})
colnames(raw) <- paste0("M", 1:6)
fit <- rasch(raw, key = setNames(rep("A", 6), colnames(raw)))
plot_distractors(fit, "M3")
}
