CQ2 {Domean} | R Documentation |
Two-Sample CQ Test for High-Dimensional Covariance Matrices
Description
Performs a two-sample test to compare the covariance matrices of two high-dimensional samples. This test is designed for situations where the number of variables \( p \) is large relative to the sample sizes \( n_1 \) and \( n_2 \).
Usage
CQ2(X, Y)
Arguments
X |
A numeric matrix representing the first sample, where rows are variables and columns are observations. |
Y |
A numeric matrix representing the second sample, where rows are variables and columns are observations. |
Details
The test statistic is based on the difference between the sample covariance matrices, normalized by their variances. The p-value is computed using a normal approximation.
Value
A list containing the following components:
statistics |
The test statistic \( Q_n \). |
p.value |
The p-value of the test. |
alternative |
The alternative hypothesis ("two.sided"). |
method |
The method used ("Two-Sample CQ test"). |
Examples
# Example usage:
set.seed(123)
p <- 50
n1 <- 30
n2 <- 30
X <- matrix(rnorm(n1 * p), nrow = p, ncol = n1)
Y <- matrix(rnorm(n2 * p), nrow = p, ncol = n2)
result <- CQ2(X, Y)
print(result)