Advertisement
Guest User

Untitled

a guest
Feb 20th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. # set wd
  2. setwd("~/Dropbox/classes/pols-209")
  3.  
  4. # load packages
  5. library(dplyr)
  6. library(ggplot2)
  7.  
  8. # load data
  9. nominate <- readRDS("data/nominate.rds") # read data set
  10.  
  11. # subset data to only democrats in the 114th congress
  12. nom2014dem <- subset(nominate, congress == 114 & party == "Democrat")
  13.  
  14. # create ecdf plot
  15. ggplot(nom2014dem, aes(x = ideology_score)) +
  16. stat_ecdf()
  17.  
  18. # compute exactly
  19. ecdf0 <- ecdf(nom2014dem$ideology_score)
  20.  
  21. # nancy p.
  22. ecdf0(-0.49)
  23.  
  24. # john l.
  25. ecdf0(-0.59)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement