|
本帖最后由 Menuett 于 2013-12-22 15:59 编辑
! }: B3 b- K: R( K! b煮酒正熟 发表于 2013-12-20 12:05 ![]()
- }7 u ~0 W! S2 c& Y5 z7 A5 ~# l, U基本可以说是显著的。总的来说,在商界做统计学分析,95%信心水平是用得最多的,当95%上不显著时,都会去 ... 3 a ~+ I! W) R5 |5 b; X
6 a1 m, z, P) Q( H
这个其实是一种binomial response,应该用Contigency Table或者Logisitic Regression(In case there are cofactors)来做。只记比率丢弃了Number of trial的信息(6841和1217个客户)。
4 O, F' o4 p* x# x; ?# v
C1 G: ^7 @* Y/ T$ h7 F结果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' z- F b* c: @8 E5 I$ C9 ~: q" h4 ]7 s$ z
R example:: Z; z: D& w9 f3 a% L! k
& o2 v" U% P4 m' ?5 V: T
> M<-as.table(rbind(c(1668,5173),c(287,930)))
; X! Q: Q; `/ Q> chisq.test(M)
' g& y9 d# f ?; ~5 N' v' }% ?$ H) d' l+ j) |& X3 ` [
Pearson's Chi-squared test with Yates' continuity correction1 v! ^* e5 h4 x+ i+ V/ r
" B# N; O2 z7 W' n
data: M
, U1 s- K# B; C! w+ z7 xX-squared = 0.3175, df = 1, p-value = 0.5731
9 O b! e9 r) ~3 h$ s9 S- C7 g
8 i; f( P# U; ?; U+ S) U# h# h cPython example:
# z5 g. p6 ~& S, T+ E U0 ]$ J7 c
% O' y& l+ F8 y8 l* u7 s, E>>> from scipy import stats" Z5 e9 t( v$ U E8 {
>>> stats.chi2_contingency([[6841-5173,5173],[1217-930,930]])
" \% w0 P/ k( N/ `(0.31748297614660292, 0.57312422493552839, 1, array([[ 1659.73628692, 5181.26371308],) ?3 |0 P3 _* ?7 n J/ `+ G8 ~- h
[ 295.26371308, 921.73628692]])) |
|