CommencerCommencer gratuitement

Summary statistics on different kinds of sample

Now you have three types of sample (simple, stratified, cluster), you can compare point estimates from each sample to the population parameter. That is, you can calculate the same summary statistic on each sample and see how it compares to the summary statistic for the population.

Here, we'll look at how satisfaction with the company affects whether or not the employee leaves the company. That is, you'll calculate the proportion of employees who left the company (they have an Attrition value of "Yes"), for each value of RelationshipSatisfaction.

attrition_pop, attrition_srs, attrition_strat, and attrition_clust are 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.

# Use the whole population dataset 
mean_attrition_pop <- ___ %>% 
  # Group by relationship satisfaction level
  ___ %>% 
  # Calculate the proportion of employee attrition
  ___

# See the result
mean_attrition_pop
Modifier et exécuter le code