kullnagar.stat: Kulldorff and Nagarwalla's Statistic for Spatial Clustering.

View source: R/kullnagar.stat.R

kullnagar.statR Documentation

Kulldorff and Nagarwalla's Statistic for Spatial Clustering.

Description

Compute Kulldorff and Nagarwalla's spatial statistic for cluster detection around a single region, which is supposed to be the first row of the dataframe. The other regions are supposed to be sorted by distance to the centre in the data frame.

Two possible function are provided: kullnagar.stat.poisson, for th Poisson case, and kullnagar.stat.bern, for the Bernouilli case.

See kullnagar manual page for details.

Usage

kullnagar.stat(data, fractpop, use.poisson=TRUE, log.v=FALSE)

Arguments

data

A dataframe with the data as explained in DCluster.

fractpop

Maximum fraction of the total population used when creating the balls.

use.poisson

Use the statistic for Poisson (default) or Bernouilli case.

log.v

Whether the logarithm of the statistic is returned or not.

Value

Returns a vector of two elements: the value of the statistic and the size (in number of regions) of the cluster.

References

Kulldorff, Martin and Nagarwalla, Neville (1995). Spatial Disease Clusters: Detection and Inference. Statistics in Medicine 14, 799-810.

See Also

DCluster, kullnagar, kullnagar.stat, kullnagar.boot, kullnagar.pboot

Examples

library(spdep)

data(nc.sids)

sids<-data.frame(Observed=nc.sids$SID74)
sids<-cbind(sids, Expected=nc.sids$BIR74*sum(nc.sids$SID74)/sum(nc.sids$BIR74))
sids<-cbind(sids, Population=nc.sids$BIR74, x=nc.sids$x, y=nc.sids$y)


dist<-(sids$x-sids$x[1])^2+(sids$y-sids$y[1])^2
index<-order(dist)
#Compute the statistic around the first county
kullnagar.stat(sids[index,], fractpop=.5)

DCluster documentation built on May 29, 2024, 3:41 a.m.