|
|
本帖最后由 Menuett 于 2013-12-22 15:59 编辑
7 y. D1 J. G* e+ l# z: q' s煮酒正熟 发表于 2013-12-20 12:05 2 D3 i8 y& V, Z$ j9 f9 i
基本可以说是显著的。总的来说,在商界做统计学分析,95%信心水平是用得最多的,当95%上不显著时,都会去 ... 8 M4 g; V# X% T6 [' Z+ f
* R9 r* n2 ]& `2 p% F M
这个其实是一种binomial response,应该用Contigency Table或者Logisitic Regression(In case there are cofactors)来做。只记比率丢弃了Number of trial的信息(6841和1217个客户)。
* X2 t: k- P: i1 c8 b! }. U: n I
& ~" i' U6 U( k, J) ~8 |4 h; s2 d结果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)
+ D) Q& [/ S! [7 b6 \2 C4 ^2 Y* F% b
R example:8 h( ^8 J' p5 l6 y
# r- z1 p0 y' `% D) C6 K> M<-as.table(rbind(c(1668,5173),c(287,930)))
1 P2 D$ w& ^0 F& [( Z0 E( E) I> chisq.test(M)( G/ u g2 ~) c6 Y
1 J S( g. [' n. r$ f Pearson's Chi-squared test with Yates' continuity correction4 G; }7 S0 d# [3 @& A
~9 [6 a5 p5 M& ]6 h+ F/ w$ Z- ]data: M
, S6 x+ _* Z! d$ i+ h5 ]2 @X-squared = 0.3175, df = 1, p-value = 0.5731
" H$ r3 }( ]& `0 D% F7 h" o4 q( i W. Y/ \4 N+ h- x
Python example:
! D2 M. D8 s# e
V2 F# O! b8 i1 H$ U2 w>>> from scipy import stats
, D3 c4 _2 B4 u9 r6 n2 J/ t>>> stats.chi2_contingency([[6841-5173,5173],[1217-930,930]])
" H! _, {; c8 Q9 i6 K! _7 i(0.31748297614660292, 0.57312422493552839, 1, array([[ 1659.73628692, 5181.26371308],
& a' T4 ]' A3 _! z [ 295.26371308, 921.73628692]])) |
|