chenzz.statistic: Chen et al. test statistic

View source: R/chenzz_statistic.R

chenzz.statisticR Documentation

Chen et al. test statistic

Description

This function computes the test statistic for testing equality of covariance matrices as described in the Chen et al. paper (need citation)

Usage

chenzz.statistic(x, test = "identity")

Arguments

x

data matrix with rows representing samples and columns representing variables

test

The type of test being performed - "identity"(default) or "sphericity".

Value

A list with two values

test.statistic

The test statistic value

p.value

The p-value

References

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.

Examples

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")

dnayyala/cramp documentation built on June 27, 2023, 1:34 p.m.