# Cannot change prior of population-level Intercept

**URL:** <https://discourse.mc-stan.org/t/cannot-change-prior-of-population-level-intercept/5225>\
**Category:** brms\
**Created:** [August 15, 2018, 5:58am UTC](https://discourse.mc-stan.org/t/cannot-change-prior-of-population-level-intercept/5225 "2018-08-15T05:58:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mertensu](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/mertensu/32/2956_2.png) [@mertensu](https://discourse.mc-stan.org/u/mertensu)\
**Post date:** [August 15, 2018, 5:58am UTC](https://discourse.mc-stan.org/t/cannot-change-prior-of-population-level-intercept/5225/1 "2018-08-15T05:58:25Z")

</div>

Hi,

I’m interested in fitting a linear mixed effects models of the form y ~ 1 + x + (1+x|id). Before running brm, I try to set the prior of the two fixed effects using:

prior1 = c(set\_prior(‘normal(0,1)’,class=‘b’,coef=‘x’),  
set\_prior(‘normal(0,25)’,class=‘Intercept’))

However, when I look at both prior and posterior distribution of the Intercept afterwards, the prior does not capture the actual prior I specified (normal(0,25)).

plot(hypothesis(fit, “Intercept \> 0”))

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/mc_stan/original/2X/9/9e5cd05f31f013de3f2b76e35ffa676ea5e33628.png)

I am using brms version 2.4.2

R version 3.4.2 (2017-09-28)  
Platform: x86\_64-apple-darwin15.6.0 (64-bit)  
Running under: macOS High Sierra 10.13.6

---

<div class="post-metadata">

**Author:** ![paul.buerkner](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/paul.buerkner/32/3303_2.png) [@paul.buerkner](https://discourse.mc-stan.org/u/paul.buerkner)\
**Post date:** [August 15, 2018, 9:38am UTC](https://discourse.mc-stan.org/t/cannot-change-prior-of-population-level-intercept/5225/2 "2018-08-15T09:38:25Z")

</div>

This is explained in detail in `?set_prior` and `?brmsformula`. In short, if you want to specify a prior on the actual intercept, you have to write `y ~ 0 + Intercept + x + (1+x|id)`.

---

<div class="post-metadata">

**Author:** ![mertensu](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/mertensu/32/2956_2.png) [@mertensu](https://discourse.mc-stan.org/u/mertensu)\
**Post date:** [August 15, 2018, 10:37am UTC](https://discourse.mc-stan.org/t/cannot-change-prior-of-population-level-intercept/5225/3 "2018-08-15T10:37:33Z")

</div>

I thought I already tried the ‘0 + Intercept’ way but obviously I didn’t. Everything works fine now. Thanks for your help.
