Beginner Question: Prior Specification (Logistic Regression)

136 views
Skip to first unread message

Desi Fox

unread,
Feb 7, 2022, 12:04:38 PM2/7/22
to R-inla discussion group
Hi All,

I am trying to fit a Logistic regression model using R-INLA. I have 3 covariates and I am interested in using a non-informative prior for two of them, but an informative prior for the other. It seems like I could write the code as follows for a non-informative/default prior for all parameters:

model1<-inla(RESPONSE ~ TRT+ AGE + LUNG_Capacity + WB_Count,
           data=dataset1, family = "binomial", Ntrials = 1, num.threads = 2)

However, if I want to use an informative prior for LUNG_Capacity (from among the available standard options - Gaussian should do, I don't need a custom prior), its not intuitive to me what the syntax is. All examples online seem to be for the case where you only have a single variable for which you are specifying a prior.

Thanks for any help. Long time JAGS user, trying to make the leap to INLA! If this has already been answered, I'd be grateful for a link (although a search on this forum didnt seem to help).

Regards
Desi.

Finn Lindgren

unread,
Feb 7, 2022, 12:21:31 PM2/7/22
to R-inla discussion group
Since the basic covariate effects are Gaussian, the easiest way to change the precision parameter is to replace + LUNG_capacity with
  + f(LUNG_capacity, model="linear", prec.linear = ...)
where ... is the desired precicion for the prior for the LUNG_capacity parameter. You can also change the mean with mean.linear.
See ?INLA::f and search for prec.linear, which also reveals you can get the default value via
  INLA::inla.set.control.fixed.default()$prec

Finn

--
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/b8239e5b-b9c3-464f-8080-40586dbdf555n%40googlegroups.com.


--
Finn Lindgren
email: finn.l...@gmail.com

Thierry Onkelinx

unread,
Feb 8, 2022, 2:49:19 AM2/8/22
to Finn Lindgren, R-inla discussion group
Another option is to use the control.fixed argument to set the mean and precision of the prior for the fixed effects.

model1<-inla(RESPONSE ~ TRT+ AGE + LUNG_Capacity + WB_Count,
           data=dataset1, family = "binomial", Ntrials = 1, num.threads = 2, control.fixed = list(prec = list(LUNG_Capacity = 3, default = 0.0001))

ir. Thierry Onkelinx
Statisticus / Statistician

Vlaamse Overheid / Government of Flanders
INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND FOREST
Team Biometrie & Kwaliteitszorg / Team Biometrics & Quality Assurance
thierry....@inbo.be
Havenlaan 88 bus 73, 1000 Brussel
www.inbo.be

///////////////////////////////////////////////////////////////////////////////////////////
To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of. ~ Sir Ronald Aylmer Fisher
The plural of anecdote is not data. ~ Roger Brinner
The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data. ~ John Tukey
///////////////////////////////////////////////////////////////////////////////////////////




Op ma 7 feb. 2022 om 18:21 schreef Finn Lindgren <finn.l...@gmail.com>:

Desi Fox

unread,
Feb 8, 2022, 2:28:59 PM2/8/22
to R-inla discussion group
Thanks Finn and Thierry. I tried Finn's syntax and it worked. I'll also try the other way tonight!

Regards
Desi

Reply all
Reply to author
Forward
0 new messages