|
|
本帖最后由 Menuett 于 2013-12-22 15:59 编辑
) _, `, \" v- z; T" ~6 {煮酒正熟 发表于 2013-12-20 12:05 ![]()
U8 a6 |7 E7 O基本可以说是显著的。总的来说,在商界做统计学分析,95%信心水平是用得最多的,当95%上不显著时,都会去 ...
5 h, Q: f* q. ?& @2 t+ A$ A: J7 E* T# q* [2 }6 B
这个其实是一种binomial response,应该用Contigency Table或者Logisitic Regression(In case there are cofactors)来做。只记比率丢弃了Number of trial的信息(6841和1217个客户)。 2 W7 t h x4 Y$ Q
8 i7 v& s9 G3 S4 r; ]; {
结果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)
8 S% c- s. O9 \& [+ E F" u& I: y# S. }
R example:
9 v; D7 y8 f( p% U. Q/ Y
2 `0 Q, V' e7 N- q1 a# _> M<-as.table(rbind(c(1668,5173),c(287,930)))
: U: D0 g) L* T; A. J> chisq.test(M)
4 [5 ?0 X* A/ O5 @. t
! b1 f+ N, H. n8 ~( i Pearson's Chi-squared test with Yates' continuity correction
. H* z) Q+ _" P7 q/ h6 J8 f3 f
0 a. ^) a6 I. W, ydata: M/ L9 l( n& ?; h
X-squared = 0.3175, df = 1, p-value = 0.5731
2 y6 R/ o1 E3 V; a3 j) _. F1 @1 G! c
Python example:
+ Z" p8 L# Q, j# p
* M" _8 c4 l/ U( W>>> from scipy import stats
- Y" K. L @5 p; F. A: b>>> stats.chi2_contingency([[6841-5173,5173],[1217-930,930]])
% T# d6 A2 i- p(0.31748297614660292, 0.57312422493552839, 1, array([[ 1659.73628692, 5181.26371308],
: a2 k) k K. L8 ]& @& ], x [ 295.26371308, 921.73628692]])) |
|