Skip to content

Instantly share code, notes, and snippets.

@carlislerainey
Created February 20, 2017 17:01
Show Gist options
  • Select an option

  • Save carlislerainey/c2273db46ea22db9fa0b0d963477faed to your computer and use it in GitHub Desktop.

Select an option

Save carlislerainey/c2273db46ea22db9fa0b0d963477faed to your computer and use it in GitHub Desktop.
# 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