Hello,
I’m fitting a Bayesian logistic regression in INLA with a BYM2 spatial random effect and an interaction between a continuous predictor (X) and a categorical moderator (Z). Epidemiologically, I need the stratum-specific effect of X within each level of Z (i.e., the “simple slope”). On the log-odds scale this is:
simple slope in level zj: βX + βX:Zj,
which I then exponentiate to report an odds ratio (OR) with a 95% credible interval (CrI).
Failed attempts:
1. lincomb at fit time
I attempted to pass a linear combination to obtain βX + βX:Zj directly from the fitted model. Despite matching coefficient names to summary.fixed, INLA returned: "lincomb ... has only zero entries. This is not allowed."
2. Post-hoc enabling of config/sampling.
I tried to add config=TRUE after fitting (so I could sample from the joint posterior of the fixed effects), but inla.rerun(...) doesn’t accept control.compute, so I couldn’t “upgrade” the object.
What’s the recommended, version-robust workflow in INLA to obtain the marginal of a linear combination of fixed effects (like βX+βX:Zj) when a BYM2 component is present?
Are there known quirks with lincomb for interaction coefficient names, and a canonical way to specify them?
Thank you,
Jared Palazza