View source: R/cai_statistic.R
cai.statistic | R Documentation |
This function computes the test statistic for testing equality of covariance matrices as described in the Cai et al. paper (need citation)
cai.statistic(x, y, alpha = 0.05)
x |
data matrix of first group with rows representing the samples and columns representing variables. |
y |
data matrix of second group with same number of columns as |
alpha |
Significance level of the test (default value is 0.05) |
A list with two values
The test statistic value
A binary response of whether the null hypothesis is rejected or not rejected
T. Cai, W. Liu, and Y. Xia. Two-sample covariance matrix testing and support recovery in high-dimensional and sparse settings. Journal of the American Statistical Association, 108(501):265–277, 2013.
library(mvtnorm)
x = rmvnorm(n = 20, mean = numeric(100), sigma = diag(100))
y = rmvnorm(n = 10, mean = numeric(100), sigma = diag(100))
cai.statistic(x, y)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.