% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/simplexreg_plots.R
\name{plot.simplexregression}
\alias{plot.simplexregression}
\title{Diagnostic Plots for Simplex Regression Models}
\usage{
\method{plot}{simplexregression}(
  x,
  which = 1:7,
  type = c("quantile", "pearson", "deviance", "standardized", "weighted", "variance",
    "biasvariance", "score", "dualscore", "response"),
  ask = prod(par("mfcol")) < length(which) && interactive(),
  threshold = NULL,
  label.pos = 3,
  plot.type = NULL,
  ...
)
}
\arguments{
\item{x}{An object of class \code{"simplexregression"}.}

\item{which}{Numeric vector indicating which plots to display (\code{1:7}).}

\item{type}{Character string specifying the residual type (default: \code{"quantile"}).
\cr See \code{\link{residuals.simplexregression}} for available options.}

\item{ask}{Logical; if \code{TRUE}, the user is asked before each plot.
Default is \code{TRUE} when multiple plots are requested.}

\item{threshold}{Numeric threshold for identifying influential or outlying
observations in plots 1--3 (residuals plots), 6 (Cook's distance), and
7 (generalized leverage). If \code{NULL} (default), no observations are
highlighted.}

\item{label.pos}{Position(s) for outlier labels in plots 1--3, 6, and 7.
Can be a single value (applied to all labels) or a vector. Values:
1 = below, 2 = left, 3 = above, 4 = right. Default is \code{3} (above).
See \code{\link[graphics]{text}} for details.}

\item{plot.type}{Controls the plot symbol/type for scatter plots and index plots.
If \code{NULL} (default), uses \code{pch = 1} (open circles) for residual plots
(which = 1--4) and \code{type = "h"} (vertical lines) for Cook's distance
(\code{which = 6}) and generalized leverage plots (\code{which = 7}).
Otherwise, the value is passed directly to \code{pch} (for scatter plots) or
\code{type} (for index plots).}

\item{...}{Additional graphical parameters.}
}
\value{
Called for its side effects (diagnostic plots). Returns \code{NULL}
invisibly.
}
\description{
Produces diagnostic plots for fitted simplex regression models with
parametric or fixed mean link function.
}
\details{
Seven diagnostic plots are available:
\itemize{
  \item Residuals vs observation index (\code{which = 1}): Identifies outliers
  and temporal patterns;

  \item Residuals vs fitted values (\code{which = 2}): Checks for heteroscedasticity
  and patterns;

  \item Residuals vs linear predictor (\code{which = 3}): Evaluates link function
  adequacy;

  \item Observed vs fitted values (\code{which = 4}): Assesses overall model fit;

  \item Normal Q–Q plot (\code{which = 5}): Evaluates residual normality (especially
  useful for quantile residuals);

  \item Cook’s distance vs indices of observations (\code{which = 6}): Identifies
  influential observations;

  \item Generalized leverage vs indices of observations (\code{which = 7}): Identifies
  influential observations.
}
}
\examples{
data(ReadingSkills, package = "SimplexRegression")
fit <- simplexreg(accuracy ~ dyslexia * iq | dyslexia + iq + I(iq^2),
                 data = ReadingSkills)

# Display all diagnostic plots
oldpar <- par(mfrow = c(3, 3))
plot(fit, which = 1:7)
par(oldpar)

}
\seealso{
\code{\link{residuals.simplexregression}},
\code{\link{cooks.distance.simplexregression}},
\code{\link{halfnormal.plot}}.
}
