Non-linear effects in ecological Poisson regression using RW2 splines in INLA

17 views
Skip to first unread message

Nidayatou Ayeva

unread,
Sep 17, 2025, 11:02:56 AM (3 days ago) Sep 17
to R-inla discussion group
Hello,

 
I am conducting an ecological study on the association between breast cancer incidence and social deprivation (Fdep). The incidence variable follows a Poisson distribution. The relationship appears to be non-linear, and I would like to model it using splines — specifically with a RW2 model in INLA.

When I discretize the covariate into bins, INLA provides estimates. My understanding is that splines are generally interpreted relative to some reference. My first question is therefore: in INLA, what is this implicit reference? Is it possible to change it? If not, how should the model be interpreted or specified in order to make interpretation simpler?


To assess non-linearity, I plotted the exponential of the posterior mean from summary.random[[Fdep]], along with its corresponding credible interval. The resulting curve crosses the line RR = 1 several times. How should these crossings be interpreted, and what approach would you recommend in such a situation?


  Thank you in advance.  

Helpdesk (Haavard Rue)

unread,
Sep 19, 2025, 1:55:39 AM (24 hours ago) Sep 19
to Nidayatou Ayeva, R-inla discussion group
One nice way to think of splines, is that it is a non-parametric correction to a
linear effect.

To get this, you need to add the linear effect and remove it from the spline,
but adding extraconstr saying that (1:m)^T %*% spline = 0

I made a small example to illustrate

Best
Havard
> --
> 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, visit
> https://groups.google.com/d/msgid/r-inla-discussion-group/61d0dd6f-6113-4545-9cfc-c9f7c6b5dc40n%40googlegroups.com
> .

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

Nidayatou Ayeva

unread,
Sep 19, 2025, 5:39:41 AM (20 hours ago) Sep 19
to Helpdesk, R-inla discussion group
Thank you for your feedback.

As I understand it, I use the spline as a form of correction (like what we do when adjusting for an association with a confounding factor), and I focus on interpreting the linear component.



My model is a spatio-temporal model (number of areas = 5526 and number of years = 7).

data$FDep_s <- scale(data$FDep)
data$FDep_s_bis <- data$FDep_s

data$FDep_rw <- inla.group(data$FDep_s, n = 50, method = "quantile")
m <- length(unique(data$FDep_rw))
Aext <- list(A = matrix(scale(1:m), 1, m), e = 0)

formula <- O ~ 
  f(ID, model = "bym2", graph = Geom_France.adj, hyper = hyper_bym, constr = T, scale.model = T) +
  f(ANNEE, model = "rw2", hyper = hyper_iid_rw, constr = T, scale.model = T) +
  f(ANNEE_1_b, model = "iid", hyper = hyper_iid_rw, constr = T) +
  f(SPID.ANNEE, model = "iid", hyper = hyper_iid_rw, constr = T) + 
  FDep_s + # the linear part with the original continuous variable
  f(FDep_rw, model = "rw2", scale.model = TRUE, constr = TRUE, extraconstr = Aext, hyper = hyper_iid_rw) # the nonlinear part with a discretization of the original variable


Is this reformulation correct for my case? Could you possibly provide some references to better understand this way of approaching splines?

Thank you for your help.

INLA help

unread,
Sep 19, 2025, 6:40:11 AM (19 hours ago) Sep 19
to Nidayatou Ayeva, R-inla discussion group
Seems correct.    
 
I don’t know if this is written specifically anywhere, but it’s kind of implicit and how I think of it 

Haavard Rue
Reply all
Reply to author
Forward
0 new messages