抽样分布 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