major gender admitted applicants
1 A men 62 825
2 B men 63 560
3 C men 37 325
4 D men 33 417
5 E men 28 191
6 F men 6 373
Graph <- admissions |># getting the admissions dataset and filter it to include only men and womenfilter(gender %in%c("men", "women")) |>ggplot(aes(x = applicants, y = admitted, color = major)) +# Created a scatter plot with applicants on the x-axis and admitted students on the y-axisgeom_point(alpha =0.8, size =3, shape =16) +# Add points to represent data, setting transparency (alpha), size, and shapefacet_grid(. ~ gender) +# Created two faucet plot, each representing gender geom_text(aes(x =700, y =75, label = gender), size =8, color ="Black") +# Add gender labelson the plotgeom_smooth(method ="lm", se =FALSE, linetype ="dashed", color ="gray") +#Added a linear regression trend line without grey blur labs( title ="Admission Rates by Gender Across UC Berkeley Major",x ="Number of Applicants",y ="Number of Admitted Students",color ="Major") +# Customize names for the title, axes, and legendtheme_bw()+# Applied a minimal theme for a cleaner lookscale_color_brewer(palette ="Set1") # Use a color palette from the RColorBrewer to see the data betterGraph
`geom_smooth()` using formula = 'y ~ x'
The data visualization I created comes from the “admissions” dataset. This dataset highlights the gender bias present in UC Berkeley’s graduate schools. The data is separated by major and gender. I created two facet plots showing the number of applicants versus the number of admitted students for males and females. Each colored dot represents the majors that these students applied for. I also added a trend line to highlight the admission trends. The x-axis represents the number of applicants, while the y-axis shows the number of admitted students. One interesting observation I noticed is that for Major E, more women applied than men, yet more men were admitted. I found this pattern particularly intriguing.