Learn R Programming

normtest (version 1.1)

ajb.norm.test: Adjusted Jarque--Bera test for normality

Description

Performs adjusted Jarque--Bera test for the composite hypothesis of normality, see Urzua (1996).

Usage

ajb.norm.test(x, nrepl=2000)

Arguments

x
a numeric vector of data values.
nrepl
the number of replications in Monte Carlo simulation.

Value

  • A list with class "htest" containing the following components:
  • statisticthe value of the adjusted Jarque--Bera statistic.
  • p.valuethe p-value for the test.
  • methodthe character string "Adjusted Jarque-Bera test for normality".
  • data.namea character string giving the name(s) of the data.

Details

The adjusted Jarque--Bera test for normality is based on the following statistic: $$AJB = \frac{(\sqrt{b_1})^2}{\mathrm{Var}\left(\sqrt{b_1}\right)} + \frac{(b_2 - \mathrm{E}\left(b_2\right))^2}{\mathrm{Var}\left(b_2\right)},$$ where $$\sqrt{b_1} = \frac{\frac{1}{n}\sum_{i=1}^n(X_i - \overline{X})^3}{\left(\frac{1}{n}\sum_{i=1}^n(X_i - \overline{X})^2\right)^{3/2}}, \quad b_2 = \frac{\frac{1}{n}\sum_{i=1}^n(X_i - \overline{X})^4}{\left(\frac{1}{n}\sum_{i=1}^n(X_i - \overline{X})^2\right)^2},$$ $$\mathrm{Var}\left(\sqrt{b_1}\right) = \frac{6(n-2)}{(n+1)(n+3)}, \quad E\left(b_2\right) = \frac{3(n-1)}{n+1}, \quad \mathrm{Var}\left(b_2\right) = \frac{24n(n-2)(n-3)}{(n+1)^2(n+3)(n+5)}.$$ The p-value is computed by Monte Carlo simulation.

References

Urzua, C. M. (1996): On the correct use of omnibus tests for normality. --- Economics Letters, vol. 53, pp. 247--251.

Examples

Run this code
ajb.norm.test(rnorm(100))
ajb.norm.test(abs(runif(100,-2,5)))

Run the code above in your browser using DataLab