bn.test: Besag-Newell Test

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/bn.test.R

Description

bn.test implements the Besag-Newell test of Besag and Newell (1991) for finding disease clusters.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
bn.test(
  coords,
  cases,
  pop,
  cstar,
  ex = sum(cases)/sum(pop) * pop,
  alpha = 0.1,
  longlat = FALSE,
  modified = FALSE
)

Arguments

coords

An n \times 2 matrix of centroid coordinates for the regions.

cases

The number of cases observed in each region.

pop

The population size associated with each region.

cstar

A non-negative integer indicating the minimum number of cases to include in each window.

ex

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

alpha

The significance level to determine whether a cluster is signficant. Default is 0.10.

longlat

The default is FALSE, which specifies that Euclidean distance should be used. If longlat is TRUE, then the great circle distance is used to calculate the intercentroid distance.

modified

A logical value indicating whether a modified version of the test should be performed. The original paper recommends computing the p-value for each cluster as 1 - ppois(cstar - 1, lambda = expected). The modified version replaces cstar with cases, the observed number of cases in the region, and computes the p-value for the cluster as 1 - ppois(cases - 1, lambda = ex). The default is modified = FALSE.

Value

Returns a smerc_cluster object.

Author(s)

Joshua French

References

Besag, J. and Newell, J. (1991). The detection of clusters in rare diseases, Journal of the Royal Statistical Society, Series A, 154, 327-333.

See Also

print.smerc_cluster, summary.smerc_cluster, plot.smerc_cluster, scan.test

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
data(nydf)
data(nyw)
coords = with(nydf, cbind(x, y))
out = bn.test(coords = coords, cases = nydf$cases,
              pop = nydf$pop, cstar = 6,
              alpha = 0.1)
plot(out)

data(nypoly)
library(sp)
plot(nypoly, col = color.clusters(out))

smerc documentation built on Oct. 1, 2021, 5:07 p.m.