Well, the problem sounds like your correlation approach is not working and forcing the range will not correct the problem. Also the type of correlation (Person, Kendall, Spearman) is important given the data. I would revisit your methodology to figure out why your correlation coefficients are off rather than trying to fix the issue post hoc. Any approach for deriving correlation coefficients at the raster cell level using a combination of ArcMAP and Excel are opaque at best and some details would be required to evaluate the approach.
I am not clear on why you want these correlations as a raster. If you have well locations, with associated depth, you could just assign the gravitational anomaly raster values using the "Extract Multi Values to Points" tool, export the resulting attribute table to a flatfile (eg., csv) and calculate the correlation coefficient in Excel (not that Excel is good for statistical analysis).
It is interesting that you mention this particular correlative relationship. I just published a paper in PLoS One (Evans & Kiesecker 2014) using gravitational anomaly data, along with other covariates, in a probabilistic model of non-conventional oil/gas. I used a nonparametric model and found that this particular relationship is highly nonlinear in nature. Because of this, any correlations are likely to be erroneous. I would imagine that it is time to move your analysis into a statistical software and it may also be a good point to consult a statistician.
Evans, J.S., J.M. Kiesecker (2014) Shale Gas, Wind and Water: Assessing the Potential Cumulative Impacts of Energy Development on Ecosystem Services within the Marcellus Play. PLoS ONE 9(2): e89210. doi:10.1371/journal.pone.0089210
If you were to produce a surface of depth, using Kriging or any such interpolation method, you could easily calculate a moving window correlation surface in R. Here is an example, that includes a Kriging estimate, for calculating a moving window correlation surface.
# Moving window correlation function
# x raster of x
# y raster of y
# dist distance (radius) of correlation window, the default AUTO calculates a window size
# ... additional arguments passed to the cor function
mwcor <- function(x, y, dist="AUTO", ...) {
require(sp)
require(spdep)
if ( (dist == "AUTO") == TRUE){
cs <- x@grid@cellsize[1]
dist = sqrt(2*((cs*3)^2))
} else {
if (!is.numeric (dist)) stop("DISTANCE MUST BE NUMERIC")
}
nb <- dnearneigh(coordinates(x),0, dist)
v=sapply(nb, function(i) cor(x@data[i,], y@data[i,], ...))
if( (class(v)=="numeric") == TRUE) {
v = as.data.frame(v)
} else {
v = as.data.frame(t(v))
}
coordinates(v) = coordinates(x)
gridded(v) = TRUE
( v )
}
# Example
require(gstat) | |
require(sp) | |
require(spdep) | |
| |
data(meuse) | |
data(meuse.grid) | |
coordinates(meuse) <- ~x + y | |
coordinates(meuse.grid) <- ~x + y | |
| |
# GRID-1 log(copper): | |
v1 <- variogram(log(copper) ~ 1, meuse) | |
x1 <- fit.variogram(v1, vgm(1, "Sph", 800, 1)) | |
G1 <- krige(zinc ~ 1, meuse, meuse.grid, x1, nmax = 30)
G1@data = as.data.frame(G1@data[,-2])
# GRID-2 log(lead): | |
v2 <- variogram(log(lead) ~ 1, meuse) | |
x2 <- fit.variogram(v2, vgm(.1, "Sph", 1000, .6)) | |
G2 <- krige(zinc ~ 1, meuse, meuse.grid, x2, nmax = 30)
gridded(G2) <- TRUE
G2@data <- as.data.frame(G2@data[,-2])
# Moving window correlation surface
gcorr <- mwcor(G1, G2, 500, method="spearman")
# Plot results
colr=colorRampPalette(c("blue", "yellow", "red"))
| spplot(gcorr, col.regions=colr(100)) |