Interpretation of change in fixed effects after including spatial random effect

167 views
Skip to first unread message

dario elias

unread,
May 24, 2023, 3:00:17 PM5/24/23
to R-inla discussion group

Hello all,


I am working with a logistic regression model.

First I ran the model with only fixed effects, and then I ran it including the spatial autocorrelation as a random effect (SPDE). Some of the fixed effect variables are binary and others are continuous (standardized).


Between both models the fixed effect A varies considerably. In the model without the random variable the mean is 0.026 and the credible interval includes the zero value (-0.608, 0.659). While in the model with random effect the mean is 1.140 and the credible interval does not include the zero value (0.169 , 2.166).


How can one interpret the change in the fixed effect A between both models? Is there a graphic I can make to help in the interpretation?


In the model with random effect, would the coefficient of the fixed effect A indicate the effect of A on the outcome variable when the other fixed effects take the value 0 and there is no spatial autocorrelation?


Thank you for your valuable time

Dario



Model without random effect:

Fixed effects:

                mean sd 0.025quant 0.5quant 0.975quant   mode kld

Intercept    -2.276 0.354 -2.970   -2.276 -1.582 -2.276   0

A   0.026 0.323 -0.608 0.026  0.659  0.026   0

B     0.428 0.117  0.199 0.428  0.656  0.428   0

C         0.936 0.290  0.369 0.936  1.504  0.936   0

D         0.123 0.132 -0.134 0.123  0.381  0.123   0

E             -0.155 0.157 -0.462   -0.155  0.152 -0.155   0

F         0.107 0.140 -0.167 0.107  0.382  0.107   0

G              0.086 0.132 -0.172 0.086  0.344  0.086   0

H             -0.369 0.260 -0.879   -0.369  0.142 -0.369   0

I              0.017 0.116 -0.211 0.017  0.245  0.017   0

J              0.091 0.117 -0.138 0.091  0.320  0.091   0

K              0.038 0.250 -0.452 0.038  0.527  0.038   0


Deviance Information Criterion (DIC) ...............: 510.81

Deviance Information Criterion (DIC, saturated) ....: 510.81

Effective number of parameters .....................: 11.12


Watanabe-Akaike information criterion (WAIC) ...: 511.34

Effective number of parameters .................: 11.10


Marginal log-Likelihood:  -307.52




Model with random effect:

Fixed effects:

                mean sd 0.025quant 0.5quant 0.975quant   mode kld

Intercept    -3.455 0.628 -4.771   -3.428 -2.294 -3.382   0

A     1.140 0.509  0.169 1.131  2.166  1.113   0

B     0.513 0.140  0.241 0.512  0.791  0.510   0

C         0.983 0.344  0.312 0.981  1.662  0.978   0

D         0.121 0.151 -0.177 0.121  0.416  0.122   0

E             -0.096 0.192 -0.472   -0.096  0.282 -0.097   0

F         0.073 0.179 -0.278 0.073  0.425  0.073   0

G              0.083 0.181 -0.275 0.084  0.436  0.085   0

H             -0.480 0.371 -1.219   -0.477  0.238 -0.470   0

I             -0.019 0.144 -0.303   -0.019  0.262 -0.018   0

J              0.141 0.142 -0.136 0.141  0.420  0.140   0

K              0.155 0.293 -0.418 0.154  0.732  0.152   0


Random effects:

  Name      Model

spatial SPDE2 model


Model hyperparameters:

                        mean   sd 0.025quant 0.5quant 0.975quant mode

Range for spatial.field 6911.26 3009.318 3228.75  6210.92   14731.19 5020.16

Stdev for spatial.field 1.78 0.395   1.15 1.73   2.70 1.63


Deviance Information Criterion (DIC) ...............: 451.33

Deviance Information Criterion (DIC, saturated) ....: 451.33

Effective number of parameters .....................: 54.22


Watanabe-Akaike information criterion (WAIC) ...: 450.50

Effective number of parameters .................: 46.79


Marginal log-Likelihood:  -289.02

Finn Lindgren

unread,
May 24, 2023, 6:12:35 PM5/24/23
to dario elias, R-inla discussion group
Hi,
In short, the two models are different, so the interpretation of the “effect of” A is different.. Most likely there is a spatial pattern in the data that is only partially captured by A, and when you include a random field that captures some of that pattern.  I’d suggest looking at spatial plots and residuals for the two models, to see if adding the random field reduces the spatial pattern structure in the residuals.

Finn

On 24 May 2023, at 20:00, dario elias <darioezeq...@gmail.com> wrote:


--
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.
To view this discussion on the web, visit https://groups.google.com/d/msgid/r-inla-discussion-group/35a0f7f6-3677-4cb1-be0c-3109dc66d4cdn%40googlegroups.com.

dario elias

unread,
May 25, 2023, 11:24:31 AM5/25/23
to Finn Lindgren, R-inla discussion group

Hello Finn, thank you very much for your answer.


I will see the analysis that you suggested.


However, I still don't fully understand how to interpret the coefficient of the fixed effect in the model with the random field.


In both models, the exponential of the coefficient of the variable A would be the odds ratio of A for the response variable, right?


As far as I understand, in logistic regression without the random effect, the exponential of the fixed effect coefficient A indicates the odds ratio of variable A when the other variables have the value 0.


But, how is this coefficient interpreted in logistic regression with the random field?  Would the exponential of the coefficient of the fixed effect A indicate the odds ratio of variable A when the other fixed effects take the value 0 and there is no spatial autocorrelation? If not, how is the interpretation?


Again, thank you very much for your time.

Dario

Finn Lindgren

unread,
May 25, 2023, 11:41:26 AM5/25/23
to dario elias, R-inla discussion group
Hi,

The interpretation most likely would depend on the nature of the
covariate; binary/continuous/geospatial or individual/etc.
If binary, and the model is
E(y|model) = exp(beta_A * A + other + components)
then
E(y|model, A=1) / E(y|model, A=0) = exp(beta_A)
assuming all other components are _unchanged_; they don't need to be zero.
I think that's the odd-ratio type interpretation you describe?

_However_:
If the covariate is inherently _spatial_, then the values of the other
components, in particular any random field, _cannot_ be unchanged,
since they would both depend on location, so this interpretation
doesn't really work.
This is an intrinsic problem with all complex structured models; the
simplistic interpretations from completely independent observation
models don't necessarily work anymore.
What I tend to do is to figure out what well-defined quantity I'm
interested in, and then compute that; this often involves computing
functionals of the model components, and not just the basic parameter
estimates.
E.g. the "intercept" is often not a good representation of the
"spatial average". To get to the actual spatial average, I'd compute
the posterior distribution of the integration average of
exp(predictor) instead.

Finn
--
Finn Lindgren
email: finn.l...@gmail.com

Helpdesk (Haavard Rue)

unread,
May 30, 2023, 2:28:17 AM5/30/23
to dario elias, R-inla discussion group

You might find this one useful

https://academic.oup.com/jrsssc/article/68/3/543/7058400?login=true


the confounding issue is non-solvable and we have to live with it and
try to get better dealing with it.
> --
> 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.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/r-inla-discussion-group/35a0f7f6-3677-4cb1-be0c-3109dc66d4cdn%40googlegroups.com
> .

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