|
本帖最后由 Menuett 于 2013-12-22 15:59 编辑
% b4 p# ~* o: }1 ]* y- K) N) t煮酒正熟 发表于 2013-12-20 12:05 ![]()
5 x9 N( Z" I2 y3 \5 O( K5 e4 _& D基本可以说是显著的。总的来说,在商界做统计学分析,95%信心水平是用得最多的,当95%上不显著时,都会去 ...
! J7 v; h5 b8 M5 e7 d1 v
n# R- y5 Z: ?( ]2 y c这个其实是一种binomial response,应该用Contigency Table或者Logisitic Regression(In case there are cofactors)来做。只记比率丢弃了Number of trial的信息(6841和1217个客户)。 3 o2 `6 H* Z7 z3 ]
4 U% b7 ^8 U6 i( t结果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)! D! P5 n$ w j
4 ~5 Y# S2 f: {. ?+ R9 C8 K+ F4 N2 t
R example:
1 G" B5 M( e N% b! j+ f7 l2 i. }" w& Y3 s S0 S/ w0 a9 p
> M<-as.table(rbind(c(1668,5173),c(287,930)))
3 n- P" i0 m6 {1 H> chisq.test(M)
3 }3 L, i2 M7 n+ M) D/ F, R, w: g
Pearson's Chi-squared test with Yates' continuity correction
; \6 q* s% y0 V( e2 T$ |9 @5 @: v
data: M
) m$ Q3 w+ p4 E# @4 X( KX-squared = 0.3175, df = 1, p-value = 0.5731
$ _# L& g# {/ v& x
$ _- {1 ~( `8 x! H0 ^1 V0 L" F5 NPython example:
0 m% ]( W, G3 g1 s( H% A" e0 B4 K1 y- \+ X! a
>>> from scipy import stats8 J$ a3 K$ _8 s; N) a( i
>>> stats.chi2_contingency([[6841-5173,5173],[1217-930,930]])1 ~5 t; [7 I6 N2 b% [0 g
(0.31748297614660292, 0.57312422493552839, 1, array([[ 1659.73628692, 5181.26371308],
# l4 ?0 d9 ~4 C$ w' K9 v [ 295.26371308, 921.73628692]])) |
|