Skip to content
Related Articles

Related Articles

Improve Article

statsmodels.omni_normtest() in Python

  • Last Updated : 22 Apr, 2020

With the help of statsmodels.omni_normtest() method, we can get the omnibus test for normality and we use chi^2 score for this statsmodels.omni_normtest() method.

Syntax : statsmodels.omni_normtest(array)
Return : Return the omnibus test for normality.

Example #1 :
In this example we can see that by using statsmodels.omni_normtest() method, we are able to calculate the omnibus test for normality by using chi^2 score in this method.




# import numpy and statsmodels
import numpy as np
from statsmodels.stats.stattools import omni_normtest
   
g = np.array([1, 2, 3, 4, 5, 6, 7, 8])
# Using statsmodels.omni_normtest() method
gfg = omni_normtest(g)
   
print(gfg)

Output :

NormaltestResult(statistic=1.7004056883060088, pvalue=0.42732824212143383)



Example #2 :




# import numpy and statsmodels
import numpy as np
from statsmodels.stats.stattools import omni_normtest
   
g = np.array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
# Using statsmodels.omni_normtest() method
gfg = omni_normtest(g)
   
print(gfg)

Output :

NormaltestResult(statistic=2.02697581498966, pvalue=0.362950830342156)

 Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.  

To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course




My Personal Notes arrow_drop_up
Recommended Articles
Page :