開始使用免費開始

系統抽樣

一種避免隨機性的抽樣方法稱為「系統抽樣」。在這裡,你會以固定間隔從母體中挑選列。

例如,若母體資料集有 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 <- ___
編輯並執行程式碼