|
|
本帖最后由 Menuett 于 2013-12-22 15:59 编辑
8 D' n( T. y! w6 V煮酒正熟 发表于 2013-12-20 12:05 ![]()
7 K, h. c7 q# b& u+ A- S基本可以说是显著的。总的来说,在商界做统计学分析,95%信心水平是用得最多的,当95%上不显著时,都会去 ...
% \; ?1 j" V, T5 R
x" l G7 T" `4 H& n/ C这个其实是一种binomial response,应该用Contigency Table或者Logisitic Regression(In case there are cofactors)来做。只记比率丢弃了Number of trial的信息(6841和1217个客户)。
8 ?, v0 n5 q; |) {- t# \* v0 x s9 I
结果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)& c* D" Q0 M2 ~: i
; U# _8 Q, ]$ }0 e" ^& r D
R example:
7 u$ `9 R& A0 D1 b
8 S6 D$ C! i) M$ i> M<-as.table(rbind(c(1668,5173),c(287,930))). \; u" w5 l E! ?; b g6 L
> chisq.test(M)# G7 f) `! {' t1 c* ~
# g7 s$ a: E6 r2 B* }5 | Pearson's Chi-squared test with Yates' continuity correction* ~- c5 y9 w F$ D# f
+ h# t, d2 w* e- a: t9 F4 F
data: M/ M4 U- g4 `. n6 |6 d
X-squared = 0.3175, df = 1, p-value = 0.5731
( V) K+ `. A7 Y; A: c% H: ?2 c4 X' x
Python example:
0 l( b5 M3 D9 z S/ z
1 ?; V* z3 u* m$ j8 t>>> from scipy import stats; g% n- N. c% ?6 i3 `0 ^7 J
>>> stats.chi2_contingency([[6841-5173,5173],[1217-930,930]])2 S: p; B1 l; y- |( q: }/ X/ K
(0.31748297614660292, 0.57312422493552839, 1, array([[ 1659.73628692, 5181.26371308],
3 E J5 Z; x% G, ?" M. L [ 295.26371308, 921.73628692]])) |
|