|
本帖最后由 Menuett 于 2013-12-22 15:59 编辑
3 Q2 F) \% C; |1 M煮酒正熟 发表于 2013-12-20 12:05 ![]()
- |* N7 K# n! j% B" |基本可以说是显著的。总的来说,在商界做统计学分析,95%信心水平是用得最多的,当95%上不显著时,都会去 ... 8 @( U' {+ P1 Q8 |
+ E( o* j m0 |0 z3 v这个其实是一种binomial response,应该用Contigency Table或者Logisitic Regression(In case there are cofactors)来做。只记比率丢弃了Number of trial的信息(6841和1217个客户)。
7 q: j: r' `+ E# v8 z2 w9 m- L! {& d$ {6 K: b: [5 |" F, n1 J
结果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). g# `, D* M9 P4 l: B9 E3 d4 w, k
* o$ X$ w0 a4 `5 i. L! I- kR example:
6 R6 X$ m: x. f* j$ C; V- s$ u4 L5 Y
> M<-as.table(rbind(c(1668,5173),c(287,930)))8 W2 r$ F/ b8 e; M1 F
> chisq.test(M)
; x i1 u! Y% C: R3 y, _& |) ^: |4 P. ^$ d+ s `
Pearson's Chi-squared test with Yates' continuity correction$ ]) V8 a7 C+ e1 R! W
j1 [$ o @ H5 q
data: M0 `, y# O2 s ^
X-squared = 0.3175, df = 1, p-value = 0.57311 R0 \# V" I+ p- {: X
, Y( ^6 d2 g E2 ^& K8 P
Python example:# O3 ?- K% Z3 {3 Q2 t$ s1 }1 `
0 |8 k j! q6 X4 r6 ~4 i
>>> from scipy import stats
5 w8 ?8 t6 S: p5 `* y% X# ^>>> stats.chi2_contingency([[6841-5173,5173],[1217-930,930]])2 e; m6 |+ B$ \& N* M
(0.31748297614660292, 0.57312422493552839, 1, array([[ 1659.73628692, 5181.26371308],
! A2 ?$ R+ ]& N D [ 295.26371308, 921.73628692]])) |
|