Table of Contents
Understanding the Jarque-Bera Test
The Jarque-Bera test (JB test) is a crucial goodness-of-fit test widely employed in statistics and econometrics. Its fundamental purpose is to ascertain whether sample data exhibits the same level of skewness and kurtosis that would be expected from a theoretical normal distribution. This comparison is vital because many advanced statistical models and inferential tests rely heavily on the assumption that the underlying data follows a normal distribution, making the JB test an essential diagnostic tool before proceeding with analysis.
The core principle behind the test is rooted in the properties of the normal distribution: a perfectly normal data set possesses a skewness of zero and a kurtosis (specifically, excess kurtosis) of zero, or an absolute kurtosis of three. The JB test quantifies the extent to which the sample’s observed skewness and kurtosis deviate from these ideal values. The resulting test statistic, which is always a positive number, increases significantly as the data departs further from the expected normal parameters. Consequently, if the calculated test statistic is far from zero, it strongly indicates that the sample data does not originate from a normal distribution.
The Mathematical Foundation of JB
The calculation of the Jarque-Bera test statistic, denoted as JB, is derived directly from the standardized sample moments. It is constructed to combine the squared sample skewness (S²) and the squared deviation of sample kurtosis (C) from the expected normal value of 3. This precise formulation ensures that larger deviations in either the symmetry (skewness) or the peakedness/tailedness (kurtosis) contribute significantly to a higher overall test statistic value.
JB = [(n-k+1) / 6] * [S2 + (0.25*(C-3)2)]
In this widely accepted formula, n represents the total number of observations within the sample being tested. The variable k accounts for the number of regressors used if the test is applied within the context of regression analysis; however, when testing raw, independent data for normality, k is conventionally set to 1. Crucially, S represents the calculated sample skewness, and C denotes the sample kurtosis. Under the premise of the null hypothesis (H₀: The data is normally distributed), the distribution of the JB statistic asymptotically follows a Chi-squared distribution with two degrees of freedom, formally written as JB ~ X2(2).
Implementing the Jarque-Bera Test in R
To efficiently conduct the Jarque-Bera test within the R statistical environment, researchers typically utilize the specialized functions provided by the tseries package. This package is specifically designed for time series analysis but includes the necessary tools for calculating the JB statistic and its corresponding p-value for general datasets. The following tutorial demonstrates the required steps, starting with ensuring the necessary package is installed and then proceeding to the data generation and testing phases.
The procedure involves three key steps: first, checking for and loading the tseries package; second, generating or loading the sample dataset; and finally, executing the jarque.bera.test() function on the data object. We will first examine a dataset that adheres to the assumption of normality to establish a baseline for interpretation.
#install (if not already installed) and load tseries package if(!require(tseries)){install.packages('tseries')} #generate a list of 100 normally distributed random variables dataset <- rnorm(100) #conduct Jarque-Bera test jarque.bera.test(dataset)
Case Study 1: Testing Normally Distributed Data
For our initial practical demonstration, we have intentionally generated a dataset of 100 random variables that strictly follow a normal distribution. This controlled sample serves as an ideal scenario to confirm that the Jarque-Bera test correctly validates the normality assumption when it is true. The test should produce a low test statistic and a high p-value, indicating that we should retain the null hypothesis.
Running the jarque.bera.test() function on this simulated normal sample yields the following critical output, providing the necessary statistical metrics for decision-making:

The results show a test statistic of 0.67446 and a corresponding p-value of 0.7137. Given that the p-value (0.7137) is significantly greater than the standard significance level (α = 0.05), we must fail to reject the null hypothesis. The conclusion is clear: there is insufficient statistical evidence to suggest that this data deviates from a normal distribution. This outcome is expected and confirms the reliability of the test, as the dataset was generated specifically from a normal population.
Case Study 2: Analyzing Uniformly Distributed Data
To illustrate the power and sensitivity of the Jarque-Bera test when its core assumptions are violated, we shift our focus to a non-normal distribution. In this second case study, we generate a dataset of 100 random variables that adhere to a uniform distribution. A uniform distribution possesses characteristics—specifically its kurtosis—that are distinct from those of a normal distribution. We therefore anticipate that the test will successfully detect this non-normality and lead to the rejection of the null hypothesis.
The R implementation is modified only in the data generation step, replacing the normal random variable function (rnorm) with the uniform random variable function (runif):
#install (if not already installed) and load tseries package if(!require(tseries)){install.packages('tseries')} #generate a list of 100 uniformly distributed random variables dataset <- runif(100) #conduct Jarque-Bera test jarque.bera.test(dataset)
Interpreting the Results
The execution of the Jarque-Bera test on the uniformly distributed data yields a result that contrasts sharply with the findings of the first case study. The following output clearly demonstrates how the test statistic reacts to data that lacks the characteristics of a normal distribution:

In this second scenario, the test statistic is calculated as 8.0807, representing a substantial increase compared to the previous result (0.67446). More importantly, the corresponding p-value is 0.01759. Since this p-value is less than the conventional significance threshold of 0.05, we have statistically sufficient grounds to reject the null hypothesis of normality. We confidently conclude that the data in this example is not normally distributed, aligning with the fact that the sample originated from a uniform distribution.
This decisive outcome reinforces the utility of the Jarque-Bera test as a powerful statistical tool. Because the underlying data followed a uniform distribution—which is inherently non-normal—the rejection of the normality assumption was the statistically expected result. This confirms the test’s robustness in identifying deviations from the distributional assumptions required for many advanced parametric analyses.
Cite this article
Mohammed looti (2025). Conduct a Jarque-Bera Test in R. PSYCHOLOGICAL STATISTICS. Retrieved from https://statistics.arabpsychology.com/conduct-a-jarque-bera-test-in-r/
Mohammed looti. "Conduct a Jarque-Bera Test in R." PSYCHOLOGICAL STATISTICS, 9 Nov. 2025, https://statistics.arabpsychology.com/conduct-a-jarque-bera-test-in-r/.
Mohammed looti. "Conduct a Jarque-Bera Test in R." PSYCHOLOGICAL STATISTICS, 2025. https://statistics.arabpsychology.com/conduct-a-jarque-bera-test-in-r/.
Mohammed looti (2025) 'Conduct a Jarque-Bera Test in R', PSYCHOLOGICAL STATISTICS. Available at: https://statistics.arabpsychology.com/conduct-a-jarque-bera-test-in-r/.
[1] Mohammed looti, "Conduct a Jarque-Bera Test in R," PSYCHOLOGICAL STATISTICS, vol. X, no. Y, ص Z-Z, November, 2025.
Mohammed looti. Conduct a Jarque-Bera Test in R. PSYCHOLOGICAL STATISTICS. 2025;vol(issue):pages.