Many thanks for your replies.
I followed the suggestion to include the PC prior with the parameters suggested. This allowed me to increase the sample to 160,000 persons - so indeed an enhancement (still far from the 1.6 million I need to run the analysis for). However, when I try to tun the model with more than that it still crashes. I also ensured that each variable is numeric. The largest possible subset of 160,000 rows consumes about 20GB of RAM, so I still have plenty available from my 256 GB in total.
I have tried for several hours now different combinations e.g. less variables, with iid prior and without, binary explanatory variables coded as numeric or factor etc. but for a large number of rows the model still crashes quite early on. The last thing INLA tries is to do is the Gaussian approximation before it crashes.
Is there anything else I could try to make it work?
@Dr. Rue, many thanks for the offer - the code I ultimately used now is below. This one worked for 160,000 rows. Unfortunately, I cannot share the data itself as privacy protection restricts the distribution of the data - is there any other way for you to get a closer look?
model_svc <- inla(DISEASE ~ 1 +
f(idx1, female, constr = TRUE, model = "besag",
graph = "graph_v3", scale.model = T, hyper = list(theta = list(prior="pc.prec", param=c(1,0.01)))) +
f(idx2, age, constr = TRUE, model = "besag",
graph = "graph_v3", scale.model = T, hyper = list(theta = list(prior="pc.prec", param=c(1,0.01)))) +
f(idx3, unemployed, constr = TRUE, model = "besag",
graph = "graph_v3", scale.model = T, hyper = list(theta = list(prior="pc.prec", param=c(1,0.01)))) +
f(idx4, migration_background, constr = TRUE, model = "besag",
graph = "graph_v3", scale.model = T, hyper = list(theta = list(prior="pc.prec", param=c(1,0.01)))) +
f(idx5, p_one-person-households, constr = TRUE, model = "besag",
graph = "graph_v3", scale.model = T, hyper = list(theta = list(prior="pc.prec", param=c(1,0.01)))) +
f(idx6, nr_of_previous_diseases_Er, constr = TRUE, model = "besag",
graph = "graph_v3", scale.model = T, hyper = list(theta = list(prior="pc.prec", param=c(1,0.01)))) +
f(idx7, GPs_available, constr = TRUE, model = "besag",
graph = "graph_v3", scale.model = T, hyper = list(theta = list(prior="pc.prec", param=c(1,0.01)))),
f(idx8, model = "iid", hyper = list(theta = list(prior="pc.prec", param=c(1,0.01)))),
family = "binomial", data=daten1, control.compute = list(dic=T),
control.inla = list(diagonal = 10000, strategy = "gaussian", int.strategy = "eb"), verbose = TRUE)
Many thanks in advance,
Boris