Hi,
I’m new into Bayesian analysis and I was trying to do a CAR model using brms. I was trying to replicate the results from the example with the Scotland Lip Cancer Dataset in https://mc-stan.org/users/documentation/case-studies/icar_stan.html, so I used these commands
Thanks. I’ve run the model without (1|name) and it gave me the same results, but if I run it without this term, I can’t get random effects estimates with ranef(fit)
I’m not a brms user so I can’t be much help with the best way to extract that term. I bet others who have used that could chime it with more help.
If you want that term specifically (rather than the sum of the spatially structured and unstructured parts, the entire BYM2 part) once you find the parameter you’re looking for you’ll probably also want to multiply it by its scale parameter and maybe use rho too, basically do some algebra to separate the spatial from the non-spatial term on the correct scale.
I’m working on an R package for spatial models that returns those parameters with the proper scaling etc as you’re looking for, though its a work in progress still.
@richard.turner If brms allows you to add an ICAR term to the model (not CAR and not BYM2), and then you decide to add the term (1|name) where name identifies each of your areal observations, then you have a common model specification (the BYM model). So in my opinion that’s not a bad choice (but just to be clear, I still don’t know much about brms).
If you’re using CAR or BYM2 instead of ICAR, then the term (1|name) is redundant.