Log binomial - need help implementing a code from win bugs to INLA

162 views
Skip to first unread message

Balaji Ramesh

unread,
Aug 5, 2021, 2:22:55 PM8/5/21
to R-inla discussion group
Hi,
I am trying to estimate rate ratios using log-binomial regression as mentioned in (Torman and Camey, 2015). I am just interested in the first model that is implemented in WINbugs by the authors. I am attaching the supplementary file that has the winbugs model highlighting the part I am interested in. I did try to implement it myself in INLA but not sure if I have it right (code below). I don't know how to restrict the probabilities to lie between 0 and 1. Or if specifying binomial itself takes care of that?

dat.inla <- inla(y~1+X1+X2+X3, family='binomial',
   data=dat.pred,
   control.family=list(link='log'),
   control.compute=list(dic=TRUE, cpo=TRUE, waic=TRUE))



Thanks in advance,
Regards,
Balaji Ramesh
Torman_n_Camey_2015.pdf

John Molitor

unread,
Aug 5, 2021, 3:38:38 PM8/5/21
to R-inla discussion group
With a logit link you would restrict the probabilities to lie between 0 and 1 inclusive - not so with a log link which is why prior restrictions are needed.

You can, through sampling, obtain RR's from logit models. See:

Rose, Charles E., Yi Pan, and Andrew L. Baughman. 2015. “Bayesian Logistic Regression Modeling as a Flexible Alternative for Estimating Adjusted Risk Ratios in Studies with Common Outcomes.” Journal of Biometrics & Biostatistics 6 (4): 1–32. https://doi.org/10.4172/2155-6180.1000253.

John

Balaji Ramesh

unread,
Aug 5, 2021, 9:30:24 PM8/5/21
to R-inla discussion group
Thanks a lot. I read the article briefly and it's really interesting to find a different method to obtain RR from binary outcome data. I am very new to Bayesian statistics and INLA so I still don't understand how I can implement the same in INLA. I would appreciate it if someone can explain how to implement a prior to keep the probabilities between 0 and 1 in INLA so that I can try the former method first and study more about the other as I get used to bayesian statistics.  

Helpdesk

unread,
Aug 6, 2021, 1:56:06 AM8/6/21
to Balaji Ramesh, R-inla discussion group

using a log link then you lose control that prob < 1, as the log() link
only make sense for small probabilities, but then its essentailly is the
same as logit link. Personally, I do not see any good justification for
using the log link in this setting.

there is an intermediate link, 'loga', which you can use, see attached,
and you can run this in a sequence of a to use the previous fit as an
initial value in the next one , ending up with a=close to zero which is
the log link.
> --
> You received this message because you are subscribed to the Google
> Groups "R-inla discussion group" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to r-inla-discussion...@googlegroups.com.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/r-inla-discussion-group/79bd7373-a47b-4ddf-8a8d-a67536596e26n%40googlegroups.com
> .

--
Håvard Rue
he...@r-inla.org
runme.R

Balaji Ramesh

unread,
Aug 6, 2021, 9:21:40 PM8/6/21
to R-inla discussion group
Great! thank you so much for everyone. I will try to incorporate the code
Reply all
Reply to author
Forward
0 new messages