Variable Selection Methods and R-squared?

24 views
Skip to first unread message

Sheena Yoon

unread,
Dec 9, 2025, 3:22:23 PM (7 days ago) Dec 9
to R-inla discussion group
Hello, 

I am very new to the world of INLA but I am trying to understand all the ways to test for better model performance (WAIC), however what are the recommended ways to go about variable selection and a similar version of R-squared for INLA? So far, I have done multicollinearity checks (VIF) and eliminated variables as needed. Then I have run BMA/BAS on my 50+ predictor variables to eliminate not so meaningful variables, but this method seems to be partial given that it is not spatial by any means. As a way to fix that, I have removed the spatial autocorrelation from the response variable and re-ran the BAS to the spatially-adjusted response and predictors which improved the results somewhat...in the sense that they made more sense. But not sure if this is the best method...

I am running a poisson INLA model on areal data using the expected population count as my population offset (I adapt this example by Paul Moraga) and 30+ predictor variables that capture neighborhood effects ranging from environment to socio-economic to density of services. My response variable is a criminal justice population count. Any guidance on this would be so helpful, thank you! 


Håvard Rue

unread,
Dec 11, 2025, 2:11:45 AM (5 days ago) Dec 11
to Sheena Yoon, R-inla discussion group

In order to do variable selection (in the traditional way), you have to run each
possible subset and then 'select' or order, aftwards.

to do this, it might be useful to use the formulation

formula = y ~ 1 + X

where X is a matrix of covariates. this will internally expanded into

y ~ 1 + x1 + x2 + ...

where x1 is the first column of X, etc.


there is no automtic way of doing this as of now.

you can use, f.ex

> combinat::combn(5,2)
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 1 1 1 2 2 2 3 3 4
[2,] 2 3 4 5 3 4 5 4 5 5


to generate all subsets
> --
> 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, visit
> https://groups.google.com/d/msgid/r-inla-discussion-group/7f93a14c-4ff4-459a-893a-e3fb163332ban%40googlegroups.com
> .

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