covk.2001Schott: Test for Homogeneity of Covariances by Schott (2001)

View source: R/covk_2001Schott.R

covk.2001SchottR Documentation

Test for Homogeneity of Covariances by Schott (2001)

Description

Given univariate samples X_1~,…,~X_k, it tests

H_0 : Σ_1 = \cdots Σ_k\quad vs\quad H_1 : \textrm{at least one equality does not hold}

using the procedure by Schott (2001) using Wald statistics. In the original paper, it provides 4 different test statistics for general elliptical distribution cases. However, we only deliver the first one with an assumption of multivariate normal population.

Usage

covk.2001Schott(dlist)

Arguments

dlist

a list of length k where each element is a sample matrix of same dimension.

Value

a (list) object of S3 class htest containing:

statistic

a test statistic.

p.value

p-value under H_0.

alternative

alternative hypothesis.

method

name of the test.

data.name

name(s) of provided sample data.

References

\insertRef

schott_tests_2001SHT

Examples

## CRAN-purpose small example
tinylist = list()
for (i in 1:3){ # consider 3-sample case
  tinylist[[i]] = matrix(rnorm(10*3),ncol=3)
}
covk.2001Schott(tinylist) # run the test

## Not run: 
## test when k=5 samples with (n,p) = (100,20)
## empirical Type 1 error 
niter   = 1000
counter = rep(0,niter)  # record p-values
for (i in 1:niter){
  mylist = list()
  for (j in 1:5){
     mylist[[j]] = matrix(rnorm(100*20),ncol=20)
  }
  
  counter[i] = ifelse(covk.2001Schott(mylist)$p.value < 0.05, 1, 0)
}

## print the result
cat(paste("\n* Example for 'covk.2001Schott'\n","*\n",
"* number of rejections   : ", sum(counter),"\n",
"* total number of trials : ", niter,"\n",
"* empirical Type 1 error : ",round(sum(counter/niter),5),"\n",sep=""))

## End(Not run)


kisungyou/SHT documentation built on Oct. 15, 2022, 3:18 p.m.