norm.2008RJB: Robust Jarque-Bera Test of Univariate Normality by Gel and...

View source: R/norm_2008RJB.R

norm.2008RJBR Documentation

Robust Jarque-Bera Test of Univariate Normality by Gel and Gastwirth (2008)

Description

Given an univariate sample x, it tests

H_0 : x\textrm{ is from normal distribution} \quad vs\quad H_1 : \textrm{ not } H_0

using a test procedure by Gel and Gastwirth (2008), which is a robustified version Jarque-Bera test.

Usage

norm.2008RJB(x, C1 = 6, C2 = 24, method = c("asymptotic", "MC"), nreps = 2000)

Arguments

x

a length-n data vector.

C1

a control constant. Authors proposed C1=6 for nominal level of α=0.05.

C2

a control constant. Authors proposed C2=24 for nominal level of α=0.05.

method

method to compute p-value. Using initials is possible, "a" for asymptotic for example.

nreps

the number of Monte Carlo simulations to be run when method="MC".

Value

a (list) object of S3 class htest containing:

statistic

a test statistic.

p.value

p-value under H_0.

alternative

alternative hypothesis.

method

name of the test.

data.name

name(s) of provided sample data.

References

\insertRef

gel_robust_2008SHT

Examples

## generate samples from uniform distribution
x = runif(28)

## test with both methods of attaining p-values
test1 = norm.2008RJB(x, method="a") # Asymptotics
test2 = norm.2008RJB(x, method="m") # Monte Carlo 


kisungyou/SHT documentation built on Oct. 15, 2022, 3:18 p.m.