Created
July 24, 2018 05:11
-
-
Save MichelNivard/5f2a7876830aee7cb3e2b9c892763a0d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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