|
本帖最后由 Menuett 于 2013-12-22 15:59 编辑
' p t! o/ F7 ^5 b, _- {. @' P煮酒正熟 发表于 2013-12-20 12:05 $ ?# g' S& G: ~' \# m
基本可以说是显著的。总的来说,在商界做统计学分析,95%信心水平是用得最多的,当95%上不显著时,都会去 ...
7 U' c2 m) T X3 p- g' V3 C; k+ i* j$ c2 a
这个其实是一种binomial response,应该用Contigency Table或者Logisitic Regression(In case there are cofactors)来做。只记比率丢弃了Number of trial的信息(6841和1217个客户)。 % z( @3 b$ n* x6 d$ ?8 p) L
( d1 w9 \& A' r+ z# a" F$ T7 }' p8 `结果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)
( h1 p3 q c* R/ x& X
/ Y: W4 F) i' b) r( d* fR example:
$ L5 c0 b* U+ f! Y% M" }$ H2 b7 @
> M<-as.table(rbind(c(1668,5173),c(287,930)))
. [1 g' W2 [8 V+ P8 H2 U) B> chisq.test(M)
% k; o7 ^" d$ d* Z) {% B' s( o) T6 r3 _: f
Pearson's Chi-squared test with Yates' continuity correction q+ z: q% Y* l7 ` ?3 C
2 V$ p, H1 b7 x' ]9 edata: M, S4 \% h, x7 n
X-squared = 0.3175, df = 1, p-value = 0.5731
6 G) l7 B4 k) y$ u& e
5 G+ i1 Y+ n( S, `* O6 {Python example:! v2 q4 [0 o. H' m8 o8 }- b1 ?
4 m2 h* p1 p+ }7 q. s$ d>>> from scipy import stats
3 @& e0 R( ?+ |! l* `4 J/ O>>> stats.chi2_contingency([[6841-5173,5173],[1217-930,930]])/ T3 q! `6 Q* Y* H- {
(0.31748297614660292, 0.57312422493552839, 1, array([[ 1659.73628692, 5181.26371308],
- R& I6 W0 d4 h [ 295.26371308, 921.73628692]])) |
|