系统抽样
一种避免完全随机性的抽样方法称为「系统抽样」。做法是按固定的间隔从总体中抽取行。
例如,如果总体数据集有 1,000 行,且您想要样本量为 5,您会选择第 200、400、600、800 和 1000 行。
attrition_pop 可用;已加载 dplyr 和 tibble。
本练习是课程的一部分
R 中的抽样
交互式实操练习
通过完成这段示例代码来试试这个练习。
# Set the sample size to 200
sample_size <- ___
# Get the population size from attrition_pop
pop_size <- ___
# Calculate the interval
interval <- ___