Hi Victor,
Without being able to try it on your dataset, it's hard to know
exactly what happened.
I ran the following code, where the graph and data were taken from the
bym example.
library(INLA)
#taken from BYM example. Read data and graph and organise dataframe
data(Germany)
g = system.file("demodata/germany.graph", package="INLA")
source(system.file("demodata/Bym-map.R", package="INLA"))
Germany = cbind(Germany,region.struct=Germany$region)
#this is similar to your formula
formula1 = Y ~ f(region.struct,model="besag",graph.file=g) +x
#this is similar to your inla call
result = inla(formula1, family="zeroinflatedpoisson0",data=Germany,
E=E, control.compute = list(dic=TRUE, cpo=TRUE))
summary(result)
I get sensible results, but the following warning message is produced:
"Warning message:
In INLA::f(region.struct, model = "besag", graph.file = g) :
Argument 'graph.file' in 'f()' is obsolete; please use the more
general argument 'graph' instead."
You can get rid of this by changing the formula to
formula1 = Y ~ f(region.struct,model="besag",graph=g) +x
So, can you please send me the exact error message that you got when
you tried to run the problem. There are also some things that you can
check:
-- Is INLA updated? Use inla.update(testing=TRUE)
-- Is your graph file valid? Use inla.debug.graph()
-- Is the data frame in order?
Best wishes,
Dan