俺的学习笔记

Sunday, December 2, 2018

2 proportion test

比如,按照某一流程生产10,000个零件,有100个不合格,即失败率是0.01,成功率0.99。
经过三个月的改进,这次生产力8,000个零件,有72个不合格,即失败率变成0.009,成功率为0.991。
那么,经过这次的改进,有没有效果呢?
p1=0.99,p2=0.009
用统计学的观点就是检验如下假设:
H0:p1=p2,H1:p1≠p2 (two trail)
H0:p1≥p2,H1:p1<p2 (less)
H0:p1≤p2,H1:p1>p2 (greater)
具体的计算方法就不用学了,R里面有相应的函数。
参见这里
上面这个改进,用R来分析的话,如下:
> prop.test(x = c(8000-72, 10000-100), n = c(8000, 10000),alternative = "greater")

  2-sample test for equality of proportions with
  continuity correction

data: c(8000 - 72, 10000 - 100) out of c(8000, 10000)
X-squared = 0.36989, df = 1, p-value = 0.2715
alternative hypothesis: greater
95 percent confidence interval:
-0.001498884 1.000000000
sample estimates:
prop 1 prop 2
0.991 0.990
p-value = 0.2715,大于0.05,所以改进没有效果。

同样的问题,如果经过改进,8,000个零件里只有55个不合格,即失败率变成0.006875。那么再做同样的分析:
> prop.test(x = c(8000-55, 10000-100), n = c(8000, 10000),alternative = "greater")

  2-sample test for equality of proportions with
  continuity correction

data: c(8000 - 55, 10000 - 100) out of c(8000, 10000)
X-squared = 4.7246, df = 1, p-value = 0.01487
alternative hypothesis: greater
95 percent confidence interval:
0.0007792111 1.0000000000
sample estimates:
prop 1 prop 2
0.993125 0.990000
p-value = 0.01487,小于0.05所以改进有统计学意义。

Labels: , ,

0 Comments:

Post a Comment

<< Home