|
本帖最后由 Menuett 于 2013-12-22 15:59 编辑 / n1 H' {% [1 B, r5 H$ ~2 T" j
煮酒正熟 发表于 2013-12-20 12:05 : F& W- F! I0 a
基本可以说是显著的。总的来说,在商界做统计学分析,95%信心水平是用得最多的,当95%上不显著时,都会去 ...
% s: O. @2 g# @8 Y/ m1 L( U* \+ t' J8 N, n5 U. e
这个其实是一种binomial response,应该用Contigency Table或者Logisitic Regression(In case there are cofactors)来做。只记比率丢弃了Number of trial的信息(6841和1217个客户)。
. X' ?9 O5 M2 l0 A5 @6 K0 o+ V2 C2 @: Q/ s# b: E" K
结果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)8 u1 y& ~+ J* }5 [7 v& e
* Y6 d: p3 r2 N1 i( k8 D! yR example:
9 ^% q) n. R' k
9 J; e& D" e: g. Z% N( s> M<-as.table(rbind(c(1668,5173),c(287,930)))
. C0 Q& N; @, D( ]8 H$ j> chisq.test(M)
! x/ k$ G+ o6 j
4 f+ D, N2 T8 \% K3 t Pearson's Chi-squared test with Yates' continuity correction
3 |4 s/ L* g) e* O5 p2 b
4 L0 y5 \* A- y7 f4 g' e8 udata: M
# ]4 q/ Y* {2 q' v5 f( A oX-squared = 0.3175, df = 1, p-value = 0.5731" n& a# ]) b! m. d5 `$ f
3 e% O5 Q! L2 i+ Q: D. IPython example:6 y! [/ f5 R: w) b0 W; r* B
; O1 I' T9 s/ W4 L% E
>>> from scipy import stats
, \( G6 w' ~ d. O6 X>>> stats.chi2_contingency([[6841-5173,5173],[1217-930,930]])
) s6 o V) Z. o2 L1 C: E: h o) t(0.31748297614660292, 0.57312422493552839, 1, array([[ 1659.73628692, 5181.26371308],
+ w# q) C. [7 f" U! f8 I/ [1 ?# t [ 295.26371308, 921.73628692]])) |
|