Description Usage Arguments Value Examples

`scan.sim`

efficiently performs
`scan.test`

on a simulated data set. The
function is meant to be used internally by the
`scan.test`

function, but is informative for
better understanding the implementation of the test.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |

`nsim` |
A positive integer indicating the number of simulations to perform. |

`nn` |
A list of nearest neighbors produced by |

`ty` |
The total number of cases in the study area. |

`ex` |
The expected number of cases for each region. The default is calculated under the constant risk hypothesis. |

`type` |
The type of scan statistic to compute. The
default is |

`ein` |
The expected number of cases in the zone. Conventionally, this is the estimated overall disease risk across the study area, multiplied by the total population size of the zone. |

`eout` |
The expected number of cases outside the
zone. This should be |

`tpop` |
The total population in the study area. |

`popin` |
The total population in the zone. |

`popout` |
The population outside the zone. This
should be |

`cl` |
A cluster object created by |

`simdist` |
Character string indicating the simulation
distribution. The default is |

`pop` |
The population size associated with each region. |

A vector with the maximum test statistic for each simulated data set.

1 2 3 4 5 6 7 8 9 10 | ```
data(nydf)
coords = with(nydf, cbind(longitude, latitude))
d = sp::spDists(as.matrix(coords), longlat = TRUE)
nn = scan.nn(d, pop = nydf$pop, ubpop = 0.1)
cases = floor(nydf$cases)
ty = sum(cases)
ex = ty/sum(nydf$pop) * nydf$pop
yin = nn.cumsum(nn, cases)
ein = nn.cumsum(nn, ex)
tsim = scan.sim(nsim = 1, nn, ty, ex, ein = ein, eout = sum(ex) - ein)
``` |

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.