% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/CCXH2024.GLHTBF.2cNRT.R
\name{CCXH2024.GLHTBF.2cNRT}
\alias{CCXH2024.GLHTBF.2cNRT}
\title{Normal-reference-test with two-cumulant (2-c) matched $\\chi^2$-approximation for GLHT problem proposed by Cao et al. (2024)}
\usage{
CCXH2024.GLHTBF.2cNRT(Y, B, n, p, alpha = 0.05)
}
\arguments{
\item{Y}{A list of \eqn{k} data matrices. The \eqn{i}th element represents the data matrix
(\eqn{n_i \times p}) from the \eqn{i}th population with each row representing a \eqn{p}-dimensional observation.}

\item{B}{A vector of \eqn{k} known scalars \eqn{(B_1,\ldots,B_k)} specifying the linear combination of mean vectors.}

\item{n}{A vector of \eqn{k} sample sizes. The \eqn{i}th element represents the sample size of group \eqn{i}, \eqn{n_i}.}

\item{p}{The dimension of data.}

\item{alpha}{Significance level used to report the critical value (default 0.05). P-value does not depend on alpha.}
}
\value{
A list of class \code{"NRtest"} containing the results of the hypothesis test.
}
\description{
Implements the scale-invariant test of Cao et al. (2024) for high-dimensional
linear hypotheses of \eqn{k}-sample mean vectors under heteroscedastic
covariance structures.
}
\details{
Suppose we have \eqn{k} independent high-dimensional samples
\deqn{\boldsymbol{Y}_{i1},\ldots,\boldsymbol{Y}_{in_i}\ \text{are i.i.d. with}\ \mathrm{E}(\boldsymbol{Y}_{i1})=\boldsymbol{\mu}_i,\
\mathrm{Cov}(\boldsymbol{Y}_{i1})=\boldsymbol{\Sigma}_i,\ i=1,\ldots,k,}
where the covariance matrices \eqn{\boldsymbol{\Sigma}_i} may differ across groups.

It is of interest to test the k-sample linear hypothesis
\deqn{H_0:\ \sum_{i=1}^k B_i\boldsymbol{\mu}_i=\boldsymbol{0}\quad \text{vs.}\quad H_1:\ \sum_{i=1}^k B_i\boldsymbol{\mu}_i\neq\boldsymbol{0}.}

Cao et al. (2024) proposed the following scale-invariant test statistic:
\deqn{T = p^{-1}\boldsymbol{Y}^{\top}\boldsymbol{D}_\sigma^{-1}\boldsymbol{Y},\quad
\boldsymbol{Y}=\sqrt{n}\sum_{i=1}^k B_i\bar{\boldsymbol{Y}}_i,\quad n=\sum_{i=1}^k n_i,}
where \eqn{\bar{\boldsymbol{Y}}_i} is the sample mean vector of group \eqn{i} and \eqn{\boldsymbol{D}_\sigma} is the diagonal matrix formed from a pooled covariance estimator.
They showed that under the null hypothesis, \eqn{T} can be approximated by a Welch--Satterthwaite chi-square reference law \eqn{\chi^2_{\nu^*}/\nu^*},
where \eqn{\nu^*} is an adjusted degrees-of-freedom parameter.
}
\examples{
\donttest{
library("HDNRA")
data("corneal")

# corneal: 150 x p, split into 4 groups (n_i x p)
group1 <- as.matrix(corneal[1:43,  ])      # normal
group2 <- as.matrix(corneal[44:57, ])      # unilateral suspect
group3 <- as.matrix(corneal[58:78, ])      # suspect map
group4 <- as.matrix(corneal[79:150,])      # clinical keratoconus

Y <- list(group1, group2, group3, group4)
n <- c(nrow(group1), nrow(group2), nrow(group3), nrow(group4))
p <- ncol(group1)

# Example linear combination (single contrast)
B <- c(-2, 1, 2, -1)

CCXH2024.GLHTBF.2cNRT(Y, B, n, p, alpha = 0.05)
}

}
\references{
\insertRef{cao2024scale}{HDNRA}
}
\concept{nraglht}
