% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/lrt_mean_gau.R
\name{test_one_sample_gau}
\alias{test_one_sample_gau}
\title{One-sample test for mean structure under antedependence}
\usage{
test_one_sample_gau(y, mu0, p = 1L, order = NULL, use_modified = TRUE)
}
\arguments{
\item{y}{Numeric matrix with n_subjects rows and n_time columns.}

\item{mu0}{Hypothesized mean vector under the null (length n_time).}

\item{p}{Antedependence order of the covariance structure. This is the same
order parameter named \code{order} in \code{\link{fit_gau}}.}

\item{order}{Optional alias for \code{p}. Supply only one of \code{p} or
\code{order}.}

\item{use_modified}{Logical. If TRUE (default), use the modified test statistic
(formula 7.7) for better small-sample approximation.}
}
\value{
A list with class \code{gau_mean_test} containing:
\describe{
\item{method}{Inference method used (\code{"lrt"}).}
\item{test_type}{"one-sample"}
\item{mu0}{Hypothesized mean under null}
\item{mu_hat}{MLE of mean (sample mean)}
\item{statistic}{Test statistic value}
\item{statistic_modified}{Modified test statistic (if use_modified = TRUE)}
\item{df}{Degrees of freedom (n_time)}
\item{p_value}{P-value from chi-square distribution}
\item{p_value_modified}{P-value from modified test}
\item{order}{Antedependence order used}
}
}
\description{
Tests the null hypothesis that the mean vector equals a specified value
mu = mu_0 against the alternative mu != mu_0, under an AD(p) covariance
structure. This implements Theorem 7.1 of Zimmerman & Núñez-Antón (2009).
}
\details{
The test exploits the AD structure to gain power over tests that don't
assume any covariance structure. The likelihood ratio test statistic
(Theorem 7.1) is:
\deqn{N \sum_{i=1}^{n} [\log RSS_i(\mu_0) - \log RSS_i(\hat{\mu})]}

where RSS_i(mu) is the residual sum of squares from the regression of
Y_i - mu_i on its p predecessors Y_(i-1) - mu_(i-1), ..., Y_(i-p) - mu_(i-p).

The test has n degrees of freedom (one for each component of mu).
}
\examples{
\donttest{
# Simulate data with known mean
mu_true <- c(10, 11, 12, 13, 14, 15)
y <- simulate_gau(n_subjects = 50, n_time = 6, order = 1, mu = mu_true)

# Test if mean is zero
test <- test_one_sample_gau(y, mu0 = rep(0, 6), p = 1)
print(test)

# Test if mean equals true value (should not reject)
test2 <- test_one_sample_gau(y, mu0 = mu_true, p = 1)
print(test2)
}

}
\references{
Zimmerman, D.L. and Núñez-Antón, V. (2009). Antedependence Models for
Longitudinal Data. Chapman & Hall/CRC. Chapter 7.
}
\seealso{
\code{\link{test_two_sample_gau}}, \code{\link{test_order_gau}}
}
