# drift = b0 + b1 * perc_accDR
```r
ymu <- d[, mean(driftb1)]
ysd <- d[, sd(driftb1)]
get_prior(driftb1 ~ conditionEC * platformEC + (1 + conditionEC | study), d)
priors <- c(set_prior(glue("normal({ymu}, {ysd})"), class = "Intercept"),
set_prior(glue("normal(0, {ysd})"), class = "b"),
set_prior(glue("normal(0, {ysd})"), class = "b", coef = "conditionEC"))
priors
m2b <- brm(driftb1 ~ conditionEC * platformEC + (1 + conditionEC | study), d,
prior = priors, chains = 3, cores = 3, iter = 2000, control = list(adapt_delta = 0.99),
sample_prior = TRUE)
summary(m2b)
> summarizebrms(m2b, effect = "conditionEC")
b = 0.27, 95% HPD [0.06, 0.54], BF = 2.54, d = 0.26, 95% HPD [0.04, 0.51]
```
![[Pasted image 20210803130532.png]]
---
# other stuff
```r
get_prior(driftb1 ~ conditionEC + (1 + conditionEC | platform / study), d)
priors <- c(set_prior("normal(0, 0.5)", class = "Intercept"),
set_prior("normal(0, 0.5)", class = "b"),
set_prior("normal(0, 0.5)", class = "b", coef = "conditionEC")) %>% print()
m1b <- brm(driftb1 ~ conditionEC + (1 + conditionEC | platform / study), d,
prior = priors, chains = 3, cores = 3, iter = 2000, control = list(adapt_delta = 0.99),
sample_prior = TRUE)
# b = 0.17, 95% HPD [−0.58, 0.67]
```
- BF: 3.87
![[Pasted image 20210803003458.png]]
Tighter priors based on frequentist models
- `b = 0.28, 95% HPD [0.06, 0.48], BF = 3.29, d = 0.28, 95% HPD [0.06, 0.47]`
- BF: 141.86
![[Pasted image 20210803004124.png]]
```r
> m2 <- lmer(driftb1 ~ conditionEC * platformEC + (1 + conditionEC | study), d)
> summaryh(m2)
term results
1: (Intercept) b = 0.40, SE = 0.08, t(5) = 5.04, p = .003, r = 0.91
2: conditionEC b = 0.28, SE = 0.07, t(3) = 3.79, p = .034, r = 0.91
3: platformEC b = −0.14, SE = 0.16, t(5) = −0.86, p = .426, r = 0.35
4: conditionEC:platformEC b = 0.03, SE = 0.15, t(3) = 0.19, p = .865, r = 0.11
```