correlogram.bi {bispdep}R Documentation

Computes Bivariate Moran's or Geary's coefficients on distance classes

Description

Computes Bivariate Moran's or Geary's coefficients on distance classes from a set of spatial coordinates and values of the two corresponding variables varX and varY.

Usage

correlogram.bi(coords, varX, varY, method="Moran", nbclass = NULL, zero.policy=NULL, ...)

Arguments

coords

a two columns array, data.frame or matrix of spatial coordinates. Column 1 = X, Column 2 = Y.

varX

a vector for the values of the variable x at each location. Must have the same length as the row number of coords

varY

a vector for the values of the variable y at each location. Must have the same length as the row number of coords

method

the method used. Must be "Moran" (default) or "Geary"

nbclass

number of bins. If NULL Sturges method is used to compute an optimal number

zero.policy

default NULL, use global option value; if TRUE assign zero to the lagged value of zones without neighbours, if FALSE assign NA

...

further arguments to pass to e.g. moranbi.test or gearybi.test

Details

Uses the library bispdep including moranbi.test or gearybi.test. Distances are euclidian and in the same unit as the spatial coordinates. Moran's Ho: I values larger than 0 due to chance; Geary's Ho: C values lesser than 1 due to chance, correlogram.bi has print and plot methods; statistically significant values (p<0.05) are plotted in red.

Value

An object of class "correlog.bi", a matrix including:

class

bin centers

I

the coefficient values

p.value

probability of Ho

n

the number of pairs

low.l

bin lower limit

up.l

bin upper limit

Warning

Computing can take a long time for large data sets

References

see library bispdep

See Also

gearybi.test, moranbi.test

Examples

library(spdep)
library(sf)
data(oldcol)
attach(COL.OLD)
coords<-cbind(X,Y)
columbus <- st_read(system.file("shapes/columbus.shp", package="spData")[1], quiet=TRUE)
plot(st_geometry(columbus))

corbiM <- correlogram.bi(coords,columbus$CRIME,columbus$INC, zero.policy=TRUE)
corbiM
plot(corbiM)

corbiG <- correlogram.bi(coords,columbus$CRIME,columbus$INC,method="Geary",zero.policy=TRUE)
corbiG
plot(corbiG)

[Package bispdep version 1.0-0 Index]