|
本帖最后由 Menuett 于 2013-12-22 15:59 编辑
( ^: F# m- _! a: T8 o3 P煮酒正熟 发表于 2013-12-20 12:05
% \9 A- H' D( i' x, t基本可以说是显著的。总的来说,在商界做统计学分析,95%信心水平是用得最多的,当95%上不显著时,都会去 ... * k! R/ g* K, ?" }. j6 b
5 l0 U# S0 C+ ~7 d! y, P7 g这个其实是一种binomial response,应该用Contigency Table或者Logisitic Regression(In case there are cofactors)来做。只记比率丢弃了Number of trial的信息(6841和1217个客户)。 2 F8 u* V9 H2 g5 O+ R- u0 d( V
) s4 H( @8 ?: _5 Q/ @结果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)3 \: Y4 d4 o8 r
9 {& \8 C9 Q: s$ M/ c9 q9 ^R example:. M" t; m) I$ p
& ], s- q( C9 R
> M<-as.table(rbind(c(1668,5173),c(287,930)))% X' \' d. h3 U7 _0 v5 {& D7 i
> chisq.test(M)) a( P! |3 B0 [
: a% U3 j* N2 G4 ?1 d Pearson's Chi-squared test with Yates' continuity correction
- v4 ~, F! S5 r4 c6 q2 R( @+ N9 z
( o! v, k% N( W) ]* `: t3 h6 kdata: M
2 @+ w4 c( ?2 V* e% G( EX-squared = 0.3175, df = 1, p-value = 0.5731
- Y! p# p, M. N, `3 w
% }" [3 A( \* x3 P, N. dPython example:5 P2 Z% l. m! j6 m* ?- Q/ F
# P$ a& d$ z0 K# v>>> from scipy import stats4 H2 d9 Y: j$ [8 I# K. O
>>> stats.chi2_contingency([[6841-5173,5173],[1217-930,930]])3 l' X1 s( Z/ G8 p
(0.31748297614660292, 0.57312422493552839, 1, array([[ 1659.73628692, 5181.26371308],- M" B9 l, M7 G3 t
[ 295.26371308, 921.73628692]])) |
|