# Binomial regression with identity link in brms

**URL:** <https://discourse.mc-stan.org/t/binomial-regression-with-identity-link-in-brms/6495>\
**Category:** brms\
**Tags:** techniques, specification\
**Created:** [November 12, 2018, 11:21pm UTC](https://discourse.mc-stan.org/t/binomial-regression-with-identity-link-in-brms/6495 "2018-11-12T23:21:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![realkrantz](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/realkrantz/32/3346_2.png) [@realkrantz](https://discourse.mc-stan.org/u/realkrantz)\
**Post date:** [November 12, 2018, 11:21pm UTC](https://discourse.mc-stan.org/t/binomial-regression-with-identity-link-in-brms/6495/1 "2018-11-12T23:21:31Z")

</div>

As suggested [here](https://academic.oup.com/aje/article/166/11/1337/100504) and [elsewhere](https://academic.oup.com/aje/article-abstract/123/1/174/49113?ijkey=41bfebc687e24e42ce530c04be6defe98fa983dc&keytype2=tf_ipsecsha) the model:

> glm(y~x, family=binomial(link=identity))

gives estimates in `risk difference`.

I would like to know if the same model in `brms`, or specifically the model:

> mod\<-brm(r | trials(n) ~ treat, data=dt, family=binomial(link=identity))

for the data below would also output estimates in `risk difference`:

dt = read.table(header = TRUE, text = "  
n r r/n group treat c2 c1 w  
62 3 0.048387097 1 0 0.1438 1.941115288 1.941115288  
96 1 0.010416667 1 0 0.237 1.186583128 1.186583128  
17 0 0 0 0 0.2774 1.159882668 3.159882668  
41 2 0.048780488 1 0 0.2774 1.159882668 3.159882668  
212 170 0.801886792 0 0 0.2093 1.133397521 1.133397521  
143 21 0.146853147 1 1 0.1206 1.128993008 1.128993008  
143 0 0 1 1 0.1707 1.128993008 2.128993008  
143 33 0.230769231 0 1 0.0699 1.128993008 1.128993008  
73 62 1.260273973 0 1 0.1351 1.121927228 1.121927228  
73 17 0.232876712 0 1 0.1206 1.121927228 1.121927228")

I read [here](https://rdrr.io/cran/brms/man/brmsfamily.html) that:

> “In the following, we list all possible links for each family. (…) The (…) families `binomial` , `bernoulli` , `Beta` , `zero_inflated_binomial` , `zero_inflated_beta` , and `zero_one_inflated_beta` the links `logit` , `probit` , `probit_approx` , `cloglog` , `cauchit` , and `identity`”.

I hope what I am proposing is possible in `bmrs`. Thank you in advance for any help.

---

<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:** [November 13, 2018, 10:34am UTC](https://discourse.mc-stan.org/t/binomial-regression-with-identity-link-in-brms/6495/2 "2018-11-13T10:34:15Z")

</div>

Yes, that should work with brms as well, but you may need to specify reasonable priors on the regression coefficients so that the predictions are between 0 and 1 and thus resemble a probability.

---

<div class="post-metadata">

**Author:** ![realkrantz](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/realkrantz/32/3346_2.png) [@realkrantz](https://discourse.mc-stan.org/u/realkrantz)\
**Post date:** [November 13, 2018, 1:41pm UTC](https://discourse.mc-stan.org/t/binomial-regression-with-identity-link-in-brms/6495/3 "2018-11-13T13:41:33Z")

</div>

Thanks @paul.buerkner. That is very helpful.
