始める無料で始める

サンプリング分布 vs. ブートストラップ分布

サンプリング分布とブートストラップ分布は密接に関連しています。母集団から繰り返しサンプリングできる状況(実際にはまれです)では、両者の関係を理解するために、サンプリング分布とブートストラップ分布を順番に生成して見比べるとよいです。

ここで関心のある統計量は、楽曲の popularity スコアの平均です。

spotify_population(全データセット)と spotify_sample(元の標本を表す500行のみ)が利用可能で、dplyr は読み込まれています。

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

Rで学ぶサンプリング

コースを見る

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

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

# Generate a sampling distribution
mean_popularity_2000_samp <- ___(
  # Use 2000 replicates
  ___,
  expr = {
    # Start with the population
    ___ %>% 
      # Sample 500 rows without replacement
      ___ %>% 
      # Calculate the mean popularity as mean_popularity
      ___ %>% 
      # Pull out the mean popularity
      ___
  }
)

# See the result
mean_popularity_2000_samp
コードを編集して実行