为了账号安全,请及时绑定邮箱和手机立即绑定

Chi-Square 用途1

标签:
大数据

Data Science Day 4:

Chi-Square test application 1:

Test Goodness of a fit.

We use the goodness of a fit to test if the observed categorical data follows the hypothesized or expected distribution.

Example 1: P-value Interpretation

Suppose f_exp are the expected number of boys in grade 1 different classes. f_obs are the observed number of boys in grade 1. We want to see if f_obs is the same as the f_exp distribution.

H0(Null Hypotheses):the observation boy students distribution is consistent with the expected distribution.

We use the followingpythoncode to acquire the p-value:

Chisquare(f_obs=[18,15,5,8,4,3], f_exp=[10,5,7,18,10,11])

For this particular example, thep-value=6.02e-08, which is significantlysmaller than 0.05. So wereject H0,and conclude the observed boy students distribution is Differentfrom the Expected boy distributions.Note, in order to avoid biased result, we should have the observation numbers >5.

Example 2: Data visualization Interpretation

We will graph a Chi-square distribution with degree 5 and size 1000, and use Kernel Density Estimation to fit the graph. We can see this is a pretty good fit.

webp

webp


















To be continue.....



作者:乌然娅措
链接:https://www.jianshu.com/p/a352952a7899


点击查看更多内容
TA 点赞

若觉得本文不错,就分享一下吧!

0 评论

作者其他优质文章

正在加载中
  • 推荐
  • 评论
  • 收藏
  • 共同学习,写下你的评论
感谢您的支持,我会继续努力的~
扫码打赏,你说多少就多少
赞赏金额会直接到老师账户
支付方式
打开微信扫一扫,即可进行扫码打赏哦
今天注册有机会得

100积分直接送

付费专栏免费学

大额优惠券免费领

立即参与 放弃机会
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号

举报

0/150
提交
取消