1. 学ぶ
  2. /
  3. コース
  4. /
  5. Pythonで学ぶ仮説検定

Connected

演習

2標本のための proportions_ztest()

p値を計算するのは大変でしたね。計算の仕組みを理解するのは有益ですが、実務の分析で毎回手計算するのは現実的ではありません。日常的には statsmodels パッケージを使うのが便利です。

仮説を思い出しましょう。

\(H_{0}\): \(late_{\text{expensive}} - late_{\text{reasonable}} = 0\)

\(H_{A}\): \(late_{\text{expensive}} - late_{\text{reasonable}} > 0\)

late_shipments が利用可能で、freight_cost_group 列を含みます。numpy と pandas は標準のエイリアスで読み込まれており、proportions_ztest は statsmodels.stats.proportion から読み込まれています。

指示1 / 2

undefined XP
    1
    2
  • freight_cost_group ごとに late 列の件数を取得します。