% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/simplexreg_plots.R
\name{halfnormal.plot}
\alias{halfnormal.plot}
\title{Half-Normal Plots with Simulated Envelopes for Simplex Regression}
\usage{
halfnormal.plot(
  model,
  type = c("weighted", "quantile", "pearson", "deviance", "standardized", "variance",
    "biasvariance", "score", "dualscore", "response"),
  nsim = 100,
  level = 0.95,
  seed = 1987,
  ...
)
}
\arguments{
\item{model}{An object of class \code{"simplexregression"}.}

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

\item{nsim}{Number of simulations for envelope construction (default: \code{100}).}

\item{level}{Confidence level for envelope bounds (default: \code{0.95}).}

\item{seed}{Integer setting the random seed for reproducibility (default: \code{1987}).}

\item{...}{Additional graphical parameters.}
}
\value{
Called for its side effects (half-normal plot with simulated envelope).
Returns \code{NULL} invisibly.
}
\description{
Produces half-normal plots with simulated envelopes for simplex
regression model with parametric or fixed mean link function.
}
\details{
The envelope is based on the following steps:
\enumerate{
  \item Simulate \code{nsim} response vectors from the fitted model
        using its estimated mean and dispersion parameter;
  \item Refitting the model to each simulated dataset;
  \item Computing absolute residuals and their order statistics;
  \item Obtaining envelope bounds from empirical quantiles.
}

Simulated datasets whose refitted model fails to converge are discarded and
resampled, up to \code{5 * nsim} total attempts. If \code{nsim} converged
fits cannot be obtained within this limit, the function stops with an error.

Points outside the envelope may indicate model inadequacy.
}
\examples{
data(ReadingSkills, package = "SimplexRegression")
fit <- simplexreg(accuracy ~ dyslexia * iq | dyslexia + iq + I(iq^2),
                 data = ReadingSkills)

\donttest{
halfnormal.plot(fit, seed = 2008)
}

}
\seealso{
\code{\link{residuals.simplexregression}},
\code{\link{plot.simplexregression}}.
}
