Hi,
I would like to calculate the (standardized) residuals from a model in INLA (random and spatial effects). My response has some NA values. I've tried a couple of functions, but because of the NAs and model complexity, I've encountered problems. I have given the functions I've used to calculate the residuals, and a short snippet of my model output. Would you kindly help with this? Thank you!
This gives problems with NAs when calculating the stand. dev. Removing NA's gives a large range of standardized residuals (e.g., 10 to -20), instead of within between -3 to 3., although most of
3. ri = ei / s(ei) (where ei: The ith residual); by removing the NAs when calculating
A snippet of inla results:
Time used:
Pre = 10.1, Running = 4844, Post = 2.51, Total = 4856
Fixed effects:
mean sd 0.025quant 0.5quant 0.975quant mode kld
road_coverAb:AADT1 4.349 0.128 4.097 4.349 4.601 NA 0
road_coverAgb:AADT1 4.671 0.112 4.452 4.671 4.890 NA 0
road_coverSka:AADT1 2.017 0.074 1.872 2.017 2.162 NA 0
AADT1:rut_depth2 0.353 0.018 0.317 0.353 0.389 NA 0
AADT1:width2 -0.078 0.012 -0.103 -0.078 -0.054 NA 0
AADT1:slope2 -0.042 0.060 -0.160 -0.042 0.076 NA 0
Random effects:
Name Model
year IID model
spatial.field.group SPDE2 model
spatial.field.2011 SPDE2 model
spatial.field.2012 SPDE2 model
spatial.field.2013 SPDE2 model
spatial.field.2014 SPDE2 model
spatial.field.2015 SPDE2 model
spatial.field.2016 SPDE2 model
spatial.field.2017 SPDE2 model
spatial.field.2018 SPDE2 model
spatial.field.2019 SPDE2 model
spatial.field.2020 SPDE2 model
Model hyperparameters:
mean sd 0.025quant 0.5quant 0.975quant mode
Precision for the Gaussian observations 0.527 0.003 0.520 0.527 5.34e-01 NA
Precision for year 3.918 1.050 2.058 3.847 6.14e+00 NA
Range for spatial.field.group 229.518 15.820 200.233 228.847 2.63e+02 NA
Stdev for spatial.field.group 0.490 0.020 0.452 0.490 5.29e-01 NA
Range for spatial.field.2011 96.043 7.242 82.583 95.764 1.11e+02 NA
Stdev for spatial.field.2011 1.605 0.048 1.513 1.604 1.70e+00 NA
Range for spatial.field.2012 1552.903 283.419 1079.323 1523.861 2.19e+03 NA
Stdev for spatial.field.2012 1.101 0.108 0.904 1.095 1.33e+00 NA
Natoya