Skip to content

Instantly share code, notes, and snippets.

View IrinaMax's full-sized avatar

Irina Max IrinaMax

View GitHub Profile
@IrinaMax
IrinaMax / Amelia_example.R
Created May 30, 2017 16:46 — 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)))
@IrinaMax
IrinaMax / fizzbuzz.md
Created January 25, 2017 08:25 — forked from aammd/fizzbuzz.md
An example of calculating "FizzBuzz" in R using dplyr and magrittr

Apparently, there is a simple problem called Fizz buzz which is sometimes used to identify competent programmers. A good opportunity to practice some dplyr and magrittr tricks.

library(dplyr)
library(magrittr)
library(knitr)

1:100 %>%
 data.frame %&gt;%