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 Jarque and Bera (1980).
norm.1980JB(x, method = c("asymptotic", "MC"), nreps = 2000)
a length-\(n\) data vector.
method to compute \(p\)-value. Using initials is possible, "a"
for asymptotic for example. Case insensitive.
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.
Jarque CM, Bera AK (1980). “Efficient tests for normality, homoscedasticity and serial independence of regression residuals.” Economics Letters, 6(3), 255--259. ISSN 01651765.
Jarque CM, Bera AK (1987). “A Test for Normality of Observations and Regression Residuals.” International Statistical Review / Revue Internationale de Statistique, 55(2), 163. ISSN 03067734.
## generate samples from uniform distribution
x = runif(28)
## test with both methods of attaining p-values
test1 = norm.1980JB(x, method="a") # Asymptotics
test2 = norm.1980JB(x, method="m") # Monte Carlo