始める無料で始める

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 列を含みます。numpypandas は標準のエイリアスで読み込まれており、proportions_zteststatsmodels.stats.proportion から読み込まれています。

この演習はコースの一部です

Pythonで学ぶ仮説検定

コースを見る

実践的なインタラクティブ演習

このサンプルコードを完成させて、この演習に挑戦してみましょう。

# Count the late column values for each freight_cost_group
late_by_freight_cost_group = ____

# Print the counts
print(late_by_freight_cost_group)
コードを編集して実行