Created
February 20, 2017 17:01
-
-
Save carlislerainey/c2273db46ea22db9fa0b0d963477faed to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| # set wd | |
| setwd("~/Dropbox/classes/pols-209") | |
| # load packages | |
| library(dplyr) | |
| library(ggplot2) | |
| # load data | |
| nominate <- readRDS("data/nominate.rds") # read data set | |
| # subset data to only democrats in the 114th congress | |
| nom2014dem <- subset(nominate, congress == 114 & party == "Democrat") | |
| # create ecdf plot | |
| ggplot(nom2014dem, aes(x = ideology_score)) + | |
| stat_ecdf() | |
| # compute exactly | |
| ecdf0 <- ecdf(nom2014dem$ideology_score) | |
| # nancy p. | |
| ecdf0(-0.49) | |
| # john l. | |
| ecdf0(-0.59) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment