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