CommencerCommencer gratuitement

Proportional stratified sampling

If you are interested in subgroups within the population, then you may need to carefully control the counts of each subgroup within the population. Proportional stratified sampling results in subgroup sizes within the sample that are representative of the subgroup sizes within the population. It is equivalent to performing a simple random sample on each subgroup.

attrition_pop is available; dplyr is loaded.

Cet exercice fait partie du cours

Sampling in R

Afficher le cours

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

education_counts_pop <- attrition_pop %>% 
  # Count the employees by Education level, sorting by n
  ___ %>% 
  # Add a percent column
  ___

# See the results
education_counts_pop
Modifier et exécuter le code