开始使用免费开始使用

系统抽样

一种避免完全随机性的抽样方法称为「系统抽样」。做法是按固定的间隔从总体中抽取行。

例如,如果总体数据集有 1,000 行,且您想要样本量为 5,您会选择第 2004006008001000 行。

attrition_pop 可用;已加载 dplyrtibble

本练习是课程的一部分

R 中的抽样

查看课程

交互式实操练习

通过完成这段示例代码来试试这个练习。

# Set the sample size to 200
sample_size <- ___

# Get the population size from attrition_pop
pop_size <- ___

# Calculate the interval
interval <- ___
编辑并运行代码