spatiotemporal hierarchical model

92 views
Skip to first unread message

Paul Lantos

unread,
Sep 25, 2017, 11:30:55 AM9/25/17
to brms-users
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!

Paul Buerkner

unread,
Sep 25, 2017, 11:44:32 AM9/25/17
to Paul Lantos, brms-users
If you have some temporal component in your model, it might make sense to for for

s( lat , long, time)

instead of

s( lat , long )

Not sure thought if this is reasonable for your particular data at hand.

--
You received this message because you are subscribed to the Google Groups "brms-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brms-users+unsubscribe@googlegroups.com.
To post to this group, send email to brms-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/brms-users/60aaf7f6-b160-47e0-82cb-76ecca033f1c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Paul Lantos

unread,
Sep 25, 2017, 11:56:36 AM9/25/17
to brms-users
Interesting, or if I've got nested time data (like month and year) could I do -

s( lat , long , month/year ) ? 

The only reservation I have is that lat and long are meant to be a 2-dimensional isotropic smooth, so should time be part of that or in a different smoothing function?

I could decompose time into days -- it's 6 full years of data, but I could just count from day 1 through day n and make it a single integer for time.

How could I narrow down to individual slices of time with this approach? Say I wanted a sequence of maps or an animation showing how odds vary over lat/long over time, can that be pulled out of a smooth like that?



On Monday, September 25, 2017 at 11:44:32 AM UTC-4, Paul Buerkner wrote:
If you have some temporal component in your model, it might make sense to for for

s( lat , long, time)

instead of

s( lat , long )

Not sure thought if this is reasonable for your particular data at hand.
2017-09-25 17:30 GMT+02:00 Paul Lantos <paul....@gmail.com>:
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!

--
You received this message because you are subscribed to the Google Groups "brms-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brms-users+...@googlegroups.com.

Paul Lantos

unread,
Sep 25, 2017, 12:11:22 PM9/25/17
to brms-users
I can imagine predicting to a grid of lat | long | time , but I don't see how I can specify the size of the time window in that prediction.

Paul Buerkner

unread,
Sep 25, 2017, 12:31:54 PM9/25/17
to Paul Lantos, brms-users
Depending on the resolution of time, you might use either year or month or day (probably go for the finest resolution, where you have reasonable variation).

In the prediction, you could then specify the time at which the lat | long part should be evaluated.

To unsubscribe from this group and stop receiving emails from it, send an email to brms-users+unsubscribe@googlegroups.com.

To post to this group, send email to brms-...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages