jb.test | R Documentation |
Jarque-Bera test for normality. The object of test results returned by this command can be plotted using the plot()
function.
jb.test(x, data = list(), sig.level = 0.05, details = FALSE, hyp = TRUE)
x |
a numeric vector, an estimated linear model object or model formula (with |
data |
if |
sig.level |
significance level. Default value: |
details |
logical value indicating whether specific details about the test should be returned. |
hyp |
logical value indicating whether the hypotheses should be returned. |
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.
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). |
Jarque, C.M. & Bera, A.K. (1980): Efficient Test for Normality, Homoscedasticity and Serial Independence of Residuals. Economics Letters 6 Issue 3, 255-259.
'jarque.test()' in Package 'moments'.
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.