1. Learn
  2. /
  3. Courses
  4. /
  5. A/B Testing in R

Connected

Exercise

Format and histograms

A/B designs consist of two groups, each containing data from different participants. This means a long format dataset is ideal. To get an understanding of the groups' data, histograms can be created, which are analyzed in the A/B tests to determine if they are significantly different.

A company has collected data on their employees and is interested in investigating whether those who are social drinkers, Drinker.yes are absent from work more often than those who are not social drinkers, Drinker.no. Transform the dataset from wide to long, then create a histogram of the social drinking groups and how often they are absent from work.

The absenteeism dataset has been loaded.

Instructions 1/2

undefined XP
    1
    2
  • Load the tidyr and ggplot2 packages to re-format and plot the data.
  • Transform the absenteeism dataset to a long format called longabsent, denoting the drinking groups Drinker.yes and Drinker.no (in that order) in a column named Group and values in a column called Absence.