R による数値データの推測
Mine Cetinkaya-Rundel
Associate Professor of the Practice, Duke University
ある日、クレイグスリストのマンハッタン版から「オーナー直接」掲載の1BRアパートを20件ランダムに選択しました。
マンハッタンの典型的な家賃を表すには、平均と中央値のどちらが適切でしょうか?

標本中央値 = $2,350


ブートストラップサンプルを取得する — 元のサンプルと同じサイズで、復元抽出によりランダムに取得したサンプル。
ブートストラップ統計量を計算する — ブートストラップサンプルから計算した平均・中央値・割合などの統計量。
手順(1)と(2)を多数繰り返してブートストラップ分布を作成する — ブートストラップ統計量の分布。
library(infer)
___ %>% # start with data frame
specify(response = ___) %>% # specify the variable of interest
library(infer)
___ %>% # start with data frame
specify(response = ___) %>% # specify the variable of interest
generate(reps = ___, type = "bootstrap") %>% # generate bootstrap samples
library(infer)
___ %>% # start with data frame
specify(response = ___) %>% # specify the variable of interest
generate(reps = ___, type = "bootstrap") %>% # generate bootstrap samples
calculate(stat = "___") # calculate bootstrap statistic
library(infer)
___ %>% # start with data frame
specify(response = ___) %>% # specify the variable of interest
generate(reps = ___, type = "bootstrap") %>% # generate bootstrap samples
calculate(stat = "___") # calculate bootstrap statistic

library(infer)
___ %>% # start with data frame
specify(response = ___) %>% # specify the variable of interest
generate(reps = ___, type = "bootstrap") %>% # generate bootstrap samples
calculate(stat = "___") # calculate bootstrap statistic

R による数値データの推測