|
本帖最后由 Menuett 于 2013-12-22 15:59 编辑 7 a) t2 \: Q( r5 \
煮酒正熟 发表于 2013-12-20 12:05 : H1 Q$ A! F* T% H9 Y9 @3 h
基本可以说是显著的。总的来说,在商界做统计学分析,95%信心水平是用得最多的,当95%上不显著时,都会去 ... " M, d3 K: G+ M& n
+ c! n2 R4 W4 K4 z! a1 ?$ T这个其实是一种binomial response,应该用Contigency Table或者Logisitic Regression(In case there are cofactors)来做。只记比率丢弃了Number of trial的信息(6841和1217个客户)。 % l$ z2 z! L6 v8 f& L
6 A6 V& e# c9 p- ^
结果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 O4 L7 p, Q7 p+ ^& X8 K
k1 z" `8 @% H- k( b9 }% ?) ]R example:1 C: ~( P8 F1 _4 \1 a
3 X" k/ y7 S O0 e5 @* }. D! X. G> M<-as.table(rbind(c(1668,5173),c(287,930)))
" W7 G: A6 D$ u3 c$ n> chisq.test(M)2 J; w! |- \& \% t' k
/ i- _$ N( u" G* F0 I) Q9 d
Pearson's Chi-squared test with Yates' continuity correction
( N+ y) Y- E9 n/ X4 `9 R5 ^
0 a' `" v Q0 N' wdata: M5 m( R4 E3 i7 ?- ]- H2 c7 O0 t4 c
X-squared = 0.3175, df = 1, p-value = 0.5731
+ r7 k, G. I1 u3 ~1 Y
4 p, ~8 E# P5 D) UPython example:* A6 u1 t5 y1 S
5 K5 y$ \# d2 G( [0 Q! G; y) S; ]5 P>>> from scipy import stats
1 W8 \ r9 i5 [) q>>> stats.chi2_contingency([[6841-5173,5173],[1217-930,930]])- v5 B8 l+ k' l, F
(0.31748297614660292, 0.57312422493552839, 1, array([[ 1659.73628692, 5181.26371308],: ?* H X* [0 ~. P+ K6 q: h9 B! J
[ 295.26371308, 921.73628692]])) |
|