This admissions dataset is about gender bias among graduate school admissions to UC Berkeley.
data("admissions")library(ggthemes)
Create a facet wrap point plot to show admission rates vary by department for men vs. women
First I need to create a new column to calculate the admission rate (admitted/applicants)
admissions2 <- admissions |>mutate(admit_rate = admitted/applicants) # creating a new column
Next I’m plotting the graph, putting everything together. This graph is showing the admission rates vary by department for men vs. women at UC Berkeley.
p1 <- admissions2 |>ggplot(aes(x = major, y = admit_rate, color = gender, group = gender)) +geom_point(size =4) +#the point sizegeom_line()+# this is to have the line connecting the pointslabs(title ="Admission Rate by Major and Gender at UC Berkeley",x ="Majors",y ="Admission Rate") +theme_bw()+# this is the theme of the plotscale_color_brewer(palette ="Set2") # this is the color palettep1
Essay
I chose the dataset “admissions,” which explores graduate admission and potential gender bias across majors. I didn’t have to do any data cleaning and all the variables were clean and ready to use as it was a small dataset. My goal was to examine how men and women differ in terms of admission rate by major. There are four variables in this data set: major, gender, admitted, applicants. I created a new variable called admit_rate, which I calculated as the number of admitted students divided by the number of applicants. In my graph, I plotted majors on the x-axis, admit rate on the y-axis, and gender was my colour legend. The graph shows that in majors A and B, there is a clear female admission rate advantage,for majors C and E, there is a clear male admission rate advantage but really small, and majors D and F’s admission rate were identical which was really interesting to see.