Skip to content

Instantly share code, notes, and snippets.

View gabrielflorit's full-sized avatar

Gabriel Florit gabrielflorit

View GitHub Profile
@gabrielflorit
gabrielflorit / genderparity.R
Last active August 29, 2015 14:02
Gender parity in HarvardX and MITx courses (2012-13)
# data: http://thedata.harvard.edu/dvn/dv/mxhx
# notes: country is determined by mix of administrative (computed from IP address) and user-provided (filled in from student address if available when IP was indeterminate); during de-identification, some country names were replaced with the corresponding continent/region name.
setwd("~/Desktop/edX")
library('lattice')
library('ggplot2')
data <- read.csv('HMXPC13_DI_v2_5-14-14.csv')
library(plyr)
library(reshape2)
library(ggplot2)
edx <- read.csv("data//HMXPC13_DI_v2_5-14-14.csv")
gender.table <- ddply(edx, .(final_cc_cname_DI, gender), summarise, number = length(userid_DI))
levels(gender.table$gender) <- c("none", "female", "male", "other")
gender.table <- dcast(gender.table, final_cc_cname_DI ~ gender, value.var="number")
gender.table$parity <- gender.table$female / gender.table$male
{
"mode": "html"
}
{
"mode": "html"
}
{
"mode": "html"
}
{
"mode": "html"
}
{
"mode": "html"
}
{
"mode": "html"
}
{
"mode": "css"
}
{
"mode": "css"
}