Skip to content

Instantly share code, notes, and snippets.

@cdriveraus
Created February 23, 2020 16:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cdriveraus/29d424b2aae7a18b6c6e8332d80c07e9 to your computer and use it in GitHub Desktop.
Save cdriveraus/29d424b2aae7a18b6c6e8332d80c07e9 to your computer and use it in GitHub Desktop.
Earnings inequality
n <- 100000
pe <- .2 #patriarchy benefit to male ability
ba <- rnorm(n) #baseline ability
m <- rbinom(n,1,.5) #male
h <- ba + pe * m + rnorm(n)#h index
e1 <- ba + pe *m + rnorm(n)#earnings assuming caused by ability
e2 <- h + rnorm(n)#earnings assuming caused by h-index
lm(e1~h+m)
lm(e2~h+m)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment