% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/simplexreg_press.R
\name{press}
\alias{press}
\title{PRESS-Based \eqn{P2} Statistics for Simplex Regression}
\usage{
press(..., type = c("standardized", "biasvariance"))
}
\arguments{
\item{...}{One or more objects of class \code{simplexregression}.}

\item{type}{Character string specifying the type of residual to use.
Options are \code{"standardized"} (default) or \code{"biasvariance"}
(see \code{\link{residuals.simplexregression}}).}
}
\value{
When a single model is provided, a named numeric vector with components
\code{P2}, \code{P2_c}, and \code{PRESS}. When multiple models are provided,
a data frame with one row per model and columns \code{P2}, \code{P2_c}, and
\code{PRESS}.
}
\description{
Computes the PRESS (Predicted Residual Error Sum of Squares)
statistic and the associated \eqn{P^2} and adjusted \eqn{P^2} measures for simplex
regression models with parametric or fixed mean link function, as proposed by
Espinheira and Silva (2026).
}
\details{
The PRESS statistic for the simplex regression model is given by:
\deqn{\text{PRESS} = \sum_{i=1}^{n} \left(\frac{r_i}{1 - h_{ii}}\right)^2,}
where \eqn{r_i} denotes the residual for observation \eqn{i} and
\eqn{h_{ii}} is the \eqn{i}-th diagonal element of the hat matrix.

The \eqn{P^2} statistic is a cross-validation analog of \eqn{R^2}, defined
for the simplex regression mode as:
\deqn{P^2 = 1 - \frac{\text{PRESS}}{\left(\frac{n}{n-r}\right)^2 \text{SST}},}
where \eqn{\text{SST} = \sum_{i=1}^{n}(\hat{y}_i - \bar{\hat{y}})^2} and
\eqn{r} is the number of estimated parameters.

The adjusted \eqn{P^2} is given by:
\deqn{P^2_c = 1 - (1 - P^2)\frac{n-1}{n-r}.}

The \code{type} argument controls which residuals \eqn{r_i} are used in
the PRESS computation.
}
\examples{
data(ReadingSkills, package = "SimplexRegression")
fit <- simplexreg(accuracy ~ dyslexia * iq | dyslexia + iq + I(iq^2),
                 data = ReadingSkills)

fit1 <- simplexreg(accuracy ~ dyslexia * iq | dyslexia + iq + I(iq^2),
                 data = ReadingSkills, link.mu = "loglog")
# Single model
press(fit)

# Comparing multiple models
press(fit, fit1)

# Using bias-variance residuals
press(fit, fit1, type = "biasvariance")

}
\references{
Espinheira, P. L., Silva, A. O. (2026). Prediction in the nonlinear simplex model.
\emph{International Journal of Data Science and Analytics}, \bold{22}, 161.
\doi{10.1007/s41060-026-01114-9}

Espinheira, P. L., Silva, A. O. (2020). Residual and influence analysis to a
general class of simplex regression. \emph{TEST}, \bold{29}, 523–-552.
\doi{10.1007/s11749-019-00665-3}
}
\seealso{
\code{\link{simplexreg}}, \code{\link{residuals.simplexregression}}.
}
