View source: R/chenzz_statistic.R
chenzz.statistic | R Documentation |
This function computes the test statistic for testing equality of covariance matrices as described in the Chen et al. paper (need citation)
chenzz.statistic(x, test = "identity")
x |
data matrix with rows representing samples and columns representing variables |
test |
The type of test being performed - "identity"(default) or "sphericity". |
A list with two values
The test statistic value
The p-value
S. X. Chen, L. X. Zhang, and P. S. Zhong. Tests for high-dimensional covariance matrices. Journal of the American Statistical Association, 105(490):810–819, 2010.
library(mvtnorm)
# Test for identity
x = rmvnorm(n = 20, mean = numeric(100), sigma = diag(100))
chenzz.statistic(x, test = "identity")
# Test for sphericity
y = rmvnorm(n = 10, mean = runif(100, 1, 3), sigma = diag(rgamma(100, 10, 3)))
chenzz.statistic(y, test = "sphericity")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.