Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # 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)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement