|
|
本帖最后由 Menuett 于 2013-12-22 15:59 编辑
% y7 r9 O' o5 B3 f" [& J7 P煮酒正熟 发表于 2013-12-20 12:05 ![]()
: o# `0 S: v# V- c; c3 T3 y基本可以说是显著的。总的来说,在商界做统计学分析,95%信心水平是用得最多的,当95%上不显著时,都会去 ...
+ b$ k! X% W: d6 {+ X/ U
- D' o4 P! M% B+ ^/ A1 T这个其实是一种binomial response,应该用Contigency Table或者Logisitic Regression(In case there are cofactors)来做。只记比率丢弃了Number of trial的信息(6841和1217个客户)。
' M2 t( ?; ^& [, c6 X3 H$ ^8 s- W, H1 T* j. s
结果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)9 [ S" o) w7 k$ b; S, F$ r
+ R1 Q/ \9 \5 \ }
R example:, K6 v; Q( U$ m/ o) A
1 i8 s4 c, v: F! j& M/ E7 ?/ }# I
> M<-as.table(rbind(c(1668,5173),c(287,930)))
( o8 o# L) S6 Z> chisq.test(M)
. L, i9 W, o3 X' m" t5 N
6 V1 Y Q# B4 j t: |4 C5 W Pearson's Chi-squared test with Yates' continuity correction: P$ _ E4 v& C0 C$ Z: X5 v/ Y
0 p- ?; w3 B Z1 O, {" G* y4 B
data: M+ q+ n6 x! r) {5 v. l5 F
X-squared = 0.3175, df = 1, p-value = 0.5731
5 t% f' @) S* j, n0 Y4 X( b" ~( H& a/ H L9 @% I5 U0 T( |* @! i+ ^
Python example:
8 ?' ~/ |. x; q- E: |/ m& ]: T9 C1 M' K$ g9 _% F
>>> from scipy import stats; t2 U3 X; R! l5 l" z
>>> stats.chi2_contingency([[6841-5173,5173],[1217-930,930]])! S1 j0 Z+ p& o2 n8 c9 W# i3 }
(0.31748297614660292, 0.57312422493552839, 1, array([[ 1659.73628692, 5181.26371308]," D: `4 S4 A" j: V2 v. h9 `3 E6 F) [
[ 295.26371308, 921.73628692]])) |
|