|
|
本帖最后由 Menuett 于 2013-12-22 15:59 编辑 r& u. Q( @2 P9 @" E. j
煮酒正熟 发表于 2013-12-20 12:05 ![]()
: q3 g+ a, h; V基本可以说是显著的。总的来说,在商界做统计学分析,95%信心水平是用得最多的,当95%上不显著时,都会去 ...
5 |' ^& f2 H3 g- X4 G% F7 U3 l1 a7 O9 Y0 J
这个其实是一种binomial response,应该用Contigency Table或者Logisitic Regression(In case there are cofactors)来做。只记比率丢弃了Number of trial的信息(6841和1217个客户)。
* b# }6 H$ g- L% q+ E4 s. y% C
7 E, L6 e1 e5 y+ v: L7 Y结果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)
' @- r2 @, c! @9 _6 x! l( s
* t) ~; c3 n2 n! o9 g4 |7 f, eR example:3 p* {2 p5 R. K7 V. D. d
N6 Z" j0 l2 G% A! Q
> M<-as.table(rbind(c(1668,5173),c(287,930)))
0 a8 K! M% r' ^) R> chisq.test(M)! F$ ^0 g4 x2 c0 }
" [9 P+ }4 X0 N
Pearson's Chi-squared test with Yates' continuity correction
# K# x& s7 G" n; S; Y/ U4 N! k7 m0 g% m. o& N8 j
data: M
) q: w$ t3 G) Q: J) j" T, ~X-squared = 0.3175, df = 1, p-value = 0.5731
6 z6 M5 E- Z; C& E& G
9 n( L M$ h0 B) F7 GPython example:0 X$ [: |1 Q3 c8 @7 a
4 v3 C5 n+ x- {# \8 J
>>> from scipy import stats
# M" P% n- }: X. m>>> stats.chi2_contingency([[6841-5173,5173],[1217-930,930]])
8 ?" F' `; E: J/ D(0.31748297614660292, 0.57312422493552839, 1, array([[ 1659.73628692, 5181.26371308],
3 E8 C$ \% v- S [ 295.26371308, 921.73628692]])) |
|