zoukankan      html  css  js  c++  java
  • 数学之路-数据分析进阶-区间预计与如果检验(2)

    某商城须要针对某类商品建立该类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客户。这里使用二项分布检測

    某游戏公司对X游戏的某类虚拟道具进行了为期6周的促销測试。以添加其销量。採用了下面2个促销手段,请问这2个促销手段效果同样吗。如果效果同样。能够定期採用这2个促销手段,搞相似的促销活动。

    相对未促销前添加的销量

    促销手段

    第1周

    第2周

    第3周

    第4周

    第5周

    第6周

    A

    50

    60

    45

    62

    48

    59

    B

    39

    68

    58

    64

    52

    61

       > a<-c(50,60,45,62,48,59)

    >b<-c(39,68,58,64,52,61)

    >binom.test(sum(a>b),length(a))

     

            Exact binomial test

     

    data:  sum(a > b) and length(a)

    number ofsuccesses = 1, number of trials = 6, p-value = 0.2188

    alternativehypothesis: true probability of success is not equal to 0.5

    95 percentconfidence interval:

     0.004210745 0.641234579

    sampleestimates:

    probability ofsuccess

                 0.1666667

     

    p值为0.1666667,大于0.05,不能拒绝原如果,原如果是促销手段A下的添加销量(a)> 促销手段A下的添加销量(b)的数量有明显差距。


  • 相关阅读:
    Xdebug
    单点登录
    一个Https网站发送Http的 ajax请求的解决方法
    js关闭微信浏览器页面
    标准的身份证验证(第18位校验码)
    Redis 更新(set) key值 会重置过期时间问题
    PHP 报错:Deprecated: Methods with the same name as their class will not be constructor...
    php防sql注入
    web开发原则
    fopen()函数
  • 原文地址:https://www.cnblogs.com/slgkaifa/p/7394710.html
Copyright © 2011-2022 走看看