What is Jarque Bera test How to perform it in R

This recipe explains what is Jarque Bera test This recipe helps you perform it in R

Recipe Objective

What is Jarque Bera test? How to perform it in R?

Jarque Bera is a test for normality. It is used for determining whether a given dataset has skewness and kurtosis that matches normality. Jarque Bera is formulated as follows: **[(n-k+1) / 6] * [S2 + (0.25*(C-3) 2)]** where, n = number of observations in a sample k = number of regressors S = skewness of the sample. C = kurtosis of the sample The null hypothesis for this test to check normality is given as: **JB ~ X2 (2)** This recipe demonstrates an example of Jarque Bera test in R.

Step 1 - Install the required packages

install.packages('tseries') library(tseries)

Step 2 - Generate random normal data

# generate a list of 50 normally distributed random variables data <- rnorm(70)

Step 3 - Jarque bera test

jarque.bera.test(data)

The above result states that the test statistics are 0.27889 with a p value of 0.8698. Thus, we conclude that we fail to reject the null hypothesis of the data being normally distributed. Hence, the data of 70 normal data points follows normality.

Step 4 - Generate random uniform data

# generate a list of 50 uniformly distributed random variables data <- runif(50)

Step 5 - Jarque bera test

jarque.bera.test(data)

The above result states that the test statistics are 3.0705 with a p value of 0.2154. Thus, we conclude that we will reject the null hypothesis of the data being normally distributed. Hence, the 50 uniform data points do not follow normality.

{"mode":"full","isActive":false}

What Users are saying..

profile image

Abhinav Agarwal

Graduate Student at Northwestern University
linkedin profile url

I come from Northwestern University, which is ranked 9th in the US. Although the high-quality academics at school taught me all the basics I needed, obtaining practical experience was a challenge.... Read More

Relevant Projects

Digit Recognition using CNN for MNIST Dataset in Python
In this deep learning project, you will build a convolutional neural network using MNIST dataset for handwritten digit recognition.

Time Series Classification Project for Elevator Failure Prediction
In this Time Series Project, you will predict the failure of elevators using IoT sensor data as a time series classification machine learning problem.

MLOps Project on GCP using Kubeflow for Model Deployment
MLOps using Kubeflow on GCP - Build and deploy a deep learning model on Google Cloud Platform using Kubeflow pipelines in Python

Build a Multi Touch Attribution Machine Learning Model in Python
Identifying the ROI on marketing campaigns is an essential KPI for any business. In this ML project, you will learn to build a Multi Touch Attribution Model in Python to identify the ROI of various marketing efforts and their impact on conversions or sales..

Build ARCH and GARCH Models in Time Series using Python
In this Project we will build an ARCH and a GARCH model using Python

BigMart Sales Prediction ML Project in Python
The goal of the BigMart Sales Prediction ML project is to build and evaluate different predictive models and determine the sales of each product at a store.

Machine Learning Project to Forecast Rossmann Store Sales
In this machine learning project you will work on creating a robust prediction model of Rossmann's daily sales using store, promotion, and competitor data.

Time Series Forecasting with LSTM Neural Network Python
Deep Learning Project- Learn to apply deep learning paradigm to forecast univariate time series data.

NLP Project on LDA Topic Modelling Python using RACE Dataset
Use the RACE dataset to extract a dominant topic from each document and perform LDA topic modeling in python.

Build a Similar Images Finder with Python, Keras, and Tensorflow
Build your own image similarity application using Python to search and find images of products that are similar to any given product. You will implement the K-Nearest Neighbor algorithm to find products with maximum similarity.