Permalink
Browse files

plot gender balance

  • Loading branch information...
tlevine committed Sep 20, 2012
1 parent 8224531 commit 9d0f00056c624bb70f9b29abab35669e6e1a9a50
Showing with 16 additions and 1 deletion.
  1. +16 −1 analysis/src/eda.R
View
@@ -1,5 +1,5 @@
library('ProjectTemplate')
-load.project()
+# load.project()
for (dataset in project.info$data)
{
@@ -12,3 +12,18 @@ print(yoga.top.1[1:5,])
yoga.top.2 <- subset(quinoa[order(quinoa$yoga.teachers.per.capita, decreasing = T),],yoga.teachers > 1)[1:10,]
print(yoga.top.2[1:5,])
+
+gender.imbalance <- quinoa[order(abs(quinoa$portion.female - 0.5), decreasing = T),][1:1000,]
+gender.imbalance.plot <- ggplot(quinoa) +
+ aes(y=(pop*(1-portion.female)), x=(pop*portion.female)) +
+ geom_abline(slope=1, intercept = 0) +
+ # Dunno what's wrong with this
+# opts(
+# plot.title = 'Zip code gender balance'
+# plot.title = 'Out-lying gender imbalances tend towards males with high populations and vice-versa',
+# axis.title.x = 'Females within a particular zip code',
+# axis.title.y = 'Males within a particular zip code'
+# ) +
+ geom_point()
+
+print(gender.imbalance.plot)

0 comments on commit 9d0f000

Please sign in to comment.