R/norm.2008RJB.R
norm.2008RJB.Rd
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.
norm.2008RJB(x, C1 = 6, C2 = 24, method = c("asymptotic", "MC"), nreps = 2000)
a length-\(n\) data vector.
a control constant. Authors proposed \(C1=6\) for nominal level of \(\alpha=0.05\).
a control constant. Authors proposed \(C2=24\) for nominal level of \(\alpha=0.05\).
method to compute \(p\)-value. Using initials is possible, "a"
for asymptotic for example.
the number of Monte Carlo simulations to be run when method="MC"
.
a (list) object of S3
class htest
containing:
a test statistic.
\(p\)-value under \(H_0\).
alternative hypothesis.
name of the test.
name(s) of provided sample data.
Gel YR, Gastwirth JL (2008). “A robust modification of the Jarque–Bera test of normality.” Economics Letters, 99(1), 30--32. ISSN 01651765.
## 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