How would you visualize this: 30% of men in the white collar workforce have the support of senior-level advocates, while only 12% of women do
I created a data set to represent the problem and plotted it accordingly. The total number of men and women in the working force is assumed equal. For my plot: 100 men, and 100 women.
library(dplyr); library(ggplot2); library(plotly)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
##
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
##
## last_plot
## The following object is masked from 'package:stats':
##
## filter
## The following object is masked from 'package:graphics':
##
## layout
id <- 1:200
gender <- rep(c("Men", "Women"), each =100)
# support var
supported_m <- c(rep("yes", 30), rep("No", 70))
supported_w <- c(rep("yes", 12), rep("No", 88))
supported <- c(supported_m, supported_w)
work_df <- tbl_df(data.frame(id = id, gender = gender, supported = supported))
p0 <- work_df %>% group_by(gender, supported) %>%
ggplot(aes(x = gender, fill = supported)) +
geom_bar() +
scale_y_continuous(breaks = c(0, 20, 40, 60, 80, 100))
ggplotly(p0)