LoginSignup
15
14

More than 5 years have passed since last update.

カイ2乗検定と母比率の差の検定は違うのか

Posted at

ABテストをしてその検定のときにどちらを使うか迷ったので比較してみた。
Rで検証してみた。

カイ2乗検定(chisq.test)

クリックした クリックしなかった
広告A 270回 2608回
広告B 344回 2706回
> chisq.test(matrix(c(270, 344, 2608, 2706), nrow=2))

  Pearson's Chi-squared test with Yates' continuity correction

data:  matrix(c(270, 344, 2608, 2706), nrow = 2)
X-squared = 5.5376, df = 1, p-value = 0.01861

母比率の差の検定(prop.test)

インプレション数 クリック数 クリック率
広告A 2878回 270回 49%
広告B 3050回 344回 50%
> prop.test(c(270,344),c(2878,3050))

  2-sample test for equality of proportions with continuity correction

data:  c(270, 344) out of c(2878, 3050)
X-squared = 5.5376, df = 1, p-value = 0.01861
alternative hypothesis: two.sided
95 percent confidence interval:
 -0.034785393 -0.003158079
sample estimates:
    prop 1     prop 2
0.09381515 0.11278689

まとめ

出てくる結果は同じである。
自由度1のχ^2分布の確率は平方根をとれば正規分布になるからである。
なので同じ値になる。

15
14
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
15
14