|
本帖最后由 Menuett 于 2013-12-22 15:59 编辑
7 q/ M; q O+ l0 a煮酒正熟 发表于 2013-12-20 12:05
# `5 h( C3 \, ?基本可以说是显著的。总的来说,在商界做统计学分析,95%信心水平是用得最多的,当95%上不显著时,都会去 ...
, I; ^9 f* w* N, d! y
; v1 D E8 {6 R0 H这个其实是一种binomial response,应该用Contigency Table或者Logisitic Regression(In case there are cofactors)来做。只记比率丢弃了Number of trial的信息(6841和1217个客户)。
+ y: Z) i# \# g! Q7 s9 N V7 K* P2 b- c' a* K2 ?% |& _( t
结果p=0.5731。 远远不显著。要在alpha level 0.05的水平上检验出76.42%和75.62%的区别,即使实验组和对照组各自样本大小相同,各自尚需44735个样本(At power level 80%)。see: Statistical Methods for Rates and Proportions by Joseph L. Fleiss (1981)
( [" r6 g- M, O- z. n; d" v! |& S
R example:
$ L0 G8 H& i! e6 y* s ^9 ~1 x: n% U# ^' A% Q H% h
> M<-as.table(rbind(c(1668,5173),c(287,930)))
0 E6 Y& S. t. n+ J> chisq.test(M)$ H. E+ @& |$ y$ a4 X
% n& `7 L {9 S/ b4 s3 I& _ Pearson's Chi-squared test with Yates' continuity correction' }6 W" S( G% I% S/ {5 V
: ?+ Y c0 e# k" Z C8 L! u, |data: M
, E. E4 _, T- y% i0 z+ s6 AX-squared = 0.3175, df = 1, p-value = 0.5731
' ]+ O) Z& w: `8 B5 ~* v; V' N% j; ~8 N2 c2 ^9 B1 x: p* ?
Python example:
! P0 z* v9 y0 A, [$ T% v4 k7 t( [! l' s$ y6 |8 K9 b
>>> from scipy import stats% N+ _; f/ l; k
>>> stats.chi2_contingency([[6841-5173,5173],[1217-930,930]])
4 [, O% W! a2 b. | o# @' a8 D1 N(0.31748297614660292, 0.57312422493552839, 1, array([[ 1659.73628692, 5181.26371308],
: F3 L* ]: u" v+ W% ^/ X4 d8 d m [ 295.26371308, 921.73628692]])) |
|