How to check goodness of fit in python from Chisquare function?

≯℡__Kan透↙ 提交于 2019-12-11 15:13:30

问题


I want to understand how chisquare fnction works. I also read about chisquare test in which we have to check chisquare table to compare values of chi or p value with critical values. In the following code my chisquare value is 3.5. Does it correspond to right tail or left tail? Secondly p value is 0.62. I have read that 0.05 is standard for right tails on the chi square distribution curve. If p value is grater than 0.05 we accept our proposed hypothesi i.e., f_exp. But what about the following case how can I judge that whether should I accept f-exp or reject it?

`from scipy.stats import chisquare
a =chisquare([16, 18, 16, 14, 12, 12], f_exp=[16, 16, 16, 16, 16, 8])
print(a)
(3.5, 0.62338762774958223)`

来源:https://stackoverflow.com/questions/56947157/how-to-check-goodness-of-fit-in-python-from-chisquare-function

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!