I'm starting to work on a new study where my interest is showing spatial migration of odds over time. Briefly, it's around 30,000 tests with 8000 positives performed on 17,000 patients, and I have coordinate pairs for all of them.
Ordinarily if the temporal component weren't included I'd do
brm( result ~ s( lat , long ) + covariates + ( 1 | ID ), family = "Bernoulli" , data=dat )
In this case I'm adding the random intercept for individual ID to account for individuals who have been tested multiple times (is that the correct syntax and rationale btw?)
However for this project I suspect that the odds of result will migrate over the lat/long field, so I want to put in some sort of temporal hierarchical structure. I can't, however, really consider this like a longitudinal study where the same subjects are tested repeatedly - my lat / long structure is really a whole random field and not individual units like counties that have repeated count data.
I have actual dates of tests, but could I put in a term like ( 1 | month / year ) or ( 1 | month / quarter / year ) for temporal nesting? Do I need to change the correlation structure for the model? Can I then predict odds vs lat/long for each of these time slices and show an animation of how odds temporally migrate over space?
Thanks!