Perform the Adaptable Regularized Hotelling’s T2 test (ARHT) proposed by Li et al. (2016). Both one- and two- sample mean test are available with various probabilistic alternative prior models. It contains a function to consistently estimate higher order moments of the population covariance spectral distribution using the spectral of the sample covariance matrix. In addition, it contains a function to sample from 3-variate chi-squared random vectors approximately with a given correlation matrix when the degrees of freedom are large.
You can install ARHT from github with:
# install.packages("devtools")
::install_github("HaoranLi/ARHT") devtools
This is a basic example which shows you how to solve a common problem:
library(ARHT)
## basic example code
set.seed(10086)
# One-sample test
= 300; p =500
n1 = matrix(rnorm(n1 * p), nrow = n1, ncol = p)
dataX = ARHT(dataX)
res1
# Two-sample test
= 400
n2= matrix(rnorm(n2 * p), nrow = n2, ncol = p )
dataY = ARHT(dataX, dataY, mu_0 = rep(0.01,p))
res2
# Specify probabilistic alternative priors model
= ARHT(dataX, dataY, mu_0 = rep(0.01,p),
res3 prob_alt_prior = list(c(1/3, 1/3, 1/3), c(0,1,0)))
# Change Type 1 error calibration method
= ARHT(dataX, dataY, mu_0 = rep(0.01,p),
res4 Type1error_calib = "sqrt")
= res4$ARHT_pvalue < 0.05 RejectOrNot
Li, Haoran, Alexander Aue, Debashis Paul, Jie Peng, and Pei Wang. 2016. “An Adaptable Generalization of Hotelling’s T2 Test in High Dimension.” arXiv preprint arXiv:1609.08725.