|
本帖最后由 Menuett 于 2013-12-22 15:59 编辑 4 R! L7 }) \/ D( |/ ?" H7 ]
煮酒正熟 发表于 2013-12-20 12:05 # x8 `* @8 y7 _6 U
基本可以说是显著的。总的来说,在商界做统计学分析,95%信心水平是用得最多的,当95%上不显著时,都会去 ...
$ \( _* ^! X- @* n t, n; j$ ?* Y6 g* l& _9 R
这个其实是一种binomial response,应该用Contigency Table或者Logisitic Regression(In case there are cofactors)来做。只记比率丢弃了Number of trial的信息(6841和1217个客户)。 6 ?# {( Z" L( E7 g0 \
# y5 K: k" L* r+ P7 f结果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)
! C5 Y0 [0 W$ q& S
3 f6 t$ ?6 ^+ E/ h+ _ ]R example:. N, h/ {9 ?. M5 o u: d
9 [. c, |: T, \ M' c> M<-as.table(rbind(c(1668,5173),c(287,930)))
) [/ n" T8 v; h! H8 E. H7 w> chisq.test(M)- j7 X* P0 m2 _: U# s4 J/ C- @1 h
T4 H* M3 }1 m. R: D) P
Pearson's Chi-squared test with Yates' continuity correction
0 {( m+ R( ?0 |# _$ d7 L% }4 A. a6 @+ E8 }3 s- o- R
data: M/ I/ `9 ?0 Z0 Y' [6 Q' E* u# [
X-squared = 0.3175, df = 1, p-value = 0.5731 y6 L+ i+ w4 ]" }# n5 X
$ T \ U2 F6 c5 a, n/ f$ V& ?. BPython example:5 D* H) h* R# b8 a r5 h* z% ]
! c( f' M% n+ W>>> from scipy import stats! \* u9 Q2 w6 T9 [% e- e
>>> stats.chi2_contingency([[6841-5173,5173],[1217-930,930]])
4 w9 _" q. q; P$ U/ d7 V(0.31748297614660292, 0.57312422493552839, 1, array([[ 1659.73628692, 5181.26371308],) x$ p2 K4 {/ L/ B
[ 295.26371308, 921.73628692]])) |
|