LoslegenKostenlos loslegen

Is systematic sampling OK?

Systematic sampling has a problem: if the data has been sorted, or there is some sort of pattern or meaning behind the row order, then the resulting sample may not be representative of the whole population. The problem can be solved by shuffling the rows, but then systematic sampling is equivalent to simple random sampling.

Here you'll look at how to determine whether or not there is a problem.

attrition_sys_samp is available and has been given a row ID column; dplyr and ggplot2 are loaded.

Diese Übung ist Teil des Kurses

Sampling in R

Kurs anzeigen

Interaktive Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

# Add a row ID column to attrition_pop
attrition_pop_id <- attrition_pop %>% 
  rowid_to_column()

# Using attrition_pop_id, plot YearsAtCompany vs. rowid
___ +
  # Make it a scatter plot
  ___ +
  # Add a smooth trend line
  ___
Code bearbeiten und ausführen