% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/api-plotting-secondary.R
\name{plot_local_dependence_heatmap}
\alias{plot_local_dependence_heatmap}
\title{Pairwise standardized-residual heatmap for local-dependence review}
\usage{
plot_local_dependence_heatmap(
  fit,
  diagnostics = NULL,
  facet = "Rater",
  min_pairs = 5L,
  preset = c("standard", "publication", "compact", "monochrome"),
  draw = TRUE
)
}
\arguments{
\item{fit}{An \code{mfrm_fit} from \code{\link[=fit_mfrm]{fit_mfrm()}}.}

\item{diagnostics}{Optional \code{\link[=diagnose_mfrm]{diagnose_mfrm()}} output. Computed
on demand when omitted.}

\item{facet}{Facet whose levels are placed on both axes (default
\code{"Rater"}).}

\item{min_pairs}{Minimum number of shared response opportunities
required to retain a pair. Pairs below the threshold are shown
as \code{NA}.}

\item{preset}{Visual preset.}

\item{draw}{If \code{TRUE}, draw with base graphics.}
}
\value{
An \code{mfrm_plot_data} whose \code{data} slot bundles the symmetric
residual \code{matrix}, the long-form \code{pairs} table, and the threshold
used.
}
\description{
Builds an N x N heatmap of pairwise standardized residuals between
facet levels, computed from the diagnostics observation table.
Cells with large absolute values flag pairs of facet elements (e.g.
two raters, two items) whose residuals co-move more than the
main-effects MFRM expects, which is the standard Yen Q3-style
indicator of local response dependence.
}
\details{
This helper complements \code{\link[=plot_marginal_pairwise]{plot_marginal_pairwise()}}: the marginal
version uses posterior-integrated agreement residuals on a
top-N pair list, while this view shows every pair on a shared color
scale so an analyst can scan for diagonal blocks or hotspots.
}
\examples{
toy <- load_mfrmr_data("example_core")
fit <- fit_mfrm(toy, "Person", c("Rater", "Criterion"), "Score",
                 method = "JML", maxit = 30)
p <- plot_local_dependence_heatmap(fit, draw = FALSE)
dim(p$data$matrix)
# Look for: |off-diagonal correlation| < 0.2 is the typical
#   acceptable regime; values >= 0.3 (Yen 1984 / Marais 2013
#   guideline) flag pairs that may share dependence beyond the
#   main-effects MFRM. Inspect those cells in `diag$obs`.
}
\seealso{
\code{\link[=plot_marginal_pairwise]{plot_marginal_pairwise()}}, \code{\link[=plot_qc_dashboard]{plot_qc_dashboard()}},
\link{mfrmr_visual_diagnostics}
}
