cepp.sim | R Documentation |

`cepp.test`

on simulated data`cepp.sim`

efficiently performs
`cepp.test`

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

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

cepp.sim(nsim = 1, nn, ty, ex, wts, simdist = "multinomial")

`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. |

`wts` |
A list that has the weights associated with each
region of each element of |

`simdist` |
A character string indicating whether the
simulated data should come from a |

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

data(nydf) coords <- with(nydf, cbind(longitude, latitude)) d <- sp::spDists(as.matrix(coords), longlat = TRUE) nn <- casewin(d, cases = nydf$pop, cstar = 15000) cases <- floor(nydf$cases) ty <- sum(cases) ex <- ty / sum(nydf$pop) * nydf$pop # find smallest windows with at least n* pop nstar <- 1000 nn <- casewin(d, cases = nydf$pop, cstar = nstar) # determine ts wts <- cepp.weights(nn, nydf$pop, nstar) tsim <- cepp.sim(1, nn = nn, ty = ty, ex = ex, wts = wts)

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.