始める無料で始める

平均に対する効果量

多くのベンチャーキャピタル支援企業は複数回の資金調達を受けます。一般に、2 回目は 1 回目より大きくなります。ラウンド番号が平均の調達額にどれほど影響するのでしょうか。これを定量化するために Cohen の d を使います。

Cohen の d を計算するには、まずプールした標準偏差を求める必要があります。これは次の式で与えられます。

その後、Cohen の d は次の式で与えられます。

ベンチャー投資の DataFrame(investments_df)が読み込まれており、pandas は pd、NumPy は np、SciPy からは stats がインポート済みです。列 funding_total_usd はそのラウンドで受け取った合計調達額を表します。

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

Pythonで学ぶ推測の基礎

コースを見る

演習の手順

  • investments_df をフィルタリングして、funding_rounds が 1 と 2 のデータをそれぞれ取り出します。
  • 各ラウンドの標準偏差と標本数を計算します。
  • 2 つのラウンド間のプールした標準偏差を計算します。
  • 直前に計算した値を用いて Cohen の d を求めます。

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

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

# Select all investments from rounds 1 and 2 separately
round1_df = investments_df[____['funding_rounds'] == ____]
round2_df = investments_df[____['funding_rounds'] == ____]

# Calculate the standard deviation of each round and the number of companies in each round
round1_sd = ____.std()
round2_sd = ____.std()
round1_n = ____.shape[0]
round2_n = ____.shape[0]

# Calculate the pooled standard deviation between the two rounds
pooled_sd = np.sqrt(((____ - 1) * ____ ** 2 + (____ - 1) *____ ** 2) / (____ + ____ - 2))

# Calculate Cohen's d
d = (____.mean() - ____.mean()) / ____
コードを編集して実行