|
|
本帖最后由 Menuett 于 2013-12-22 15:59 编辑 ) n% W. F% \: ~
煮酒正熟 发表于 2013-12-20 12:05 " d3 p" w% Y! a# d4 {
基本可以说是显著的。总的来说,在商界做统计学分析,95%信心水平是用得最多的,当95%上不显著时,都会去 ...
9 ]$ w. x% e w4 Q- m! S2 X# m& O0 B7 Q# q
这个其实是一种binomial response,应该用Contigency Table或者Logisitic Regression(In case there are cofactors)来做。只记比率丢弃了Number of trial的信息(6841和1217个客户)。
) s9 c/ f3 @7 ~1 Y2 ~$ u
4 H" v6 j' R( h结果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); q7 y* b" [* a
) l" I6 q; }+ o. g; J8 ]R example:
2 T6 h& a8 y8 l/ h4 X$ g( N% ?
3 y) l0 h) }3 W2 F' ]> M<-as.table(rbind(c(1668,5173),c(287,930)))
. g e$ `. x* x* Y' g* A6 I$ I> chisq.test(M)
( c" [" Q4 _: c- \3 K
+ u; K! g# _/ A( H! N Pearson's Chi-squared test with Yates' continuity correction
5 Y1 E$ s/ e, l* K8 M% W' D" _6 \: P8 d8 {& r
data: M. s3 d6 C$ x! l: Y% a6 b0 c& r
X-squared = 0.3175, df = 1, p-value = 0.5731' b$ T" X9 |" s7 n% ?$ e
3 Z) N# A5 X$ A5 q& Y
Python example:
2 X- z4 p5 j6 n- F- [" G1 E8 u) ?6 @
>>> from scipy import stats s7 Q I) {- d: C- N( n! C
>>> stats.chi2_contingency([[6841-5173,5173],[1217-930,930]])
. x- \4 ]; y' d5 `(0.31748297614660292, 0.57312422493552839, 1, array([[ 1659.73628692, 5181.26371308],2 w6 L& `) ~2 f4 l0 Q( i
[ 295.26371308, 921.73628692]])) |
|