Problem with the indexes?

41 views
Skip to first unread message

Andrea Araujo

unread,
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


Thanks
Message has been deleted

Andrea Araujo

unread,
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. 

Thanks!

Sebastian Rodriguez

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

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!

-Sebastian

Andrea Araujo

unread,
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

formula<-cases~p+t+nrd+swc
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.

Helpdesk

unread,
May 27, 2022, 12:09:15 AMMay 27
to Andrea Araujo, R-inla discussion group
library(INLA)
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 r-inla-discussion...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/r-inla-discussion-group/d7eba7c9-0d8c-437b-8fdf-1d7bc1d99665n%40googlegroups.com.

--
Håvard Rue
he...@r-inla.org
Reply all
Reply to author
Forward
0 new messages