|
|
本帖最后由 Menuett 于 2013-12-22 15:59 编辑
* e H: w. h* }' e( s- h9 [煮酒正熟 发表于 2013-12-20 12:05 ![]()
' O8 i# D6 ] N6 m5 \# g, E基本可以说是显著的。总的来说,在商界做统计学分析,95%信心水平是用得最多的,当95%上不显著时,都会去 ... ) ]: V, z1 R! S; f ?
3 W% q* k& n" E- D5 C0 X' n& {这个其实是一种binomial response,应该用Contigency Table或者Logisitic Regression(In case there are cofactors)来做。只记比率丢弃了Number of trial的信息(6841和1217个客户)。
# ~1 `" v+ w: O; Y0 V$ P; i) J$ ?3 k; }/ z9 i1 G; v- z
结果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), Q+ s- o. a$ g* a2 E8 Y( H
) E1 @( B1 ^$ `# PR example:
9 H- G- n$ V$ b$ W/ t/ [
/ }# l; r5 d, @( g8 e* v> M<-as.table(rbind(c(1668,5173),c(287,930)))
. k$ R6 {% r) P2 v; {% c0 A> chisq.test(M). U) c+ G% H" M0 V& S, F) b/ l
) E/ @! ^4 i( k; t1 C }) Y- \ Pearson's Chi-squared test with Yates' continuity correction+ c R, t6 K6 _ s/ \
' V$ b0 p. ?3 E H ~) Rdata: M; h- d5 F) W& A
X-squared = 0.3175, df = 1, p-value = 0.5731 h9 f9 X4 C- I2 r! w2 l& k
/ |. h; J/ M" T6 e8 L9 ?Python example:
# u% j: |: B4 {- {4 L# e( F: D8 C) L2 ^, f/ a3 O
>>> from scipy import stats
2 S6 N2 a% P1 }; C( x$ E& E>>> stats.chi2_contingency([[6841-5173,5173],[1217-930,930]])+ h2 I P( i t( s; X% {$ ^
(0.31748297614660292, 0.57312422493552839, 1, array([[ 1659.73628692, 5181.26371308],
6 _$ e, z- @. |4 [( ?4 i5 A+ ` [ 295.26371308, 921.73628692]])) |
|