|
|
本帖最后由 Menuett 于 2013-12-22 15:59 编辑
# L, z$ B4 S6 V5 Q. J& S" ?煮酒正熟 发表于 2013-12-20 12:05 ![]()
; s& }2 m, V& a: L* c4 l" q基本可以说是显著的。总的来说,在商界做统计学分析,95%信心水平是用得最多的,当95%上不显著时,都会去 ...
2 n# G; k7 I# h9 H5 g$ q
7 N4 Q5 m5 f! ]2 Q2 F P( ~& y" C这个其实是一种binomial response,应该用Contigency Table或者Logisitic Regression(In case there are cofactors)来做。只记比率丢弃了Number of trial的信息(6841和1217个客户)。
: K5 L8 w2 G" p5 i
7 a$ e) \: _' n/ I4 [结果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)5 `3 }. |, f6 g. i! G- q8 b
6 C' m4 F9 X: H3 W
R example:
7 |! j1 N" _; ]; Q/ t9 ~1 ~6 c) J% u! b) j4 ~+ r! g% s
> M<-as.table(rbind(c(1668,5173),c(287,930)))# {6 f( r; T# }, W6 Y2 V
> chisq.test(M)
/ l4 D! H$ S) E( F( M* f7 S- [: L/ v
Pearson's Chi-squared test with Yates' continuity correction: i4 P' u/ J1 I1 w8 j, ]4 t
$ l: {4 I, Q3 ?0 ~
data: M
- C! M3 X9 V. p5 _* |$ f( gX-squared = 0.3175, df = 1, p-value = 0.5731
" e- ?$ Z1 Q7 E1 d- [" K$ [+ S1 X6 e% _. @, E
Python example:
6 g' f# C! i( @8 b# u: t# V- c
% i$ f% u# U, V! I>>> from scipy import stats! c, W" Q f; I6 v, P0 ]% r
>>> stats.chi2_contingency([[6841-5173,5173],[1217-930,930]])9 ~' C& \5 }. _
(0.31748297614660292, 0.57312422493552839, 1, array([[ 1659.73628692, 5181.26371308],! Y J$ r: e( I; w S0 U
[ 295.26371308, 921.73628692]])) |
|