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

Weighted sampling

Stratified sampling provides rules about the probability of picking rows from your dataset at the subgroup level. A generalization of this is weighted sampling, which lets you specify rules about the probability of picking rows at the row level. The probability of picking any given row is proportional to the weight value for that row.

attrition_pop is available; dplyr and ggplot2 are loaded.

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

Sampling in R

ดูคอร์ส

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

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

# Using attrition_pop, plot YearsAtCompany as a histogram with binwidth 1
___
แก้ไขและรันโค้ด