cai.statistic: Cai test statistic

View source: R/cai_statistic.R

cai.statisticR Documentation

Cai test statistic

Description

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

Usage

cai.statistic(x, y, alpha = 0.05)

Arguments

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 x

alpha

Significance level of the test (default value is 0.05)

Value

A list with two values

test.statistic

The test statistic value

decision

A binary response of whether the null hypothesis is rejected or not rejected

References

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.

Examples

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)

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