Skip to content

Instantly share code, notes, and snippets.

@benwhalley
Last active February 26, 2018 08:03
Show Gist options
  • Save benwhalley/8121e280d24e3275d4fc53de6f1daf0d to your computer and use it in GitHub Desktop.
Save benwhalley/8121e280d24e3275d4fc53de6f1daf0d to your computer and use it in GitHub Desktop.
library(tidyverse)
set.seed(1234)
df <- data_frame(g=c(rep(1, 100), rep(2,100))) %>%
mutate(y = rnorm(n(), 0, 1.5) + .5 * g)
t.test(y~g, data=df)
df %>%
sample_n(50) %>%
ggplot(aes(g,y)) + stat_summary(fun.data=mean_cl_boot)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment