|
|
本帖最后由 Menuett 于 2013-12-22 15:59 编辑 8 }; P- s( c' L& }# c$ t1 m
煮酒正熟 发表于 2013-12-20 12:05 ![]()
$ K2 M* Z9 r( P* I' h基本可以说是显著的。总的来说,在商界做统计学分析,95%信心水平是用得最多的,当95%上不显著时,都会去 ...
/ J& V5 V. W+ E4 A: a- [# y- e! {+ U3 O/ u) ~2 d
这个其实是一种binomial response,应该用Contigency Table或者Logisitic Regression(In case there are cofactors)来做。只记比率丢弃了Number of trial的信息(6841和1217个客户)。 ( K% Q4 k% ^- c0 g0 n0 W+ n
$ e/ o+ `# _2 }1 o1 s# x2 _7 e# T2 S+ l
结果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)
7 z9 s4 F/ R) U# W3 c; x0 x$ o* H' f$ n/ d' B
R example:
" c, I q9 w$ v' s/ G' k& x/ x
6 r( P0 w) q: G& J' @% A> M<-as.table(rbind(c(1668,5173),c(287,930)))/ j; E, q; z4 g
> chisq.test(M)7 r! K" E" ?, o( r: O+ ~) x [
0 m* r9 A: t; K& ~+ J# d! [$ ~! U" s2 ^
Pearson's Chi-squared test with Yates' continuity correction, C: @; t6 _0 C) p
3 l9 K8 ` Z0 M2 i0 N5 Rdata: M5 H/ |1 m, c M9 v4 B8 N
X-squared = 0.3175, df = 1, p-value = 0.5731: A0 @ q+ m/ _0 g1 F4 s9 {; Z- R
% a; b9 O6 d" {Python example:% U9 g5 H/ l7 p. |5 a0 `# `8 u4 k
4 J8 A3 ]. I& o+ s/ W6 _ \/ h>>> from scipy import stats
6 ^! L) f' i }8 F>>> stats.chi2_contingency([[6841-5173,5173],[1217-930,930]])# L* v$ }- S7 J, S0 k
(0.31748297614660292, 0.57312422493552839, 1, array([[ 1659.73628692, 5181.26371308],( M& b$ X" Z+ K- V( I8 \/ V
[ 295.26371308, 921.73628692]])) |
|