比較抽樣與自助法的平均值
為了讓計算更容易,前一題產生的分佈已整理成 tibbles。sampling_distribution 的 sample_mean 欄位放的是 mean_popularity_2000_samp,而 bootstrap_distribution 的 resample_mean 欄位放的是 mean_popularity_2000_boot。
已提供 spotify_population、spotify_sample、sampling_distribution 與 bootstrap_distribution;dplyr 已經載入。
本練習屬於課程
R 的抽樣
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Calculate the true population mean popularity
pop_mean <- ___
# Calculate the original sample mean popularity
samp_mean <- ___
# Calculate the sampling dist'n estimate of mean popularity
samp_distn_mean <- ___
# Calculate the bootstrap dist'n estimate of mean popularity
boot_distn_mean <- ___
# See the results
c(pop = pop_mean, samp = samp_mean, sam_distn = samp_distn_mean, boot_distn = boot_distn_mean)