Skip to content
Statistical Hypothesis Testing Toolbox
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Statistical Hypothesis Testing in R

SHT aims at providing a casket of tools for hypothesis testing procedures ranging from classical to modern techniques. We hope it not be used as a primary means of p-hacking.


SHT released version can be obtained from CRAN with:


or the up-to-date development version from github:

## install.packages("devtools")
## library(devtools)

List of Available Tests

We categorized available functions by their object of interest for better navigation.

  • Notations x and y refer to samples.
  • Authors are referred by last names. See the help page of each function for complete references.
  • k-sample means that the test is checking the homogeneity across multiple samples.
  • Function naming convention is {type of test.test name}, or {type of test.year authors}, where there are two or three authors, we took their initials as abbreviation or simply the last name of the first author otherwise.
  • usek1d and useknd lets a user to apply any k-sample tests for two-sample testings.
  • When ℝp notation is used, it denotes multivariate procedures.

0. utilities

function name description
usek1d apply k-sample test method for two univariate samples
useknd apply k-sample test method for two multivariate samples

1. tests for univariate mean μ ∈ ℝ

function name authors description of H0
mean1.ttest Student (1908) μx {≤, =, ≥} μ0 (1-sample)
mean2.ttest Student (1908) & Welch (1947) μx {≤, =, ≥} μy (2-sample)
meank.anova - μ1 = ⋯ = μk (k-sample)

2. tests for multivariate mean μ ∈ ℝp

function name authors description of H0
mean1.1931Hotelling Hotelling (1931) μx = μ0 (1-sample)
mean1.1958Dempster Dempster (1958, 1960) μx = μ0 (1-sample)
mean1.1996BS Bai and Saranadasa (1996) μx = μ0 (1-sample)
mean1.2008SD Srivastava and Du (2008) μx = μ0 (1-sample)
mean2.1931Hotelling Hotelling (1931) μx = μy (2-sample)
mean2.1958Dempster Dempster (1958, 1960) μx = μy (2-sample)
mean2.1965Yao Yao (1965) μx = μy (2-sample)
mean2.1980Johansen Johansen (1980) μx = μy (2-sample)
mean2.1986NVM Nel and Van der Merwe (1986) μx = μy (2-sample)
mean2.1996BS Bai and Saranadasa (1996) μx = μy (2-sample)
mean2.2004KY Krishnamoorthy and Yu (2004) μx = μy (2-sample)
mean2.2008SD Srivastava and Du (2008) μx = μy (2-sample)
mean2.2011LJW Lopes, Jacob, and Wainwright (2011) μx = μy (2-sample)
mean2.2014CLX Cai, Liu, and Xia (2014) μx = μy (2-sample)
mean2.2014Thulin Thulin (2014) μx = μy (2-sample)
meank.2007Schott Schott (2007) μ1 = ⋯ = μk (k-sample)
meank.2009ZX Zhang and Xu (2009) μ1 = ⋯ = μk (k-sample)
meank.2019CPH Cao, Park, and He (2019) μ1 = ⋯ = μk (k-sample)

3. tests for variance σ2

function name authors description of H0
var1.chisq - σx2 {≤, =, ≥} σ02 (1-sample)
var2.F - σx2 {≤, =, ≥} σy2 (2-sample)
vark.1937Bartlett Bartlett (1937) σ12 = ⋯ = σk2 (k-sample)
vark.1960Levene Levene (1960) σ12 = ⋯ = σk2 (k-sample)
vark.1974BF Brown and Forsythe (1974) σ12 = ⋯ = σk2 (k-sample)

4. tests for covariance Σ

function name authors description of H0
cov1.2012Fisher Fisher (2012) Σx = Σ0 (1-sample)
cov1.2015WL Wu and Li (2015) Σx = Σ0 (1-sample)
cov2.2012LC Li and Chen (2012) Σx = Σy (2-sample)
cov2.2013CLX Cai, Liu, and Xia (2013) Σx = Σy (2-sample)
cov2.2015WL Wu and Li (2015) Σx = Σy (2-sample)
covk.2001Schott Schott (2001) Σ1 = ⋯ = Σk (k-sample)
covk.2007Schott Schott (2007) Σ1 = ⋯ = Σk (k-sample)

5. simultaneous tests for mean μ and covariance Σ

function name authors description of H0
sim1.2017Liu Liu et al. (2017) μx = μy,  Σx = Σy (1-sample)
sim2.2018HN Hyodo and Nishiyama (2018) μx = μy,  Σx = Σy (2-sample)

6. tests for equality of distributions

function name authors description of H0
eqdist.2014BG Biswas and Ghosh (2014) FX = FY ∈ ℝ1 & ℝp (2-sample)

7. goodness-of-fit tests of normality

function name authors description of H0
norm.1965SW Shapiro and Wilk (1965) FX = Normal ∈ ℝ1
norm.1972SF Shapiro and Francia (1972) FX = Normal ∈ ℝ1
norm.1980JB Jarque and Bera (1980) FX = Normal ∈ ℝ1
norm.1996AJB Urzua (1996) FX = Normal ∈ ℝ1
norm.2008RJB Gel and Gastwirth (2008) FX = Normal ∈ ℝ1

8. goodness-of-fit tests of uniformity

function name authors description of H0
unif.2017YMi Yang and Modarres (2017) FX = Uniform ∈ ℝp
unif.2017YMq Yang and Modarres (2017) FX = Uniform ∈ ℝp
You can’t perform that action at this time.