|
本帖最后由 Menuett 于 2013-12-22 15:59 编辑
7 h# A, t* q" J" D) s煮酒正熟 发表于 2013-12-20 12:05 ![]()
1 Y9 t+ s* W) W h基本可以说是显著的。总的来说,在商界做统计学分析,95%信心水平是用得最多的,当95%上不显著时,都会去 ... 3 \: e# Q' G( F& d2 E
, j }- R, g9 r) _ t9 c1 _7 o这个其实是一种binomial response,应该用Contigency Table或者Logisitic Regression(In case there are cofactors)来做。只记比率丢弃了Number of trial的信息(6841和1217个客户)。
8 x5 _; M( N7 J* p, [ B7 k- q
) J: k9 l6 |3 f结果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)
5 _% m2 n0 d4 E- y! ]; P# v& u2 ~
( d; ?: {/ K) K: uR example:
2 Z# S; D# x& o
, g( K j7 ?, l/ T% d> M<-as.table(rbind(c(1668,5173),c(287,930)))6 M) H) N( ^) L' V! V _5 \
> chisq.test(M), a* X! ?; U3 I7 p
0 i5 [7 c7 `2 y) y/ m! q9 P
Pearson's Chi-squared test with Yates' continuity correction
; C' r+ |, `5 w$ o- L
1 o; ]) {2 \ Z/ tdata: M
( t5 ^( q8 W: U/ E- h4 h: ?4 AX-squared = 0.3175, df = 1, p-value = 0.5731
( B; n) c# l. ^) y& l Q* e
- U4 G: l, O- N7 ]+ @% kPython example: X$ w Y8 P6 Q5 q
% I' G1 K' ~+ t1 \>>> from scipy import stats4 e# \- | b, I8 |1 x
>>> stats.chi2_contingency([[6841-5173,5173],[1217-930,930]])+ u! l( s- N: E# V$ V! g) h, C1 h
(0.31748297614660292, 0.57312422493552839, 1, array([[ 1659.73628692, 5181.26371308],
- `" |* {3 ^4 t1 K7 O+ n [ 295.26371308, 921.73628692]])) |
|