Created
November 28, 2018 12:01
-
-
Save benwhalley/4f268c68ddd4224d6ce4f5b28c9f1cb0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(rstanarm) | |
library(tidybayes) | |
m1 <- stan_lmer(t2_accuracy ~ lag*condition + (1|p), data = rsvp_accuracy) | |
nd <- expand.grid(condition=unique(rsvp_accuracy$condition), lag=factor(c(1,3))) %>% as.tibble() %>% mutate(p=Inf) | |
m1.preds <- add_fitted_samples(nd, m1) | |
m1.preds.wide <- m1.preds %>% | |
data.table::dcast(.iteration+condition~lag) | |
m1.preds.wide %>% | |
mutate(d=`1`-`3`) %>% | |
data.table::dcast(.iteration~condition, value.var="d") %>% | |
transmute(fam-omm, fam-control, control-omm) %>% | |
data.table::melt() %>% | |
group_by(variable) %>% | |
mean_qi() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment