jb.test: Jarque-Bera Test

View source: R/jb.test.R

jb.testR Documentation

Jarque-Bera Test

Description

Jarque-Bera test for normality. The object of test results returned by this command can be plotted using the plot() function.

Usage

jb.test(x, data = list(), sig.level = 0.05, details = FALSE, hyp = TRUE)

Arguments

x

a numeric vector, an estimated linear model object or model formula (with data specified). In the two latter cases the model's residuals are tested for normality.

data

if mod is a formula then the corresponding data frame has to be specified.

sig.level

significance level. Default value: sig.level = 0.05.

details

logical value indicating whether specific details about the test should be returned.

hyp

logical value indicating whether the hypotheses should be returned.

Details

Under H0 the test statistic of the Jarque-Bera test follows a chi-squared distribution with 2 degrees of freedom. If moment of order 3 (skewness) differs significantly from 0 and/or moment of order 4 (kurtosis) differs significantly from 3, H0 is rejected.

Value

A list object including:

hyp character matrix of hypotheses (if hyp = TRUE).
results a data frame of basic test results.
skew moment of order 3 (asymmetry, skewness).
kur moment of order 4 (kurtosis).
nobs number of observations (internal purpose).
nulldist type of the Null distribution and its parameter(s).

References

Jarque, C.M. & Bera, A.K. (1980): Efficient Test for Normality, Homoscedasticity and Serial Independence of Residuals. Economics Letters 6 Issue 3, 255-259.

See Also

'jarque.test()' in Package 'moments'.

Examples

## Test response variable for normality
X <- jb.test(data.income$loginc)
X

## Estimate linear model
income.est <- ols(loginc ~ logsave + logsum, data = data.income)
## Test residuals for normality, print details
jb.test(income.est, details = TRUE)

## Equivalent test
jb.test(loginc ~ logsave + logsum, data = data.income, details = TRUE)

## Plot the test result
plot(X)


desk documentation built on May 29, 2024, 6:05 a.m.

Related to jb.test in desk...