|
|
本帖最后由 Menuett 于 2013-12-22 15:59 编辑
' `2 W- A8 c. V: G煮酒正熟 发表于 2013-12-20 12:05 2 i+ q' p' k7 U& J! q% {& F
基本可以说是显著的。总的来说,在商界做统计学分析,95%信心水平是用得最多的,当95%上不显著时,都会去 ...
9 m& @! R- G3 W* U/ U
' L. m8 D! I. i: r! T& u2 }8 `/ \4 @这个其实是一种binomial response,应该用Contigency Table或者Logisitic Regression(In case there are cofactors)来做。只记比率丢弃了Number of trial的信息(6841和1217个客户)。 6 V6 [0 a# v9 |2 H; G
% H4 c* G/ t! P3 E9 ]( K3 f) s8 i. b
结果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)6 b, n$ f9 G, V. {' m- H' w- O/ E
1 N7 t0 j- c. ^
R example:* Q, A. T) y; h# M
2 v, J X5 O% y6 L" F" u+ n& _7 e> M<-as.table(rbind(c(1668,5173),c(287,930)))
}$ J \1 c/ m. A! D> chisq.test(M)
# l& v8 d9 o& L6 {4 p( j2 K) ]- }/ y) b9 l$ g# _1 `
Pearson's Chi-squared test with Yates' continuity correction( a* r* W* Z1 o
: i3 p# c9 d. gdata: M) m/ U( r" }/ Z {# s0 S7 X, `
X-squared = 0.3175, df = 1, p-value = 0.5731( z C% B1 e' \2 I [4 N$ }8 T
7 \' [" D, L/ U) w) L B$ c
Python example:
) T+ T. T: }, h9 ]% Z g$ U) \/ T& y
>>> from scipy import stats
0 V+ `9 a: d! e! V& r! P+ X& V& V5 ~>>> stats.chi2_contingency([[6841-5173,5173],[1217-930,930]])
4 t* T7 T' q1 f9 t6 h; p- S(0.31748297614660292, 0.57312422493552839, 1, array([[ 1659.73628692, 5181.26371308]," b$ a0 |. e/ q! H
[ 295.26371308, 921.73628692]])) |
|