logo

Harke-Bera Test 📂Statistical Test

Harke-Bera Test

Hypothesis Testing

Given that we have quantitative data {xi}i=1n\left\{ x_{i} \right\}_{i = 1}^{n}.

  • H0H_{0}: Data {xi}i=1n\left\{ x_{i} \right\}_{i = 1}^{n} follows a normal distribution.
  • H1H_{1}: Data {xi}i=1n\left\{ x_{i} \right\}_{i = 1}^{n} does not follow a normal distribution.

Explanation

The Jarque-Bera test is used to test for normality as a hypothesis test, typically to demonstrate the presence of normality. This is one of the rare cases where the acceptance of the null hypothesis matches the analyst’s intention, hence it is important to understand the hypothesis accurately.

The difference from the Shapiro-Wilk test is that it uses skewness and kurtosis for the test. The normal distribution has both a population skewness and population kurtosis of 00, and the test statistic JBJB based on the sample skewness g1g_{1} and sample kurtosis g2g_{2} follows a chi-squared distribution with degrees of freedom 22. JB:=ng126+ng2224χ2(2) JB := {{n g_{1}^2} \over {6}} + {{n g_{2}^2} \over {24}} \sim \chi^{2} (2) Regardless, since it is a normality test, it doesn’t particularly matter which one you use, but the Jarque-Bera test uses skewness that is sensitive to outliers, often revealing normality after removing outliers more frequently compared to the Shapiro-Wilk test. Although it cannot be guaranteed for this reason alone, it is typically used in time series analysis rather than regression analysis to demonstrate normality. In practice, the jarque.bera.test() function in the tseries package of R performs the Jarque-Bera test.

Code

Exercise

Create the following two random samples to actually conduct the Jarque-Bera test.

992C753E5C7BD7AB1D.png 991D063E5C7BD7AB1E.png

N is data from a normal distribution, and geo is data from a geometric distribution.

20190310\_121333.png

The test results appear exactly as expected.

Complete Code

Below is an example code in R.

library(tseries)
set.seed(150421)
N<-rnorm(100)

win.graph(4,4); hist(N)
jarque.bera.test(N)
geo<-rgeom(100,0.5)

win.graph(4,4); hist(geo)
jarque.bera.test(geo)

See Also