Learn R Programming

smerc (version 1.0.1)

dweights: Distance-based weights

Description

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

Usage

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

Arguments

coords

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

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.

Value

Returns an \(n \times n\) matrix of weights.

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)\).

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

Run this code
# NOT RUN {
data(nydf)
coords = as.matrix(nydf[,c("longitude", "latitude")])
w = dweights(coords, kappa = 1, longlat = TRUE)
# }

Run the code above in your browser using DataLab