I want to look at the spatial cross-correlation between 2 variables. I am currently using the function correlog from the package ncf in R. I was unsure about my code and interpretation, so I prepared a dummy dataset with 2 perfectly correlated variables (they have the same values for each observation) using the actual x,y coordinates in my real dataset.

x <- (364135.4, 363768.3, 363922.2, 363808.9, 363942.8, 364151.3, 364098.4, 364021.1, 364304.9, 364328.5, 363872.3, 363848.0, 363945.2, 364150.9, 364236.9, 364317.1, 364209.1, 363589.7, 363762.2, 363765.9, 363829.3, 363844.5, 363999.2, 364033.9, 364412.0)
y <- (5511148, 5511304, 5511387, 5511305, 5511210, 5511314, 5511275, 5511249, 5511297, 5511389, 5511520, 5511462, 5511494, 5511417, 5511587, 5511426, 5511557, 5511760, 5511744, 5511795, 5511731, 5511768, 5511787 5511701, 5511660)
a <- rmvn.spa(x=x, y=y, p=2, method="exp")
b <- a

Dummy <- data.frame(x, y, a, b)

fit <- correlog(x=Dummy$x, y=Dummy$y, z=Dummy$a, w=Dummy$b, increment = 40)

As you will see from this code (because of randomized value of a/b, you might not see it the first time), values of correlation returned by the function can be higher or lower than 1.

My question: What is the statistic used for computing the correlation in this function? What range of values can it takes?

Second, additional question: Does my code is doing what I am expecting, i.e. calculating the correlation between variable a & b over scale ?

I doubt it, since the correlation value in the first bin should always be very high since my variable are perfectly correlated. However, I see differences in that first correlation values when I change the data.


The manual can be found e.g. here and states:

The spatial (cross-)correlogram and Mantel (cross-)correlogram estimates the spatial dependence at discrete distance classes.

The regionwide similarity forms the reference line (the zero-line); the x-intercept is thus the distance at which object are no more similar than that expected by-chance-alone across the region. If the data are univariate, the spatial dependence is measured by Moran’s I, if it is multivariate it is measured by the centred Mantel statistic. (Use correlog.nc if the non-centered multivariate correlogram is desired). Missing values are allowed – values are assumed missing at random.

Now, as to why this could lie outside [-1,1], it seems you're not the first to encounter this. If I understand the issue correctly and this is your question, it has been answered here:

I've added the following information to the documentation for the next release of ArcGIS:

Q: Why am I getting a Moran's Index greater than 1.0 or less than -1.0?

A: In general, the Global Moran's Index is bounded by -1.0 and +1.0. This is always the case when your weights are row standardized. When you don't row standardize the weights, there may be instances where the Index value falls outside the -1.0 to 1.0 range, and this indicates a problem with your parameter settings. The most common problems are the following:

  • The Input Field is strongly skewed (create a histogram of the data values to see this), and the Conceptualization of Spatial Relationships or Distance Band is such that some features have very few neighbors. The Global Moran's I statistic is asymptotically normal, which means for skewed data, you will want each feature to have at least eight neighbors. The default value computed for the Distance Band or Threshold Distance parameter ensures that every feature has at least one neighbor, but this may not be sufficient, especially when values in the Input Field are strongly skewed.
  • An Inverse Distance Conceptualization of Spatial Relationships is used, and the inverted distances are very small.
  • Row standardization is not selected, but should be. Whenever your data has been aggregated, unless the aggregation scheme relates directly to the field you are analyzing, you should select row standardization.


Lauren M. Scott, PhD ESRI

  • $\begingroup$ Thank you for your answer, but it generated some more questions. As my data is multivariate, the statistic should be the centred Mantel statistic. Does the centred Mantel statistic follow the same rules as the Moran's I ? $\endgroup$ – Emilie Aug 23 '15 at 23:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.