I've seen discussions but no answer was really helpful.
ID = 1:2644
formula_bym = shape_02$patients_total ~ 1 + f(ID, model="bym", graph = "neighbours.adj", constr=TRUE, scale.model=TRUE)
m05_inla_bym = inla(formula_bym, family="poisson", data=as.data.frame(shape_02), E=shape_02$expected)
And later on I've tried to add a covariate:
formula_bym_a = shape_02$patients_total ~ 1 + f(ID, model="bym", graph = m05a_inla_bym = inla(formula_bym_a, family="poisson", data=as.data.frame(shape_02), E=shape_02$expected)
However, the results are a bit confusing.
For both models, m05a_inla_bym$summary.fitted.values returns "data frame with 0 columns and 0 rows" and m05a_inla_bym$marginals.fitted.values returns "NULL".
From my understanding so far, m05a_inla_bym$summary.fixed can give me "alpha" and "beta". For the random effects I get the dataframe m05a_inla_bym$summary.random$ID but it has 2n rows. From my understanding, to compute the prediction, I should manually take the first n rows and just follow the INLA formula? it's really surprising not to have a function which does it automatically.
Thanks
Alan