Skip to content

Instantly share code, notes, and snippets.

@MichelNivard
Created July 24, 2018 05:11
Show Gist options
  • Save MichelNivard/5f2a7876830aee7cb3e2b9c892763a0d to your computer and use it in GitHub Desktop.
Save MichelNivard/5f2a7876830aee7cb3e2b9c892763a0d to your computer and use it in GitHub Desktop.
# I used this online tool to extract the data from the scatter plot:
# https://apps.automeris.io/wpd/
# need Hmisc:
install.packages("Hmisc")
# read the data from my mac into R:
ssgac <- read.csv("ssgac.csv", header=FALSE)
PRS<- ssgac$V1
EduYears <- ssgac$V2
college_complete <- ssgac$V2 > 15
quintiles_PRS <- Hmisc::cut2(x = PRS,g=5)
table<- table(college_complete, quintiles_PRS)
barplot(table[2,]/(table[1,]+table[2,]),names.arg = 1:5,ylim =c(0,0.6))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment