% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plots.R
\name{plot_resid_dist}
\alias{plot_resid_dist}
\title{Plot the fit residual distribution}
\usage{
plot_resid_dist(
  fit,
  what = c("items", "persons"),
  statistic = c("fit_resid", "natural"),
  bins = 25
)
}
\arguments{
\item{fit}{A fitted object from \code{\link{rasch}}.}

\item{what}{\code{"items"} or \code{"persons"}.}

\item{statistic}{\code{"fit_resid"} (log-transformed, default) or
\code{"natural"}.}

\item{bins}{Number of histogram bins.}
}
\value{
Called for its plotting side effect; invisibly \code{NULL}.
}
\description{
A histogram of the
item or person fit residuals -- the log-transformed statistic or its
untransformed natural form -- against the standard normal density they
should approximate under fit (Andrich and Marais 2019, ch. 15). The
natural residual is visibly skewed
(that is why the log transform is reported); both are available.
}
\examples{
set.seed(1)
d <- seq(-2, 2, length.out = 10)
X <- matrix(rbinom(400 * 10, 1, plogis(outer(rnorm(400), d, "-"))), 400, 10)
colnames(X) <- paste0("I", 1:10)
plot_resid_dist(rasch(X), what = "persons")
}
