|
|
本帖最后由 Menuett 于 2013-12-22 15:59 编辑 " p0 {( @2 C* Z% X% i; [/ y
煮酒正熟 发表于 2013-12-20 12:05 ![]()
+ {; Z( V& o) p3 q$ I o基本可以说是显著的。总的来说,在商界做统计学分析,95%信心水平是用得最多的,当95%上不显著时,都会去 ...
B" Z! {9 A! Z6 v# ]% ~" ~! G2 q
! g& a2 J7 x8 Y# T n. M6 \这个其实是一种binomial response,应该用Contigency Table或者Logisitic Regression(In case there are cofactors)来做。只记比率丢弃了Number of trial的信息(6841和1217个客户)。 ) g. K2 j2 h1 n8 ^( j F% U5 ^
: |/ R( I$ D, x: H结果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)' K8 N2 g5 I2 {: H2 S8 a; p
$ g0 ]6 v, d% {9 V: _R example:
4 s, N2 a- }. @; l" Q J- ]/ x$ e) K/ w5 B1 R
> M<-as.table(rbind(c(1668,5173),c(287,930)))$ o. |3 \5 X$ ?9 f' v3 _
> chisq.test(M)' K* F( e" V( [
4 G5 r% Z2 F0 I- {0 A# N8 A9 }
Pearson's Chi-squared test with Yates' continuity correction$ F6 h1 D$ C1 ~. [
8 _) F% K$ p# ]7 T! ]data: M8 N5 h# w8 S5 @7 p# t
X-squared = 0.3175, df = 1, p-value = 0.5731
. k$ L2 I+ I. P% G5 j4 `+ Y3 T$ [: H- K( \9 I
Python example:& F5 C) y( e' y
+ L' k+ t# u" @( e, q: \>>> from scipy import stats
. z$ s& |. L2 q8 p1 E>>> stats.chi2_contingency([[6841-5173,5173],[1217-930,930]])) Q9 @. q& c6 s9 ` x
(0.31748297614660292, 0.57312422493552839, 1, array([[ 1659.73628692, 5181.26371308],8 H, H& O3 ^4 i6 d: e
[ 295.26371308, 921.73628692]])) |
|