% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plots.R
\name{plot_threshold_prob}
\alias{plot_threshold_prob}
\title{Plot threshold probability curves}
\usage{
plot_threshold_prob(
  fit,
  item,
  grid = seq(-6, 6, 0.05),
  observed = FALSE,
  n_groups = fit$n_groups
)
}
\arguments{
\item{fit}{A fitted object from \code{\link{rasch}}.}

\item{item}{Item name or column index.}

\item{grid}{Logit grid over which to draw the curves.}

\item{observed}{Overlay the observed conditional threshold proportions
per class interval.}

\item{n_groups}{Class intervals for the observed points.}
}
\value{
Called for its plotting side effect; invisibly \code{NULL}.
}
\description{
Conditional probability of success at each threshold,
\code{P(X = k | X = k - 1 or k)}, a logistic ogive crossing 0.5 at the
threshold location. Disordered thresholds are immediately visible as
out-of-sequence ogives. With \code{observed = TRUE} the observed
conditional proportions per class interval are overlaid, the direct
check on whether each threshold discriminates (and hence whether
collapsing categories could ever be justified; Andrich and Marais 2019,
ch. 22).
}
\examples{
set.seed(1)
simP <- function(th, t) { x <- 0:length(t); p <- exp(x * th - c(0, cumsum(t))); p / sum(p) }
th <- rnorm(400)
X <- sapply(1:4, function(i) sapply(th, function(t) sample(0:3, 1, prob = simP(t, c(-1, 0, 1)))))
colnames(X) <- sprintf("P\%02d", 1:4)
plot_threshold_prob(rasch(X), "P01")
}
