Interpreting the BYM2 model output, random effects phi and precision

1,069 views
Skip to first unread message

Jonathan Simkin

unread,
Jul 19, 2022, 6:59:17 PM7/19/22
to R-inla discussion group
Hi there,

I wanted to confirm my interpretation of the BYM2 model output, in particular the random effects Phi and Precision. I've read the Riebler et al paper and Chapter 3.3 from https://becarioprecario.bitbucket.io/inla-gitbook/ch-mixed.html, but it's not entirely clear to me! Information on my model and output below.

I am currently modelling lung cancer risk at an area level (n=218) with BYM2 including a fixed effect for area level air pollution (measured as continuous variable in concentration (micrograms per meters cubed)).

My prior and formula settings below:
#prior settings
prior <- list(
  prec = list(
    prior = "pc.prec",
    param = c(0.2 / 0.31, 0.01),
    initial = 5),
  phi = list(
    prior = "pc",
    param = c(0.5, 2 / 3),
    initial = -3)
)
#graph
g <- inla.read.graph(filename = "area_weights.adj")

#formula
formula_res_pm <- cases ~ air_pollution + f(idarea,
                         model = "bym2",
                         graph = g,
                         constr = T,
                         hyper = prior,
                         scale.model = T)
#fit model
res_pm <- inla(formula_res_pm,
            family = "poisson", data = my_data,
            E = exp, control.predictor = list(compute = TRUE),
            control.compute = list(dic=TRUE, mlik=TRUE,cpo=TRUE, config = T, waic = T),
            control.inla = list(strategy = "laplace", npoints = 21))

My output here below
Fixed effects:
                         mean    sd 0.025quant 0.5quant 0.975quant   mode kld
(Intercept).     -0.218 0.124     -0.462   -0.218      0.026 -0.218   0
air_pollution    0.039 0.021     -0.003    0.039      0.080  0.039   0

Random effects:
  Name      Model
    idarea BYM2 model

Model hyperparameters:
                                     mean    sd 0.025quant 0.5quant 0.975quant   mode
Precision for idarea  14.177 1.970     10.706   14.040      18.44 13.772
Phi for idarea             0.124 0.088      0.017    0.102       0.35  0.051

Deviance Information Criterion (DIC) ...............: 1575.57
Deviance Information Criterion (DIC, saturated) ....: 1535.38
Effective number of parameters .....................: 152.27

Watanabe-Akaike information criterion (WAIC) ...: 1557.64
Effective number of parameters .................: 99.39

Marginal log-Likelihood:  -780.38

My interpretation:
Intercept: If all fixed effect values were at zero, the posterior mean relative risk of an area would be 0.11
Fixed effect for air pollution: For every one-unit increase in my fixed effect, there is a e^0.039 (or posterior mean of 1.039) increased risk of lung cancer at the area level.  
Random Effect Phi of idarea: the posterior median spatial effect was 0.102, the proportion of variation in the modelled relative risks was 10.2% (given the skewed distribution of the spatial effect I'll take the median).
Random Effect Precision for idarea: This one I have trouble interpreting.. I understand that the precision is the inverse of variance and so high precision mean low variance and vice versa. But not entirely sure how to interpret this value in relation to it's function here, which to my understanding is accounting for extra-poisson variation (overdispersion). I've read that low values (high variance) indicates overdispersion and when values increase, the iid term is accounting for the overdispersion. But what would be the reference for high and low values?

Beth S

unread,
Sep 14, 2023, 12:18:49 AM9/14/23
to R-inla discussion group
Hi,


Was this ever responded to? I am also having difficulty finding a resource that explains the interpretation of the random effects (spatial) so would be keen on seeing the response to this - or reading any resources that may be available. Thank you! 

Helpdesk (Haavard Rue)

unread,
Sep 14, 2023, 5:13:59 AM9/14/23
to Beth S, R-inla discussion group
On Wed, 2023-09-13 at 21:18 -0700, Beth S wrote:
Hi,


Was this ever responded to? I am also having difficulty finding a resource that explains the interpretation of the random effects (spatial) so would be keen on seeing the response to this - or reading any resources that may be available. Thank you! 


yes, its 'log'-relative risk. it might be non-zero as the 'air_pollution' covariate might not be centered, so its easier if you adjust that one.

Fixed effect for air pollution: For every one-unit increase in my fixed effect, there is a e^0.039 (or posterior mean of 1.039) increased risk of lung cancer at the area level.  

yes

Random Effect Phi of idarea: the posterior median spatial effect was 0.102, the proportion of variation in the modelled relative risks was 10.2% (given the skewed distribution of the spatial effect I'll take the median).

This parameter gives how the variance is distributed, if has spatial structure or just iid. see the documentation, inla.doc("bym2")



Random Effect Precision for idarea: This one I have trouble interpreting.. I understand that the precision is the inverse of variance and so high precision mean low variance and vice versa. But not entirely sure how to interpret this value in relation to it's function here, which to my understanding is accounting for extra-poisson variation (overdispersion). I've read that low values (high variance) indicates overdispersion and when values increase, the iid term is accounting for the overdispersion. But what would be the reference for high and low values?

This is the precision (which is 1/variance) for the random effect (the sum of spatial + iid, the phi parameter says how that variance is distributed between the two components). 

you can convert the distribution to variance or stdev if you like, similar to this

r=inla(y~1,data=data.frame(y=0))
m.sd = inla.tmarginal(function(x) exp(-x/2),r$internal.marginals.hyperpar[[1]])




--
You received this message because you are subscribed to the Google Groups "R-inla discussion group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to r-inla-discussion...@googlegroups.com.

-- 
Håvard Rue
he...@r-inla.org
Reply all
Reply to author
Forward
0 new messages