Skip to content

Data Science Tutorials

For Data Science Learners

  • Logistic Function in R R
  • KPSS test in R
    KPSS Test in R With Examples R
  • Mastering R Programming for Data Science: Tips and Tricks R
  • Hypothesis Testing in R Programming
    Hypothesis Testing in R Programming R
  • Normal distribution in R
    Normal Distribution in R R
  • droplevels in R with examples
    droplevels in R with examples R
  • Box Cox transformation in R
    Box Cox transformation in R R
  • Correlation By Group in R R
Jarque-Bera Test in R

Jarque-Bera Test in R With Examples

Posted on September 18September 14 By Admin No Comments on Jarque-Bera Test in R With Examples

Jarque-Bera Test in R, the Jarque-Bera test is a statistical test used to determine whether a given dataset is distributed normally or not.

It tests whether the skewness and kurtosis of the dataset are consistent with a normal distribution. In this article, we will demonstrate how to conduct a Jarque-Bera test in R with inbuilt datasets.

Formulation of the Hypothesis:

Before conducting the Jarque-Bera test, it is necessary to formulate the null and alternative hypotheses.

The null hypothesis (H0) assumes that the dataset is distributed normally. It is usually written as:

H0: The dataset is normally distributed.

The alternative hypothesis (H1) assumes that the dataset is not distributed normally. It can be either one-tailed or two-tailed and is usually written as:

H1: The dataset is not normally distributed.

In the following sections, we will provide examples of how to conduct a Jarque-Bera test in R.

What is the bias variance tradeoff? » Data Science Tutorials

Example 1: Testing Distribution of Inbuilt Dataset – ‘mtcars’

In this example, we will use the inbuilt mtcars dataset to test whether the dataset is normally distributed.

First, we will load the mtcars dataset:

data(mtcars)

Next, we can extract a specific variable from the dataset:

mpg <- mtcars$mpg
library(tseries)

Then, we can conduct the Jarque-Bera test using the ‘jarque.test’ function:

jb_test <- jarque.bera.test(mpg)
Jarque Bera Test

data:  mpg
X-squared = 2.2412, df = 2, p-value = 0.3261

The output will display the test statistic, the p-value, and a conclusion based on the test results.

In this case, because the p-value is greater than 0.05, we fail to reject the null hypothesis and conclude that the mpg variable of mtcars dataset is normally distributed.

Example 2: Testing Distribution of Inbuilt Dataset – ‘iris’

In this example, we will use the inbuilt iris dataset to test whether the dataset is normally distributed.

First, we will load the iris dataset:

data(iris)

Next, we can extract a specific variable from the dataset:

petal_width <- iris$Petal.Width

Then, we can conduct the Jarque-Bera test using the ‘jarque.test’ function:

jarque.bera.test(petal_width)
Jarque Bera Test

data:  petal_width
X-squared = 11.416, df = 2, p-value = 0.003318

The output will display the test statistic, the p-value, and a conclusion based on the test results.

In this case, because the p-value is less than 0.05, we reject the null hypothesis and conclude that the Petal.Width of iris dataset is not normally distributed.

Conclusion:

In this article, we have demonstrated how to conduct a Jarque-Bera test in R using inbuilt datasets.

The Jarque-Bera test is a statistical test used to determine whether a given dataset is distributed normally or not.

By utilizing the examples provided in this article, researchers can use the Jarque-Bera test to test hypotheses related to the distribution of their datasets.

Data Visualization Analyst »

R

Post navigation

Previous Post: Fisher’s exact test in R
Next Post: Anderson-Darling Test in R With Examples

Related Posts

  • Mastering R Programming for Data Science: Tips and Tricks R
  • Descriptive Statistics in R R
  • Fisher’s exact test in R
    Fisher’s exact test in R R
  • Difference between R and Python
    Difference between R and Python R
  • What is the best way to filter by row number in R?
    What is the best way to filter by row number in R? R
  • Number to Percentage in R
    Number to Percentage in R R

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

  • Best Prompt Engineering Books
  • Understanding Machine Learning and Data Science
  • Best Git Books
  • Top 5 Books to Learn Data Engineering
  • Mastering R Programming for Data Science: Tips and Tricks
  • About Us
  • Contact
  • Disclaimer
  • Privacy Policy

https://www.r-bloggers.com

  • YouTube
  • Twitter
  • Facebook
  • Course
  • Excel
  • Machine Learning
  • Opensesame
  • R
  • Statistics

Check your inbox or spam folder to confirm your subscription.

  • How to Scale Only Numeric Columns in R
    How to Scale Only Numeric Columns in R R
  • what-is-epoch-in-machine-learning
    What is Epoch in Machine Learning? Machine Learning
  • How to Avoid Overfitting
    How to Avoid Overfitting? Machine Learning
  • learn Hadoop for Data Science
    Learn Hadoop for Data Science Machine Learning
  • Top Data Modeling Tools for 2023
    Top Data Modeling Tools for 2023 Machine Learning
  • How to Change X-Axis Labels of Barplot In R
    How to Change X-Axis Labels of Barplot In R R
  • Correlation Coefficient p value in R
    Correlation Coefficient p value in R R
  • Positive or Negative in R R

Privacy Policy

Copyright © 2025 Data Science Tutorials.

Powered by PressBook News WordPress theme