Problem with the indexes?

Skip to first unread message

Andrea Araujo

May 18, 2022, 12:41:42 PMMay 18
to R-inla discussion group
Hi all!  I am modelling malaria incidence in function of some climatic variables. I have a data set with number of malaria cases for each census block (administrative unit) and epiweeks during a whole period of study from January 2008 to March 2020. I was trying to run a simple model with the whole data set and does not work. It works for year<=2010. Here I send my data set and my INLA code. 

slm<-cases~ p +t + nrd+swc+f(EW2,model="iid") +f(CB, model="iid") 
fit1<-inla(formula=slm, data=Datavivax, family="poisson",offset=log(pop),control.compute=list(dic=T,waic=T),verbose=TRUE)

I cannot send the data is too long. So I send you the link

Message has been deleted

Andrea Araujo

May 19, 2022, 5:13:59 PMMay 19
to R-inla discussion group
Hi all again! I do not know if someone had the opportunity to look at the data and my model setting. Please if you could guide me a bit I will really appreciate it. 


Sebastian Rodriguez

May 19, 2022, 10:35:30 PMMay 19
to R-inla discussion group

I tried to reply but my message was deleted. Im not sure if a moderator deleted it due to incorrect information but no response was posted after...

I think your issue is that for family = "poisson", you don't want to specify the offset term but rather the E term in the equation. It's a difference in the terminology used, but if you read the INLA function documentation, this should make it more clear. I also think (I've experienced this from my results) that you don't want to log-scale the "offset" term (E in the formula), as INLA will do that for you.

Hope this helps and that my answer isn't deleted!


Andrea Araujo

May 25, 2022, 1:24:28 PMMay 25
to R-inla discussion group
Thank you Sebastian. I already tried what yu suggested and did not succeded unfortunately.  I do not know someone could have another clue. Is weird When I run:

model<-glm(cases~p+t+nrd+swc, data=Datavivax,family="poisson")

 just to check if there is something wrong with my data, it works perfectly. I was triyng to run just a fixed effects model like this

fit1<-inla(formula=formula, data=Datavivax, family="poisson",offset=log(pop),control.compute=list(dic=T,waic=T))

also does not work, and then I tried with a negative binomial given the high amount of ceros
fitnb<-inla(formula=formula, data=Datavivax, family="nbinomial",offset=log(pop),control.predictor=list(link=1),control.inla = list(int.strategy = "grid"),control.compute=list(config=TRUE))

Does not work. PLease if someone could give me any clue, I will really appreciate this,

Thank you.


May 27, 2022, 12:09:15 AMMay 27
to Andrea Araujo, R-inla discussion group
inla.setOption(inla.mode = "experimental")

and you'll be fine.

make sure you use R-4.2 and the most recent testing version
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
To view this discussion on the web, visit

Håvard Rue
Reply all
Reply to author
0 new messages