tango.weights: Distance-based weights for 'tango.test'

View source: R/tango.weights.R

tango.weightsR Documentation

Distance-based weights for tango.test

Description

tango.weights constructs a distance-based weights matrix. The tango.weights function can be used to construct a weights matrix w using the method of Tango (1995), Rogerson (1999), or a basic style.

Usage

tango.weights(coords, kappa = 1, longlat = FALSE, type = "basic", pop = NULL)

dweights(coords, kappa = 1, longlat = FALSE, type = "basic", pop = NULL)

Arguments

coords

An n \times 2 matrix of centroid coordinates for the regions in the form (x, y) or (longitude, latitude) is using great circle distance.

kappa

A positive constant related to strength of spatial autocorrelation.

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.

type

The type of weights matrix to construct. Current options are "basic", "tango", and "rogerson". Default is "basic". See Details.

pop

The population size associated with each region.

Details

coords is used to construct an n \times n distance matrix d.

If type = "basic", then w_{ij} = exp(-d_{ij}/\kappa).

If type = "rogerson", then w_{ij} = exp(-d_{ij}/\kappa)/\sqrt(pop_i/pop * pop_j/pop).

If type = "tango", then w_{ij} = exp(-4 * d_{ij}^2/\kappa^2).

Value

Returns an n \times n matrix of weights.

Author(s)

Joshua French

References

Tango, T. (1995) A class of tests for detecting "general" and "focused" clustering of rare diseases. Statistics in Medicine. 14:2323-2334.

Rogerson, P. (1999) The Detection of Clusters Using A Spatial Version of the Chi-Square Goodness-of-fit Test. Geographical Analysis. 31:130-147

See Also

tango.test

Examples

data(nydf)
coords <- as.matrix(nydf[, c("longitude", "latitude")])
w <- tango.weights(coords, kappa = 1, longlat = TRUE)

jfrench/smerc documentation built on Oct. 27, 2024, 5:13 p.m.