haircut

references:
- ISI, exploration 6.1a, p.327

library(tidyverse)
library(knitr)

data

haircut <- read.delim("Haircuts.txt")
str(haircut)
## 'data.frame':    50 obs. of  2 variables:
##  $ Sex : Factor w/ 2 levels "Female","Male": 1 2 1 2 1 2 1 1 1 1 ...
##  $ Cost: int  50 20 60 75 150 23 15 90 20 110 ...
tbl <- haircut %>%
  group_by(Sex) %>%
  summarize(mean = mean(Cost),
            s = sd(Cost),
            n = n())
kable(tbl)
Sex mean s n
Female 54.05405 41.61393 37
Male 21.84615 22.13536 13

dot plots

ggplot(haircut, aes(Cost)) +
  geom_dotplot(fill = "darkred", dotsize = 0.8) +
  facet_grid(Sex ~ .) +
  labs(title = "Haircut")