% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plots.R
\name{plot_catfreq}
\alias{plot_catfreq}
\title{Plot category frequencies}
\usage{
plot_catfreq(fit, item)
}
\arguments{
\item{fit}{A fitted object from \code{\link{rasch}}.}

\item{item}{Item name or column index.}
}
\value{
Called for its plotting side effect; invisibly \code{NULL}.
}
\description{
Observed response distribution over the categories of one item.
}
\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_catfreq(rasch(X), "P01")
}
