R Markdown

data(alcohol)

Part 1 - % men reporting alc abuse, and employement rate

part_i <- alcohol %>%
  summarize(pct_abuse = 100 * mean(abuse), pct_emp = 100 * mean(employ)) %>%
  round(digits = 2)
part_i
##   pct_abuse pct_emp
## 1      9.92   89.82

Part 2 - emp rate for group of men who abuse alc

employ_abuse <- alcohol %>%
  group_by(abuse) %>%
  summarize(pct_emp = mean(employ)*100) %>%
  round(digits = 2)
employ_abuse
## # A tibble: 2 × 2
##   abuse pct_emp
##   <dbl>   <dbl>
## 1     0    90.1
## 2     1    87.3

87.3% employment rate for men who abuse alcohol.

Part 3 - employment rate of men who do not abuse alc

Answered in part 2. 90.1% employment rate for men who do not report alcohol abuse.

Part 4 - discuss differences in answers to parts 2 and 3

The sample implies that men who report alcohol abuse have an employment rate that is 2.83% lower than men who do not report alcohol abuse.

Note that the echo = FALSE parameter was added to the code chunk to prevent printing of the R code that generated the plot.