% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/simplexreg_scoretest.R
\name{scoretest}
\alias{scoretest}
\title{Rao's Score Test for Simplex Regression with Parametric Mean Link Function}
\usage{
scoretest(model, link.mu = c("plogit1", "plogit2"))
}
\arguments{
\item{model}{An object of class \code{"simplexregression"} fitted with the
fixed logit mean link (\code{link.mu = "logit"})}

\item{link.mu}{Character string specifying the parametric link function under the
alternative hypothesis. Options are \code{"plogit1"} or \code{"plogit2"}.}
}
\value{
An object of class \code{"htest"} containing:
\itemize{
  \item \code{statistic}: The score test statistic,
  \item \code{parameter}: Degrees of freedom (always 1),
  \item \code{p.value}: The \eqn{p}-value of the test,
  \item \code{method}: Description of the test,
  \item \code{data.name}: Description of the link comparison being tested
  (e.g., \code{"Logit vs plogit1"})
}
}
\description{
Performs a Rao's score test to test whether the link parameter
\eqn{\lambda} equals 1, which corresponds to evaluating the null hypothesis
that the mean link function is the standard logit.
}
\details{
Given that the fixed logit link function is a particular case of the parametric
logit link functions when \eqn{\lambda = 1}, it is possible to test whether the
mean link function is logit by testing \eqn{H_0: \lambda = 1} against
\eqn{H_1: \lambda \neq 1}.

The score test statistic is computed from the component of the score vector
associated with \eqn{\lambda} and the corresponding element of the inverse
Fisher information matrix, both evaluated at the maximum likelihood estimator
under the null hypothesis (i.e., with \eqn{\lambda} fixed at 1). For the full
expression of the test statistic, see Justino and Cribari-Neto (2026).

Under regularity conditions, the null hypothesis, and when \eqn{n} is large,
the test statistic follows a chi-squared distribution with 1 degree of freedom.
}
\examples{
# Simulate data
set.seed(2026)
n <- 100
x1 <- runif(n, 0, 1)
x2 <- runif(n, 0, 1)
z1 <- runif(n, 0, 1)
mu <- parametric_mean_link_inv(0.6 - 2*x1 - 1.5*x2, 0.5, "plogit1")
sigma2 <- dispersion_link_inv(-2 - 2.5*z1, "log")
y <- rsimplex(n, mu, sigma2)
data <- data.frame(y = y, x1 = x1, x2 = x2, z1 = z1)

# Fit model with logit
model <- simplexreg(y ~ x1 + x2 | z1, data = data, link.mu = "logit")

# Test if lambda = 1
scoretest(model, link.mu = "plogit1")

}
\references{
Justino, M. E. C. and Cribari-Neto, F. (2026).
Simplex regression with a flexible logit link: Inference and application
to cross-country impunity data.
\emph{Applied Mathematical Modelling}, \bold{154}, 116713. \doi{10.1016/j.apm.2025.116713}

Rao, C. R. (1948). Large sample tests of statistical hypotheses concerning
several parameters with applications to problems of estimation.
\emph{Mathematical Proceedings of the Cambridge Philosophical Society},
 \bold{44}(1), 50--57. \doi{10.1017/S0305004100023987}
}
\seealso{
\code{\link{parametric_mean_link}}
}
