Skip to content

Instantly share code, notes, and snippets.

View anuraglnmiit's full-sized avatar

Anurag Sethi anuraglnmiit

  • UT Dallas
  • Dallas, TX
View GitHub Profile
@anuraglnmiit
anuraglnmiit / Amelia_example.R
Created September 28, 2015 18:39 — forked from dsparks/Amelia_example.R
Multiple imputation for missing data
doInstall <- TRUE
toInstall <- c("Amelia", "ggplot2")
if(doInstall){install.packages(toInstall, repos = "http://cran.us.r-project.org")}
lapply(toInstall, library, character.only = TRUE)
ANES <- read.csv("http://www.oberlin.edu/faculty/cdesante/assets/downloads/ANES.csv")
ANES <- ANES[ANES$year == 2008, -c(1, 11, 17)] # Limit to just 2008 respondents,
head(ANES) # remove some non-helpful variables
with(ANES, plot(jitter(pid7), jitter(ideo7)))