|
本帖最后由 Menuett 于 2013-12-22 15:59 编辑
h7 [5 |3 ?; m( q! T煮酒正熟 发表于 2013-12-20 12:05 ![]()
$ S3 a- Q2 t8 F& `$ ~基本可以说是显著的。总的来说,在商界做统计学分析,95%信心水平是用得最多的,当95%上不显著时,都会去 ...
* f5 D1 ?% F7 T, c5 v2 C( U6 w- d% M8 U6 j3 @) U% q$ t* x: q
这个其实是一种binomial response,应该用Contigency Table或者Logisitic Regression(In case there are cofactors)来做。只记比率丢弃了Number of trial的信息(6841和1217个客户)。 9 S) f/ a& E. S
" l& i7 m+ }* L! W6 B. u
结果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)
# t _# c0 A L: e; @( t$ V) B
; _8 H! K) t. yR example:
; z8 }! e) Z' L0 O! \ [5 f3 H* c' }2 J
> M<-as.table(rbind(c(1668,5173),c(287,930)))8 X D9 b3 c% A& Y- E1 f9 {
> chisq.test(M)9 N5 q* T- y+ B; W) e$ ?* D7 r
1 Z) ^4 ^% k. K% e% D
Pearson's Chi-squared test with Yates' continuity correction) R5 G; ~5 `3 n* R0 F
% c2 J `7 f6 P
data: M I) V+ B% {' h
X-squared = 0.3175, df = 1, p-value = 0.5731
2 |4 O! G% R% B+ d& s
. ^0 A* D8 e# U0 iPython example:* X* W. ?% i- c" A
% J/ z% b4 n; P% v& e9 N
>>> from scipy import stats
8 x2 R/ @6 v& n; T1 g>>> stats.chi2_contingency([[6841-5173,5173],[1217-930,930]]), q$ f( W3 i2 e0 T: b3 c4 o: r4 q% S
(0.31748297614660292, 0.57312422493552839, 1, array([[ 1659.73628692, 5181.26371308],. h5 L6 s$ O/ c$ b
[ 295.26371308, 921.73628692]])) |
|