Description Usage Arguments Value Examples

`rflex.sim`

efficiently performs
`rflex.test`

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

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

1 2 3 4 5 6 7 8 9 10 |

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

`nn` |
A matrix of the k nearest neighbors for the
regions described by |

`w` |
A binary spatial adjacency matrix for the regions. |

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

`alpha1` |
The middle p-value threshold. |

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

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

`cl` |
A cluster object created by |

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

1 2 3 4 5 6 7 8 9 10 | ```
data(nydf)
data(nyw)
# determine knn
coords = with(nydf, cbind(longitude, latitude))
nn = knn(coords, longlat = TRUE, k = 50)
# determine expected number of cases in each region
cases = floor(nydf$cases)
pop = nydf$pop
ex = pop * sum(cases)/sum(pop)
tsim = rflex.sim(nsim = 5, nn = nn, w = nyw, ex = ex)
``` |

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.