srivastava.statistic: Srivastava et al. test statistics

View source: R/srivastava_tests.R

srivastava.statisticR Documentation

Srivastava et al. test statistics

Description

This function computes the test statistics from Srivastava et al. (2014) for tests involving the covariance matrices. If two sample matrices are provided, the function returns the result of the comparison of two covariance matrices. When only one data matrix is provided, tests for sphericity and identity can be performed.

Usage

srivastava.statistic(x, y = NULL, test = "identity")

Arguments

x

data matrix of first group with rows representing samples and columns representing variables.

y

data matrix of second group with same number of columns as x. If not provided (default value is NULL), then the one-sample tests are performed as specified.

test

Type of test to be performed. When y = NULL, you can specify "identity" (Default) or "sphericity". If y is provided as a non-null data matrix, any specified value for test will be over-written to test = "two.sample".

Value

A list with two values

test.statistic

The test statistic value

p.value

The p-value

References

M. S. Srivastava, H. Yanagihara, and T. Kubokawa. Tests for covariance matrices in high dimension with less sample size. Journal of Multivariate Analysis, 130:289–309, 2014.

Examples

library(mvtnorm)
x = rmvnorm(n = 100, mean = numeric(10), sigma = diag(10))
y = rmvnorm(n = 100, mean = numeric(10), sigma = diag(10))
srivastava.statistic(x, y)
srivastava.statistic(x)

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