|
本帖最后由 Menuett 于 2013-12-22 15:59 编辑
6 u4 m3 C8 ~1 z; @煮酒正熟 发表于 2013-12-20 12:05
0 g# J6 i: i1 M基本可以说是显著的。总的来说,在商界做统计学分析,95%信心水平是用得最多的,当95%上不显著时,都会去 ... # }" Z5 {2 M! q# ^
( _0 W: d7 j g+ Y- M( @0 {7 Y' z
这个其实是一种binomial response,应该用Contigency Table或者Logisitic Regression(In case there are cofactors)来做。只记比率丢弃了Number of trial的信息(6841和1217个客户)。 , G+ M" X i! }# t9 e
; O1 x% x( X0 p5 l3 I0 ]7 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)
+ d# R' _ s# P* p, N& R* M2 i( |) p |9 M/ R% J' _( v# z) V
R example:
9 o1 h( g- U9 |& E
* w+ [3 R) K9 ]! H> M<-as.table(rbind(c(1668,5173),c(287,930)))9 M! E: N* v6 I, O `8 ?
> chisq.test(M)
- B, ~$ Q! _* r7 E1 m3 i1 x% G: h# j F2 h' W4 \* u3 z
Pearson's Chi-squared test with Yates' continuity correction3 L3 S9 v. A, T: c
# ^; |- Z( H: k3 o: H1 B* h! c, g
data: M: G2 M G8 f. I" l) m6 `
X-squared = 0.3175, df = 1, p-value = 0.5731
7 ]* ]4 ]3 q/ X
7 f2 d; N, g! h' Q' z6 G2 jPython example:& t: t; @9 F" O
2 y- z/ |6 _. g; p' \6 c; J# M/ b>>> from scipy import stats+ ?2 ]9 A4 @5 X' N" J; @5 Q
>>> stats.chi2_contingency([[6841-5173,5173],[1217-930,930]])
" z% }7 x' F; f) j, m4 R3 t2 I(0.31748297614660292, 0.57312422493552839, 1, array([[ 1659.73628692, 5181.26371308],9 z5 T# C1 J6 i m
[ 295.26371308, 921.73628692]])) |
|