|
|
本帖最后由 Menuett 于 2013-12-22 15:59 编辑
6 @, k; D2 d6 d4 g$ D% @煮酒正熟 发表于 2013-12-20 12:05 ![]()
# Y! `) r+ P. a1 _( [+ [3 u& {基本可以说是显著的。总的来说,在商界做统计学分析,95%信心水平是用得最多的,当95%上不显著时,都会去 ... 0 D2 k1 P. y! l& } h0 B, R. E; I
, ^% j( A+ J0 A8 `7 m
这个其实是一种binomial response,应该用Contigency Table或者Logisitic Regression(In case there are cofactors)来做。只记比率丢弃了Number of trial的信息(6841和1217个客户)。
% O9 T8 d" f) I& i
2 z4 L1 W( V7 c3 O! c( m' ~1 [结果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)0 Q( {0 t6 ~: c' U: K
& T2 g* k" [) u& D0 f7 g
R example:. z: \0 w4 X7 W1 ~' M
! c* K+ B% ?3 J9 {; F: J& @8 q Q1 D. l> M<-as.table(rbind(c(1668,5173),c(287,930)))& }) h4 R" ~5 Q: |; z7 H: w
> chisq.test(M)) {; o2 _4 p5 v* ^" ]; B- W4 s! ?8 l
* l4 x9 p" q. B8 y) a/ K* ]) k0 @
Pearson's Chi-squared test with Yates' continuity correction0 P" {( h9 \2 H( @: l
7 Y; _1 s }* B* t& ] z
data: M: x( X) q _" c# z- C
X-squared = 0.3175, df = 1, p-value = 0.5731+ v* \+ K/ }5 S* l3 b
1 ]" K, n& |4 }2 o! \
Python example:
+ G6 ?9 S( e% g. o
3 |/ F3 C \7 |( a5 f>>> from scipy import stats6 [' Y7 _' Y, Y: ~, Q6 e
>>> stats.chi2_contingency([[6841-5173,5173],[1217-930,930]])) a& h; ~) Z& C9 l7 ~, q0 M% f
(0.31748297614660292, 0.57312422493552839, 1, array([[ 1659.73628692, 5181.26371308],
9 M, S9 b, p, o5 D. x& v6 z2 e [ 295.26371308, 921.73628692]])) |
|