% 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}.}

\item{link.mu}{Character string specifying the link function under the
alternative hypothesis. Options are "plogit1" or "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 p-value of the test,
  \item \code{method}: Description of the test,
  \item \code{data.name}: Model name and link function being tested.
}
}
\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 for this hypothesis test is given by:

\deqn{S_R = \boldsymbol{U}_\lambda(\boldsymbol{\tilde{\theta}})^\top
\boldsymbol{\tilde{K}}^{\lambda \lambda}
\boldsymbol{U}_\lambda(\boldsymbol{\tilde{\theta}}),}

where \eqn{\boldsymbol{U}_\lambda} and \eqn{\boldsymbol{\tilde{K}}^{\lambda \lambda}}
denote, respectively, the component of the score vector and the corresponding
element of the inverse Fisher information matrix associated with \eqn{\lambda},
both evaluated at \eqn{\boldsymbol{\tilde{\theta}} = (\boldsymbol{\tilde{\beta}}^\top,
\boldsymbol{\tilde{\gamma}}^\top, 1)^\top}, the maximum likelihood estimator under
the null hypothesis. For more details 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}
}
