系統抽樣
一種避免隨機性的抽樣方法稱為「系統抽樣」。在這裡,你會以固定間隔從母體中挑選列。
例如,若母體資料集有 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 <- ___