Hi all,
I am trying to code an INLA model and need some help with specification and interpretation. The data are on insecticide use across 2500 counties in the US. The relationship I am most interested in is the overall, general relationship between insectHarv (insecticide use) and cHarv (landscape characteristics). The rest of the model is made up of covariates of lesser interest. I am struggling with the issue of how to allow for spatial variation in the insectHarv-cHarv relationship (acknowledging some non-stationarity). I have been reading about SVC models. Here is the formula I am working with:
formula1 <- insectHarv ~
1 + year + cCFV + cCorn + cSW + cInc + cGDD + cHF + cHarv +
f(id_area, model="besag", graph=counties1.adj) +
f(id_area1, year, model="ar1") +
f(id_area_year, model="iid") +
f(id_area2, cHarv, model="besag", graph=counties1.adj)
Here is my, quite possibly incorrect, interpretation:
The second line in the formula specifies the fixed effects. These include a fixed effect for year (there are four years of repeated measurements per study site), a bunch of fixed covariates, and a fixed effect for cHarv. Given the rest of the formula, I am thinking that this gives the overall weighted average effect of cHarv on insectHarv after accounting for a bunch of other stuff.
The third line accounts for the strong spatial autocorrelation within a year across sites not accounted for by the fixed effects, using a CAR model, where area_id is the identifier for each study site.
The fourth line accounts for the strong temporal autocorrelation across years within a site, using an AR1 model.
I don’t know what the fifth line does. I copied it from other INLA examples. But I imagine it allows for a space-time interaction of some sort. Any additional insight?
It is not clear to me what the final line does. I hope that it is related to spatially varying coefficients, in that it allows an estimate of local random variation in the insectHarv-cHarv relationship. The output of the model is:
Fixed effects:
mean sd
(Intercept) 0.2065 0.0039
year 0.0275 0.0039
cCFV 0.5758 0.0160
cCorn 0.4561 0.0163
cSW -0.0076 0.0112
cInc 0.0077 0.0015
cGDD 0.0153 0.0068
cHF 0.0192 0.0029
cHarv 0.0638 0.0176
Random effects:Name Modelid_area Besags ICAR model id_area1 AR1 model id_area_year IID model id_area2 Besags ICAR model Model hyperparameters: mean sd Precision for the Gaussian observations 321.2942 21.3716 Precision for id_area 78.3295 4.1063 Precision for id_area1 5366.5665 1394.9801 Rho for id_area1 0.9898 0.0033 Precision for id_area_year 321.2942 21.3716 Precision for id_area2 73.9471 31.4321
I interpret the last line in the fixed effects section to mean that there is an overall positive effect of cHarv on insectHarv. I interpret the last line in the hyperparameters section to mean that the overall positive effect of cHarv on insectHarv occurs despite some local variation in the relationship. I am thinking about these results in the same way that one would think about a random slopes model in a simpler mixed-model context. I wonder how far off I am.
Is there alignment between my model specification, results, and interpretation? THANKS A TON for any insight you have.
Best,
Tim
f(id_area1, year, model="ar1") +
f(id_area_year, model="iid") +
f(id_area2, cHarv, model="besag", graph=counties1.adj)
Thanks for your response, Elias! After reading your comments, I went back and reread chapters 6 and 7 in the INLA book, and modified the model. I think I now have something more sensible. Do you see any technical errors in the model below?
formula1 <- insectHarv ~ 1 + # y and b0
year + cCFV + cCorn + cSW + cInc + cGDD + cHF + cHarv + # overall fixed effects
f(id_area, model="bym", graph=counties1.adj) + # for spatial autocorr
f(id_area1, model="iid") + # for repeated measures
f(id_area2, cHarv, model="bym", graph=counties1.adj) + # spatial variation in cHarv
f(id_year, cHarv, model="iid") # temporal variation in cHarv
This model yields a posterior mean fixed effect estimate for cHarv of 0.0814. If I create a histogram (stem-and-leaf plot) like this:
stem(model1$summary.random$id_area2[,2] + 0.0814, scale=2)
I get this:
The decimal point is 2 digit(s) to the left of the |
-6 | 38661100
-4 | 8877443332211109999888777766555555555544444432222221110000
-2 | 99999998887777777776666666666666665555555555555544444444444444444444+187
-0 | 99999999999999998888888888888888888888888888888888888888777777777777+426
0 | 00000001111111111111111111111111111111222222222222222222222222222222+517
2 | 00000000000000000000000000001111111111111111111111222222222222222222+474
4 | 00000000000000000000000011111111111111111111111122222222222222222222+429
6 | 00000000000000000000000001111111111111111122222222222222222222333333+349
8 | 00000000000000000000000000000000011111111111111111111111111111111111+511
10 | 00000000000000000000000000000000000111111111111111111111111222222222+504
12 | 00000000000000000000000000111111111111111111111111111111111222222222+595
14 | 00000000000000000000000000000000000000000011111111111111111111111111+510
16 | 00000000000000000000000000011111111111111112222222222222222222223333+372
18 | 00000000000000000000111111111111112222222222222222223333333333333333+191
20 | 00000001111112222222222233333333333333333444445555667777778888999990+13
22 | 01222333344455678889908
24 | 03569
For the moment, ignore the fact that I added means to means. Does this represent the local variation in the cHarv slopes across space? Also, is it legitimate to map these values?
Similarly:
stem(model1$summary.random$id_year[,2] + 0.0814, scale=2)
The decimal point is 2 digit(s) to the left of the |
0 | 6
2 | 6
4 |
6 |
8 |
10 | 2
12 |
14 |
16 | 1
Does this represent the variation in the cHarv slopes over time?
Thanks so much for your help!
Best,
Tim


Am I right to think that the third random term will allow an estimate for variation in cHarv over space, independent of time?
Am I right to think that the fourth random term will allow an estimate for variation in cHarv over time, independent of space?
But when I run with constr=FALSE:
--
You received this message because you are subscribed to a topic in the Google Groups "R-inla discussion group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/r-inla-discussion-group/X_g4NuqqHfY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to r-inla-discussion...@googlegroups.com.
To post to this group, send an email to r-inla-disc...@googlegroups.com.
Visit this group at https://groups.google.com/group/r-inla-discussion-group.
For more options, visit https://groups.google.com/d/optout.