Skip to content

Instantly share code, notes, and snippets.

@JoFrhwld
Last active December 17, 2015 15:19
Show Gist options
  • Save JoFrhwld/5631064 to your computer and use it in GitHub Desktop.
Save JoFrhwld/5631064 to your computer and use it in GitHub Desktop.
Didn't mean to delete the data.
data.frame(SES = c("High","Middle","Low"),
Applied = c(0.79, 0.59, 0.5),
Admitted = c(0.67, 0.47, 0.42),
Enrolled = c(0.53, 0.28, 0.32)) -> data
ggplot(data, aes(SES)) +
geom_point(aes(y = Applied, color = "Applied"))+
geom_line(aes(y = Applied, group = 1, color = "Applied"))+
geom_point(aes(y = Admitted/Applied, color = "Applied and Admitted"))+
geom_line(aes(group = 1, y = Admitted/Applied, color = "Applied and Admitted"))+
geom_point(aes(y = Enrolled/Admitted, color = "Admitted and Enrolled"))+
geom_line(aes(group = 1, y = Enrolled/Admitted, color = "Admitted and Enrolled"))+
xlim("Low","Middle","High")+
xlab("Socioeconomic Status")+
ylim(0,1)+
ylab("Proportion")+
scale_color_brewer("Status", palette = "Dark2", limits = c("Applied",
"Applied and Admitted",
"Admitted and Enrolled"))+
theme_bw()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment