meank.2019CPH {SHT} | R Documentation |
Test for Equality of Means by Cao, Park, and He (2019)
Description
Given univariate samples X_1~,\ldots,~X_k
, it tests
H_0 : \mu_1 = \cdots \mu_k\quad vs\quad H_1 : \textrm{at least one equality does not hold}
using the procedure by Cao, Park, and He (2019).
Usage
meank.2019CPH(dlist, method = c("original", "Hu"))
Arguments
dlist |
a list of length |
method |
a method to be applied to estimate variance parameter. |
Value
a (list) object of S3
class htest
containing:
- statistic
a test statistic.
- p.value
p
-value underH_0
.- alternative
alternative hypothesis.
- method
name of the test.
- data.name
name(s) of provided sample data.
References
Cao M, Park J, He D (2019). “A test for the k sample Behrens–Fisher problem in high dimensional data.” Journal of Statistical Planning and Inference, 201, 86–102. ISSN 03783758.
Examples
## CRAN-purpose small example
tinylist = list()
for (i in 1:3){ # consider 3-sample case
tinylist[[i]] = matrix(rnorm(10*3),ncol=3)
}
meank.2019CPH(tinylist, method="o") # newly-proposed variance estimator
meank.2019CPH(tinylist, method="h") # adopt one from 2017Hu
## Not run:
## test when k=5 samples with (n,p) = (10,50)
## empirical Type 1 error
niter = 10000
counter = rep(0,niter) # record p-values
for (i in 1:niter){
mylist = list()
for (j in 1:5){
mylist[[j]] = matrix(rnorm(10*50),ncol=50)
}
counter[i] = ifelse(meank.2019CPH(mylist)$p.value < 0.05, 1, 0)
}
## print the result
cat(paste("\n* Example for 'meank.2019CPH'\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)