Learn R Programming

spdep (version 0.1-10)

sp.mantel.mc: Mantel-Hubert spatial general cross product statistic

Description

A permutation test for the spatial general cross product statistic with Moran ($C_{ij} = z_i z_j$), Geary ($C_{ij} = (z_i - z_j)^2$), and Sokal ($C_{ij} = |z_i - z_j|$) criteria, for $z_i = (x_i - \bar{x}) / \sigma_{x}$. plot.mc.sim is a helper function to plot the outcomes of the permutation test.

Usage

sp.mantel.mc(var, listw, nsim, type = "moran", zero.policy = FALSE,
 alternative = "greater", spChk=NULL)
plot.mc.sim(x, ...)

Arguments

var
a numeric vector the same length as the neighbours list in listw
listw
a listw object created for example by nb2listw
nsim
number of permutations
type
"moran", "geary" or "sokal" criteria for similarity
zero.policy
if TRUE assign zero to the lagged value of zones without neighbours, if FALSE assign NA
alternative
a character string specifying the alternative hypothesis, must be one of greater (default), less or two.sided.
spChk
should the data vector names be checked against the spatial objects for identity integrity, TRUE, or FALSE, default NULL to use get.spChkOption()
x
the object to be plotted
...
further arguments passed through

Value

  • A list with class htest and mc.sim containing the following components:
  • statisticthe value of the observed Geary's C.
  • parameterthe rank of the observed Geary's C.
  • alternativea character string describing the alternative hypothesis.
  • methoda character string giving the method used.
  • data.namea character string giving the name(s) of the data, and the number of simulations.
  • p.valuethe pseudo p-value of the test.
  • resnsim simulated values of statistic, final value is observed statistic
  • estimatethe mean and variance of the simulated distribution.

References

Cliff, A. D., Ord, J. K. 1981 Spatial processes, Pion, p. 22-24, Haining, R. 1990 Spatial data analysis in the social and environmental sciences, Cambridge: Cambridge University Press, p. 230--1. The function has been checked against general matrix code posted to the r-help list by Ben Bolker on 1 May 2001; another mantel() function is in the vegan package.

See Also

moran.mc, joincount.mc, geary.mc

Examples

Run this code
data(oldcol)
sim1 <- sp.mantel.mc(spNamedVec("CRIME", COL.OLD), nb2listw(COL.nb),
 nsim=99, type="geary", alternative="less")
sim1
plot(sim1)
sp.mantel.mc(spNamedVec("CRIME", COL.OLD), nb2listw(COL.nb), nsim=99,
 type="sokal", alternative="less")
sp.mantel.mc(spNamedVec("CRIME", COL.OLD), nb2listw(COL.nb), nsim=99,
 type="moran")

Run the code above in your browser using DataLab