Epidemiology, Biostatistics and Prevention Institute
Spatio-Temporal Analysis of Epidemic Phenomena Using the R Package s✉r✈❡✐❧❧❛♥❝❡
Sebastian Meyer
the R Package sr Sebastian Meyer Epidemic phenomena Examples: - - PowerPoint PPT Presentation
Epidemiology, Biostatistics and Prevention Institute Spatio-Temporal Analysis of Epidemic Phenomena Using the R Package sr Sebastian Meyer Epidemic phenomena Examples: Earth quakes Riots / crimes
Epidemiology, Biostatistics and Prevention Institute
Sebastian Meyer
useR! 2015, Spatial Session 1 July 2015 s✉r✈❡✐❧❧❛♥❝❡: Spatio-Temporal Analysis of Epidemic Phenomena Page 2
❧✐❜r❛r②✭✧s✉r✈❡✐❧❧❛♥❝❡✧✮❀ ❞❛t❛✭✧✐♠❞❡♣✐✧✮
♣❧♦t✭✐♠❞❡♣✐✱ ✧s♣❛❝❡✧✮
B C
2 4 8 16
Dot size proportional to the number of cases (residence postcode) ♣❧♦t✭✐♠❞❡♣✐✱ ✧t✐♠❡✧✮
2002 2004 2006 2008 5 10 15 20 Time (months) Number of cases 84 168 252 336 Cumulative number of cases
B C
Monthly and cumulative number of cases (by date of specimen sampling)
useR! 2015, Spatial Session 1 July 2015 s✉r✈❡✐❧❧❛♥❝❡: Spatio-Temporal Analysis of Epidemic Phenomena Page 3
❛♥✐♠❛t❡✭s✉❜s❡t✭✐♠❞❡♣✐✱ t②♣❡❂❂✧❇✧✮✱ t✐♠❡✳s♣❛❝✐♥❣ ❂ ✼✮ ❛♥✐♠❛t❡✭s✉❜s❡t✭✐♠❞❡♣✐✱ t②♣❡❂❂✧❈✧✮✱ t✐♠❡✳s♣❛❝✐♥❣ ❂ ✼✮
useR! 2015, Spatial Session 1 July 2015 s✉r✈❡✐❧❧❛♥❝❡: Spatio-Temporal Analysis of Epidemic Phenomena Page 4
❧✐❜r❛r②✭✧s✉r✈❡✐❧❧❛♥❝❡✧✮❀ ❞❛t❛✭✧♠❡❛s❧❡s❲❡s❡r❊♠s✧✮
♣❧♦t✭♠❡❛s❧❡s❲❡s❡r❊♠s✱ t②♣❡ ❂ ♦❜s❡r✈❡❞ ⑦ ✉♥✐t✮
2001/1 − 2002/52
036 100 196 324 400 484 576 676
♣❧♦t✭♠❡❛s❧❡s❲❡s❡r❊♠s✱ t②♣❡ ❂ ♦❜s❡r✈❡❞ ⑦ t✐♠❡✮
time
2001 II 2001 IV 2002 II 2002 IV 10 20 30 40 50 60 useR! 2015, Spatial Session 1 July 2015 s✉r✈❡✐❧❧❛♥❝❡: Spatio-Temporal Analysis of Epidemic Phenomena Page 5
❛♥✐♠❛t❡✭♠❡❛s❧❡s❲❡s❡r❊♠s✮
useR! 2015, Spatial Session 1 July 2015 s✉r✈❡✐❧❧❛♥❝❡: Spatio-Temporal Analysis of Epidemic Phenomena Page 6
useR! 2015, Spatial Session 1 July 2015 s✉r✈❡✐❧❧❛♥❝❡: Spatio-Temporal Analysis of Epidemic Phenomena Page 7
useR! 2015, Spatial Session 1 July 2015 s✉r✈❡✐❧❧❛♥❝❡: Spatio-Temporal Analysis of Epidemic Phenomena Page 7
s♣❛❝❡t✐♠❡: Basic classes and methods for spatio-temporal data s♣❛tst❛t: THE package for purely spatial point patterns ts❝♦✉♥t, ❊♣✐❊st✐♠, ♦✉t❜r❡❛❦❡r, ❛♠❡✐: Several packages dealing with purely temporal epidemic data st♣♣: Simulation & visualization of space-time point patterns
For a more complete picture: → CRAN task view “Handling and Analyzing Spatio-Temporal Data”
useR! 2015, Spatial Session 1 July 2015 s✉r✈❡✐❧❧❛♥❝❡: Spatio-Temporal Analysis of Epidemic Phenomena Page 8
Data Resolution Example Model Function individual events in continuous space-time cases of invasive meningococcal disease (IMD) Meyer et al., 2012 spatio-temporal point process t✇✐♥st✐♠✭✮ event counts aggregated in space & time week×district counts of measles Meyer et al., 2014 multivariate NegBin time series ❤❤❤✹✭✮ individual SIR event history of a fixed population spread of classi- cal swine fever among domes- tic pig farms Höhle, 2009 multivariate temporal point process t✇✐♥❙■❘✭✮
useR! 2015, Spatial Session 1 July 2015 s✉r✈❡✐❧❧❛♥❝❡: Spatio-Temporal Analysis of Epidemic Phenomena Page 9
Stochastic branching process with immigration
Endemic: seasonality, population, socio-demography, . . .
Epidemic: force of previously infected individuals
useR! 2015, Spatial Session 1 July 2015 s✉r✈❡✐❧❧❛♥❝❡: Spatio-Temporal Analysis of Epidemic Phenomena Page 10
Everything is related to everything else, but near things are more related than distant things.
The distribution of travelling distances decays as a power law.
500 1000 2000 3000
f(x) = x−1.6 Distance x
1 5 50 500
log(f(x)) = −1.6 ⋅ log(x) Distance x
2 3 4 3 1 3 2 3 2 4 2 1 3 2 1 3
0.0 0.2 0.4 0.6 0.8 1.0
useR! 2015, Spatial Session 1 July 2015 s✉r✈❡✐❧❧❛♥❝❡: Spatio-Temporal Analysis of Epidemic Phenomena Page 11
Regression framework for the conditional intensity function
Endemic component – Piecewise constant on a suitable space-time grid – Explanatory variables in a log-linear predictor ν[s][t] – Equivalent to Poisson-GLM for aggregated counts ♥❧♠✐♥❜✭✮ ♣♦❧②❈✉❜
useR! 2015, Spatial Session 1 July 2015 s✉r✈❡✐❧❧❛♥❝❡: Spatio-Temporal Analysis of Epidemic Phenomena Page 12
Regression framework for the conditional intensity function
Endemic component – Piecewise constant on a suitable space-time grid – Explanatory variables in a log-linear predictor ν[s][t] – Equivalent to Poisson-GLM for aggregated counts Force of infection – Depends on event-specific characteristics mj via log(ηj) = γ0 + γ⊤mj – Decays over space/time according to parametric interaction function f(·)/g(·) ♥❧♠✐♥❜✭✮ ♣♦❧②❈✉❜
useR! 2015, Spatial Session 1 July 2015 s✉r✈❡✐❧❧❛♥❝❡: Spatio-Temporal Analysis of Epidemic Phenomena Page 12
Regression framework for the conditional intensity function
Endemic component – Piecewise constant on a suitable space-time grid – Explanatory variables in a log-linear predictor ν[s][t] – Equivalent to Poisson-GLM for aggregated counts Force of infection – Depends on event-specific characteristics mj via log(ηj) = γ0 + γ⊤mj – Decays over space/time according to parametric interaction function f(·)/g(·) Likelihood inference – ♥❧♠✐♥❜✭✮ with analytical score function and Fisher info – R package ♣♦❧②❈✉❜ for cubature of f(s) over polygons
useR! 2015, Spatial Session 1 July 2015 s✉r✈❡✐❧❧❛♥❝❡: Spatio-Temporal Analysis of Epidemic Phenomena Page 12
Model estimation
✐♠❞❢✐t ❁✲ t✇✐♥st✐♠✭ ❡♥❞❡♠✐❝ ❂ ⑦♦❢❢s❡t✭❧♦❣✭♣♦♣❞❡♥s✐t②✮✮ ✰ ■✭st❛rt✴✸✻✺ ✲ ✸✳✺✮ ✰ s✐♥✭✷ ✯ ♣✐ ✯ st❛rt✴✸✻✺✮ ✰ ❝♦s✭✷ ✯ ♣✐ ✯ st❛rt✴✸✻✺✮✱ ❡♣✐❞❡♠✐❝ ❂ ⑦t②♣❡ ✰ ❛❣❡❣r♣✱ s✐❛❢ ❂ s✐❛❢✳♣♦✇❡r❧❛✇✭✮✱ t✐❛❢ ❂ t✐❛❢✳❝♦♥st❛♥t✭✮✱ ❞❛t❛ ❂ ✐♠❞❡♣✐✱ s✉❜s❡t ❂ ✦✐s✳♥❛✭❛❣❡❣r♣✮✱ st❛rt ❂ ❝✭✧❡✳✭■♥t❡r❝❡♣t✮✧❂✲✻✳✺✱ ✧❡✳s✐❛❢✳✶✧❂✶✳✺✱ ✧❡✳s✐❛❢✳✷✧❂✵✳✾✮✱ ♦♣t✐♠✳❛r❣s ❂ ❧✐st✭❢✐①❡❞ ❂ ✧❡✳s✐❛❢✳✶✧✮✱ ♠♦❞❡❧ ❂ ❚❘❯❊✱ ❝♦r❡s ❂ ✹✮ ①t❛❜❧❡✭✐♠❞❢✐t✮
useR! 2015, Spatial Session 1 July 2015 s✉r✈❡✐❧❧❛♥❝❡: Spatio-Temporal Analysis of Epidemic Phenomena Page 13
Model estimation
✐♠❞❢✐t ❁✲ t✇✐♥st✐♠✭ ❡♥❞❡♠✐❝ ❂ ⑦♦❢❢s❡t✭❧♦❣✭♣♦♣❞❡♥s✐t②✮✮ ✰ ■✭st❛rt✴✸✻✺ ✲ ✸✳✺✮ ✰ s✐♥✭✷ ✯ ♣✐ ✯ st❛rt✴✸✻✺✮ ✰ ❝♦s✭✷ ✯ ♣✐ ✯ st❛rt✴✸✻✺✮✱ ❡♣✐❞❡♠✐❝ ❂ ⑦t②♣❡ ✰ ❛❣❡❣r♣✱ s✐❛❢ ❂ s✐❛❢✳♣♦✇❡r❧❛✇✭✮✱ t✐❛❢ ❂ t✐❛❢✳❝♦♥st❛♥t✭✮✱ ❞❛t❛ ❂ ✐♠❞❡♣✐✱ s✉❜s❡t ❂ ✦✐s✳♥❛✭❛❣❡❣r♣✮✱ st❛rt ❂ ❝✭✧❡✳✭■♥t❡r❝❡♣t✮✧❂✲✻✳✺✱ ✧❡✳s✐❛❢✳✶✧❂✶✳✺✱ ✧❡✳s✐❛❢✳✷✧❂✵✳✾✮✱ ♦♣t✐♠✳❛r❣s ❂ ❧✐st✭❢✐①❡❞ ❂ ✧❡✳s✐❛❢✳✶✧✮✱ ♠♦❞❡❧ ❂ ❚❘❯❊✱ ❝♦r❡s ❂ ✹✮ ①t❛❜❧❡✭✐♠❞❢✐t✮
RR 95% CI p-value h.I(start/365 - 3.5) 0.959 0.92–1.00 0.071 h.sin(2 * pi * start/365) 1.231 1.08–1.41 0.0022 h.cos(2 * pi * start/365) 1.379 1.21–1.57 <0.0001 e.typeC 0.450 0.27–0.74 0.0017 e.agegrp[3,19) 2.133 1.10–4.12 0.024 e.agegrp[19,Inf) 0.824 0.33–2.05 0.68
useR! 2015, Spatial Session 1 July 2015 s✉r✈❡✐❧❧❛♥❝❡: Spatio-Temporal Analysis of Epidemic Phenomena Page 13
Estimated spatial interaction
♣❧♦t✭✐♠❞❢✐t✱ ✇❤✐❝❤ ❂ ✧s✐❛❢✧✱ ①❧✐♠ ❂ ❝✭✵✱ ✺✵✮✮ ✐♠❞❢✐t❴❢st❡♣ ❁✲ ✉♣❞❛t❡✭✐♠❞❢✐t✱ s✐❛❢ ❂ s✐❛❢✳st❡♣✭ ❦♥♦ts ❂ ❡①♣✭✭✶✿✹✮✯❧♦❣✭✶✵✵✮✴✺✮✱ ♠❛①❘❛♥❣❡ ❂ ✶✵✵✮✱ ♦♣t✐♠✳❛r❣s ❂ ❧✐st✭❢✐①❡❞ ❂ ◆❯▲▲✮✮ ♣❧♦t✭✐♠❞❢✐t❴❢st❡♣✱ ✇❤✐❝❤ ❂ ✧s✐❛❢✧✱ ❛❞❞ ❂ ❚❘❯❊✱ ❝♦❧✳❡st✐♠❛t❡ ❂ ✶✮
10 20 30 40 50 0e+00 2e−05 4e−05 Distance x from host eγ0 ⋅ f(x) Power law Step (df=4)
s✐❛❢✳✯ t✐❛❢✳✯ ❝♦♥st❛♥t ❝♦♥st❛♥t ❣❛✉ss✐❛♥ ❡①♣♦♥❡♥t✐❛❧ ♣♦✇❡r❧❛✇ st❡♣ ♣♦✇❡r❧❛✇▲ st❡♣ st✉❞❡♥t
useR! 2015, Spatial Session 1 July 2015 s✉r✈❡✐❧❧❛♥❝❡: Spatio-Temporal Analysis of Epidemic Phenomena Page 14
Estimated spatial interaction
♣❧♦t✭✐♠❞❢✐t✱ ✇❤✐❝❤ ❂ ✧s✐❛❢✧✱ ①❧✐♠ ❂ ❝✭✵✱ ✺✵✮✮ ✐♠❞❢✐t❴❢st❡♣ ❁✲ ✉♣❞❛t❡✭✐♠❞❢✐t✱ s✐❛❢ ❂ s✐❛❢✳st❡♣✭ ❦♥♦ts ❂ ❡①♣✭✭✶✿✹✮✯❧♦❣✭✶✵✵✮✴✺✮✱ ♠❛①❘❛♥❣❡ ❂ ✶✵✵✮✱ ♦♣t✐♠✳❛r❣s ❂ ❧✐st✭❢✐①❡❞ ❂ ◆❯▲▲✮✮ ♣❧♦t✭✐♠❞❢✐t❴❢st❡♣✱ ✇❤✐❝❤ ❂ ✧s✐❛❢✧✱ ❛❞❞ ❂ ❚❘❯❊✱ ❝♦❧✳❡st✐♠❛t❡ ❂ ✶✮
10 20 30 40 50 0e+00 2e−05 4e−05 Distance x from host eγ0 ⋅ f(x) Power law Step (df=4)
Predefined interaction functions:
Spatial (s✐❛❢✳✯) Temporal (t✐❛❢✳✯) ❝♦♥st❛♥t ❝♦♥st❛♥t ❣❛✉ss✐❛♥ ❡①♣♦♥❡♥t✐❛❧ ♣♦✇❡r❧❛✇ st❡♣ ♣♦✇❡r❧❛✇▲ st❡♣ st✉❞❡♥t
useR! 2015, Spatial Session 1 July 2015 s✉r✈❡✐❧❧❛♥❝❡: Spatio-Temporal Analysis of Epidemic Phenomena Page 14
Fitted ground intensity ˆ λ(s, t) ❞s
♣❧♦t✭✐♠❞❢✐t✱ ✇❤✐❝❤ ❂ ✧t♦t❛❧ ✐♥t❡♥s✐t②✧✱ ❛❣❣r❡❣❛t❡ ❂ ✧t✐♠❡✧✱ t②♣❡s ❂ ✶✱ ②❧✐♠ ❂ ❝✭✵✱✵✳✸✮✱ t❣r✐❞ ❂ ✷✺✵✵✮
500 1000 1500 2000 2500 0.00 0.10 0.20 0.30
B
Time [days] Fitted intensity process total intensity endemic intensity 500 1000 1500 2000 2500 0.00 0.10 0.20 0.30
C
Time [days] Fitted intensity process total intensity endemic intensity useR! 2015, Spatial Session 1 July 2015 s✉r✈❡✐❧❧❛♥❝❡: Spatio-Temporal Analysis of Epidemic Phenomena Page 15
Methods for ✧t✇✐♥st✐♠✧ Display Extract Modify Other ♣r✐♥t ♥♦❜s ✉♣❞❛t❡ s✐♠✉❧❛t❡ s✉♠♠❛r② ✈❝♦✈ ❛❞❞✶ ❝♦❡❢❧✐st ①t❛❜❧❡ ❧♦❣▲✐❦ ❞r♦♣✶ ♣❧♦t ❡①tr❛❝t❆■❈ st❡♣❈♦♠♣♦♥❡♥t ✐♥t❡♥s✐t②♣❧♦t ♣r♦❢✐❧❡ ✐❛❢♣❧♦t r❡s✐❞✉❛❧s ❝❤❡❝❦❘❡s✐❞✉❛❧Pr♦❝❡ss t❡r♠s ❘✵
useR! 2015, Spatial Session 1 July 2015 s✉r✈❡✐❧❧❛♥❝❡: Spatio-Temporal Analysis of Epidemic Phenomena Page 16
Regression framework
sr
useR! 2015, Spatial Session 1 July 2015 s✉r✈❡✐❧❧❛♥❝❡: Spatio-Temporal Analysis of Epidemic Phenomena Page 17
Model estimation
✭❡♥❞❡♠✐❝ ❁✲ ❛❞❞❙❡❛s♦♥✷❢♦r♠✉❧❛✭⑦❧♦❣✭♣❙✉s❝❡♣t✐❜❧❡✮ ✰ t✮✮ ★★ ⑦❧♦❣✭♣❙✉s❝❡♣t✐❜❧❡✮ ✰ t ✰ s✐♥✭✷ ✯ ♣✐ ✯ t✴✺✷✮ ✰ ❝♦s✭✷ ✯ ♣✐ ✯ t✴✺✷✮ ♠❡❛s❧❡s▼♦❞❡❧ ❁✲ ❧✐st✭ ❡♥❞ ❂ ❧✐st✭❢ ❂ ❡♥❞❡♠✐❝✱ ♦❢❢s❡t ❂ ♣♦♣✉❧❛t✐♦♥✭♠❡❛s❧❡s❲❡s❡r❊♠s✮✮✱ ❛r ❂ ❧✐st✭❢ ❂ ⑦✶✮✱ ♥❡ ❂ ❧✐st✭❢ ❂ ⑦✶✱ ✇❡✐❣❤ts ❂ ❲❴♣♦✇❡r❧❛✇✭♠❛①❧❛❣ ❂ ✺✮✮✱ ❢❛♠✐❧② ❂ ✧◆❡❣❇✐♥✶✧✱ ❞❛t❛ ❂ ❧✐st✭♣❙✉s❝❡♣t✐❜❧❡ ❂ ✶ ✲ ♣❱❛❝❝✮✮ ♠❡❛s❧❡s❋✐t ❁✲ ❤❤❤✹✭♠❡❛s❧❡s❲❡s❡r❊♠s✱ ❝♦♥tr♦❧ ❂ ♠❡❛s❧❡s▼♦❞❡❧✮
useR! 2015, Spatial Session 1 July 2015 s✉r✈❡✐❧❧❛♥❝❡: Spatio-Temporal Analysis of Epidemic Phenomena Page 18
Fitted mean components
♣❧♦t✭♠❡❛s❧❡s❋✐t✱ t②♣❡ ❂ ✧❢✐tt❡❞✧✱ ✉♥✐ts ❂ ❝✭✼✱✶✷✮✱ ❤✐❞❡✵s ❂ ❚❘❯❊✮
2001.0 2002.0 2003.0 2 4 6 8
LK Aurich
autoregressive endemic 2001.0 2002.0 2003.0 10 20 30 40 50
LK Leer
1 July 2015 s✉r✈❡✐❧❧❛♥❝❡: Spatio-Temporal Analysis of Epidemic Phenomena Page 19
Association with vaccination coverage vr
s✉♠♠❛r②✭♠❡❛s❧❡s❋✐t✮✩❢✐①❡❢❬✧❡♥❞✳❧♦❣✭♣❙✉s❝❡♣t✐❜❧❡✮✧✱ ❪ ★★ ❊st✐♠❛t❡ ❙t❞✳ ❊rr♦r ★★ ✷✳✵✺✹ ✵✳✸✼✾
useR! 2015, Spatial Session 1 July 2015 s✉r✈❡✐❧❧❛♥❝❡: Spatio-Temporal Analysis of Epidemic Phenomena Page 20
Association with vaccination coverage vr
s✉♠♠❛r②✭♠❡❛s❧❡s❋✐t✮✩❢✐①❡❢❬✧❡♥❞✳❧♦❣✭♣❙✉s❝❡♣t✐❜❧❡✮✧✱ ❪ ★★ ❊st✐♠❛t❡ ❙t❞✳ ❊rr♦r ★★ ✷✳✵✺✹ ✵✳✸✼✾
useR! 2015, Spatial Session 1 July 2015 s✉r✈❡✐❧❧❛♥❝❡: Spatio-Temporal Analysis of Epidemic Phenomena Page 20
useR! 2015, Spatial Session 1 July 2015 s✉r✈❡✐❧❧❛♥❝❡: Spatio-Temporal Analysis of Epidemic Phenomena Page 21
useR! 2015, Spatial Session 1 July 2015 s✉r✈❡✐❧❧❛♥❝❡: Spatio-Temporal Analysis of Epidemic Phenomena Page 22
◮ Brockmann, D., Hufnagel, L., and Geisel, T. (2006). The Scaling Laws of Human Travel. Nature, 439(7075):462–465. ◮ Höhle, M. (2009). Additive-Multiplicative Regression Models for Spatio-Temporal Epidemics. Biometrical Journal, 51(6):961–978. ◮ Meyer, S., Elias, J., and Höhle, M. (2012). A Space-Time Conditional Intensity Model for Invasive Meningococcal Disease Occurrence. Biometrics, 68(2):607–616. ◮ Meyer, S. and Held, L. (2014). Power-Law Models for Infectious Disease
◮ Meyer, S., Held, L., and Höhle, M. (2014). Spatio-Temporal Analysis of Epidemic Phenomena Using the R Package s✉r✈❡✐❧❧❛♥❝❡. arxiv:1411.0416. ◮ Tobler, W. R. (1970). A Computer Movie Simulating Urban Growth in the Detroit