เริ่มต้นใช้งานเริ่มต้นใช้งานได้ฟรี

Systematic sampling

One sampling method that avoids randomness is called systematic sampling. Here, you pick rows from the population at regular intervals.

For example, if the population dataset had one thousand rows and you wanted a sample size of five, you'd pick rows 200, 400, 600, 800, and 1000.

attrition_pop is available; dplyr and tibble are loaded.

แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร

Sampling in R

ดูคอร์ส

แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ

ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์

# Set the sample size to 200
sample_size <- ___

# Get the population size from attrition_pop
pop_size <- ___

# Calculate the interval
interval <- ___
แก้ไขและรันโค้ด