Question about standardizing continuous covariates in INLA

255 views
Skip to first unread message

KB

unread,
Oct 30, 2021, 3:56:39 PM10/30/21
to R-inla discussion group
Hi,

I have a few questions about standardizing continuous covariates in R-INLA models that I am hoping someone could offer some advice.

I am running several spatial models in R-INLA using the SPDE approach. When I run the model with the covariate listed as "Z" below, I get the following result, which has  really small values for covariate "Z".

                       mean             sd        0.025quant     0.5quant         0.075quant    mode    
 Intercept           2.644        0.104       2.441                2.644               2.848        2.644
X   (mm)             0.064        0.003       0.058               0.064                0.069        0.064   
Y   (degrees C)  -0.021      0.002       -0.024               -0.021               -0.017      -0.021              Z     (m)               0.000        0.000      -0.001                 0.000              0.000        0.000     

I read in Zuur that not standardizing covariates can lead to numerical estimates that are small and can also result in numerical problems if the covariates are not on the same scale.  I tried standardizing all the the covariates, and I received the following result.

                             mean       sd              0.025quant     0.5quant         0.075quant    mode     
Intercept             2.487     0.076            2.337                  2.487           2.636            2.488
X (mm)                0.105      0.005           0.096                 0.105             0.114            0.105
Y (degrees C)     -0.079      0.007           -0.093               -0.079             -0.065           -0.079
Z (m)                   -0.038      0.015           -0.068               -0.038               -0.008           -0.038  

I am planning on submitting the manuscript with these results to be considered for publication and have the following questions.

1) Based on these results, should I standardize the covariates in the models? 

2) Should I standardize all of the covariates or just covariate "Z"?

3) When doing model selection based on DIC, can I use the standardized covariates to select the top model or should I use the unstandardized ones? I notice that my top models are different when I analyze my dataset using standardized vs. unstandardized covariates, especially for the models that have covariate "Z". When standardized, the model with covariate "Z" becomes among the top models, but is not when it is not standardized.  

I also noticed that when I run another model with a different covariate not listed here, that using the unstandardized covariates, it gives me a Hessian warning that affects the accuracy of the hyperparameter, but I don't get this message when I standardize all of the covariates in the models.

Thanks,

Kristin
 

Helpdesk

unread,
Oct 30, 2021, 4:31:35 PM10/30/21
to KB, R-inla discussion group

to put it differently, if you do not standardise the covariates, then
you need the prior for each coefficient to depend on the covariate.
hence better to standarise them

although you can do

z.std = scale(z)

any reasonable scaling will do, especially if you want easier
interpretability for the effect.

yes, you can crash INLA internally using badly scaled covariates (that
is no problem...)
> --
> 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/1ec4accf-111d-4ae9-9c20-7d6a9da2b965n%40googlegroups.com
> .

--
Håvard Rue
he...@r-inla.org

KB

unread,
Oct 31, 2021, 3:39:55 PM10/31/21
to R-inla discussion group
Hi  Håvard,

Thanks so much for the clarification. That helps a lot.

- Kristin

Reply all
Reply to author
Forward
0 new messages