1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

scipy.stats: 二項検定 binomtest

Posted at

scipy.stats: 二項検定 binomtest

母比率の検定を行う。

binomtest(k, n, p=0.5, alternative='two-sided')

  • k 成功数
  • n 試行数
  • p 母比率。デフォルトで 0.5
  • alternative 検定種別。デフォルトで両側検定 'two-sided',片側検定は 'greater''less'

戻り値は pvalue などを含むオブジェクト

このオブジェクトのメソッド

proportion_ci(confidence_level=0.95, method='exact')

  • confidence_level 信頼度
  • method デフォルトは 'exact',その他に 'wilson''wilsoncc'
from scipy.stats import binomtest

object = binomtest(682, 925, p = 3/4)
print(object.pvalue)
print(object.proportion_ci())
print(object.proportion_ci(method='wilson'))
print(object.proportion_ci(method='wilsoncc'))
0.3824915595748516
ConfidenceInterval(low=0.707668264079039, high=0.7654065582414781)
ConfidenceInterval(low=0.7079959876196205, high=0.7646358009714889)
ConfidenceInterval(low=0.7074390554781229, high=0.7651554240456733)
1
1
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
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?