Description Usage Arguments Details Value Author(s) References Examples

Generates an appropriately scaled spatiotemporal (trivariate) relative risk surface using a supplied control density and *N* Gaussian-style hotspots.

1 2 |

`g` |
The control density as a |

`rhotspots` |
A |

`rsds` |
A |

`rweights` |
A vector of length |

`rbase` |
The base level of the relative risk surface (default is 1). The peaks and troughs will be added or subtracted from this base level prior to normalisation. |

`log` |
A logical value. If |

`tlim` |
Only used if |

`tres` |
Only used if |

This function is the spatiotemporal (trivariate) equivalent of `rrmix`

. See ‘Details’ in the documentation for that function for more information.

An oject of class `rrstim`

. This is a list with the following components:

`f` |
An object of class |

`g` |
A copy of the object passed to the argument |

`r` |
An object of class |

A.K. Redmond and T.M. Davies

Fernando, W.T.P.S. and Hazelton, M.L. (2014), Generalizing the spatial relative risk function, *Spatial and Spatio-temporal Epidemiology*, **8**, 1-10.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ```
# time-varying control density
gg1 <- stgmix(mean=matrix(c(2,1,3,0,-1,5),nrow=3),
vcv=array(c(1,0,0,0,1,0,0,0,1,2,0,0,0,1,0,0,0,2),dim=c(3,3,2)),
window=shp2,tlim=c(0,6))
rsk1 <- rrstmix(g=gg1,rhotspots=matrix(c(-2,0,2,1,2,5.5),nrow=3),
rsds=sqrt(cbind(rep(1.5,3),rep(0.25,3))),rweights=c(-0.5,5))
plot(rsk1$g,sleep=0.1,fix.range=TRUE)
plot(rsk1$f,sleep=0.1,fix.range=TRUE)
plot(rsk1$r,sleep=0.1,fix.range=TRUE)
# time-constant control density
set.seed(321)
gg2 <- rgmix(7,window=shp2)
rsk2 <- rrstmix(g=gg2,rhotspots=matrix(c(-1,-1,2,2.5,0,5),nrow=3),
rsds=sqrt(cbind(rep(0.75,3),c(0.05,0.01,0.5))),
rweights=c(-0.4,7),tlim=c(0,6),tres=64)
plot(rsk2$g,sleep=0.1,fix.range=TRUE)
plot(rsk2$f,sleep=0.1,fix.range=TRUE)
plot(rsk2$r,sleep=0.1,fix.range=TRUE)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.