I want to test the correlation in the values between 2 spatial raster data sets (that perfectly overlap).
I could just do:
correlation(getValues(raster1), getValues(raster2))
but both raster datasets are spatial autocorrelated.
Instead, I am using:
modified.ttest(getValues(raster1), getValues(raster2), coordinates)
from the SpatialPack
library.
This is based on Dutilleul's test that modifies that effective sample size based on the degree of autocorrelation.
However, the modified test does not change the estimated correlation coefficient, only the p-value.
How do I also correct the estimated correlation coefficient for the extent of autocorrelation?