2.4. Response rates by education categories and incentive groups (Figure 1)


The following barplots were createt using the “ggplot” package.

# ggplot
# edu Education
toPlot <-
  WaveOne[WaveOne$id.bru==1,
              c("rr", "edu", "Pumavers")] %$%
  #mutate(bin = cut(edu, pretty(edu, 20))) %$%
  table(edu, rr, Pumavers) %>%
  as.data.frame() %>%
  mutate(plotVal = ifelse(rr == "Response",-1 * (Freq / table(WaveOne$rr)[["Response"]]),
                          Freq / table(WaveOne$rr)[["Non-Response"]]))

levels(toPlot$rr)[1] <- "Nonresponse"
levels(toPlot$Pumavers) <- c("Brochure",
                             "2€ token",
                             "5€ token",
                             "Voucher")

toPlot %>%
  ggplot(aes(edu, y = Freq)) +
  geom_bar(aes(fill = rr), position = "fill", stat = "identity") +
  coord_flip() +
  geom_hline(aes(yintercept = 0.247, 
                 linetype = "Overall Response Rate (24.7%)"),
             show.legend = TRUE) +
  scale_y_continuous(labels  = scales::percent_format(accuracy = 1),
                     breaks = c(0,0.2, 0.4, 0.6, 0.8,1)) +
  facet_grid(. ~ Pumavers) +
  scale_x_discrete(
    labels = function(x)
      str_wrap(x, width = 30)
  ) +
  labs(y = "", x = "Highest Education") +
  scale_fill_manual(values = c("grey", "grey50")) +
  guides(fill = guide_legend(title = NULL,
                             override.aes = list(linetype = 0))) +
  scale_linetype_manual(" ", values = 1)+
  theme_minimal() +
  theme(legend.position = "top") +
  theme(text=element_text(size=12#, family="serif"
  ))

plot of chunk unnamed-chunk-43

Previous
Next