码迷,mamicode.com
首页 > 其他好文 > 详细

数学之路-数据分析进阶-区间估计与假设检验(2)

时间:2014-10-07 23:59:54      阅读:264      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   color   io   使用   ar   数据   sp   

某商城需要针对某类商品建立该类VIP大客户,定期向该客户推送相关广告,客户服务部门推荐了客户A,在数据库随机抽取了100个客户资料的前4个季度平均季消费数据(在这里用平均随机数模拟数据),客户A平均季消费为元,检测其是否消费处于中上水平(位于中位数以上)

> sample(200:50000,100)->sale

> sale

  [1]  8447 13987 8809 44437 22973 28093 30594 28060 21101 45155 36128 30129

 [13]   556 33977 9283 35094   903 32885 11639 1553329150 47368  4993  5376

 [25]  1869 15975 25120 33530 31767 41845 39623  3586 22671 16128 14814 24993

 [37] 45830 10349 43989 3565045179 35282 27204  5485 22990 21475 1453342852

 [49] 15986 28411 16683 1583227207 19062 10256 34549 46159 16315 43097 40038

 [61] 27758 14936 26161 1869425139 13208 26837 30171 13663 14082 46909 26498

 [73]  7830 35810 15183 41769  8880 47928 13387 33231 28978 39486  6309 19344

 [85] 12935 41976 13429 1629131159 33646  1742 48160 43169 40165 3891524941

 [97] 25181 30077 19475 26836

> binom.test(sum(sale>29900),length(sale),al="less")

 

        Exact binomial test

 

data:  sum(sale > 29900)and length(sale)

number of successes = 38, number of trials = 100, p-value = 0.01049

alternative hypothesis: true probability of success is less than 0.5

95 percent confidence interval:

 0.0000000 0.4667535

sample estimates:

probability of success

                  0.38

 

P值=0.01<0.05,拒绝原假设,

95 percent confidence interval:

 0.0000000 0.4667535

0.4667535低于0.5,拒绝原假设,

本博客所有内容是原创,如果转载请注明来源

http://blog.csdn.net/myhaspl/


该客户的消费金额高于该类商品的客户中间水平,处于中上层消费,可以考虑设为VIP客户。这里使用二项分布检测

数学之路-数据分析进阶-区间估计与假设检验(2)

标签:style   blog   http   color   io   使用   ar   数据   sp   

原文地址:http://blog.csdn.net/myhaspl/article/details/39860625

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!