Skip to main content
5 votes

Doing spatial correlation between two sets of rasters in R

I provided an answer in the comments: "There is a function "raster.modifed.ttest" in the spatialEco package for applying Dutilleul's modified t-test. This will return rasters of the ...
Jeffrey Evans's user avatar
3 votes

Resolution unit calculation

There is no a fixed pixel size in GIS realm. Rasters (image files) may have different pixel sizes. Therefore, these equations are not absolute even if it is correct for the pixel of your raster. For ...
Kadir Şahbaz's user avatar
3 votes
Accepted

How to compute partial correlation of pixels in R

Lets first make some test data: sos = rast(array(runif(10*10*20),c(10,10,20))) tem = rast(array(runif(10*10*20),c(10,10,20))) pre = rast(array(runif(10*10*20),c(10,10,20))) NDVI = rast(array(runif(...
Spacedman's user avatar
  • 64.6k
3 votes
Accepted

Calculating pairwise Spearman's correlation coefficients for multiple raster layers in R

First convert the rasters to variables in the same dataframe, then calculate the pairwise correlations and use the package 'corrplot' to display the results in a matrix. #dependencies library(raster) ...
Kartograaf's user avatar
  • 2,927
3 votes
Accepted

Correlation/relationship between map layers in R?

For your point data on asthma instances and rainfall (as long as it is not interpolated raster data) you can look at the spatial cross-correlation following Chen(2015) & Anselin(1995). Here is a ...
Jeffrey Evans's user avatar
3 votes
Accepted

Pearson correlation in R?

I'll expose the solution with two random datasets, one for temperature and one for precipitation: library(raster) r <- raster() t1 <- setValues(r , rnorm(n=64800,mean=16,sd=1)) t2 <- ...
aldo_tapia's user avatar
  • 13.7k
3 votes
Accepted

Correlating number values with text values from different fields in ArcMap?

What you want is a coded domain. In addition to being a more efficient way of storing the data (it manages the lookup table for you); you can also symbolize by category while editing and each of the ...
Stephen Ruhl's user avatar
2 votes
Accepted

ArcGIS- Band collection statistics tool correlation less than -1?

One possible reason could be different data types. I would check data types for each rasters and also convert them as floats.
Devdai's user avatar
  • 76
2 votes

Pixel correlations from two raster datasets in R

For reference, here is an approach, in memory, that uses mapply. This is one of the lesser known apply functions in R that lets you apply a function across objects. Here, when I create objects from ...
Jeffrey Evans's user avatar
2 votes

Pixel based Correlation for 2 Rasters

Look at this answer to Doing spatial correlation between two sets of rasters in R for some clarity on your problem and take note that, the way you are describing your analysis, the results would be ...
Jeffrey Evans's user avatar
2 votes
Accepted

Pixel based Correlation for 2 Rasters

Download and install latest QGIS with GRASS GIS. The tool is r.covar under the GRASS tools. It outputs the covariance/correlation matrix.
Alešinar's user avatar
  • 841
2 votes
Accepted

Error while exporting plots results from cor function in a for loop over subfolders

sampleRandom needs the whole brick (or raster) fed to it, you are feeding it the vector of values with d[]. Reproducing your error, minimally: > r1 =raster(matrix(1:12,3,4)) > r2 =raster(matrix(...
Spacedman's user avatar
  • 64.6k
2 votes
Accepted

Calculating correlation between points and raster values with missing points (need missing as 0s) (QGIS)

you have several ways to calculate the correlation between a raster and points, or between two aligned rasters. You can use Grass or SAGA tools, or do it by programming. Areas with no yield value ...
Luis Perez's user avatar
  • 1,284
2 votes
Accepted

Correlation analysis between bands in a RasterStack using Google Earth Engine

The error is telling you that the ee.Reducer.pearsonsCorrelation() function does not require any arguments. When you call it in var correl = ee.Reducer.pearsonsCorrelation(stack), you give it an ...
Sean Carter's user avatar
1 vote

QGIS point cluster correlation

One way is to rasterize one of the point layers. Then use SAGA -> Geostatistics -> Multiple Regression Analysis (Points/Raster). It will give you the correlation between the two dispersions.
Ash's user avatar
  • 1,220
1 vote

Correlation coefficient and R squared in Google Earth Engine

I was also looking to calculate R2 between two images, and couldn't find a reducer to do this -- only for the Pearson correlation coefficient. Here is my current solution showing both (Pearson ...
Oliver Lopez's user avatar
  • 1,264
1 vote

Creating correlation chart in GEE

This could be one approach: First do the linear regression with reduceRegion(), to get the coefficients of your trend line and R2. Combine your NDVI and LST into a single image and sample it. Map over ...
Daniel Wiell's user avatar
  • 14.3k
1 vote
Accepted

Accurately estimating non-linear relationship between two rasters

This is basically the whole of statistics. Given you simulated the data from a quadratic with a specified random noise, ideally you'd get that back as your "expression of the relationship between ...
Spacedman's user avatar
  • 64.6k
1 vote
Accepted

How to select one band in image using rasterio

I don't have a SAR image so, I assumed that this image has same values as NDVI image. Result of this kind of linear regression, approximately, would be a straight line with slope 1 and intercept 0. ...
xunilk's user avatar
  • 30k
1 vote

How to correlate NDVI and Land Surface Temperature in QGIS?

For what you want I recommend you to use SAGA, it is very easy and direct. SAGA is automatically installed with QGIS. If you are in windows go to start > all programs > QGIS 3 > SAGA GIS I ...
Luis Perez's user avatar
  • 1,284
1 vote
Accepted

Correlating Worldclim data with vif function in R

Your object bioFinal is only the names of the files, there's no step where they are read in in the code you post; as a list they are a character vector, thus the error. First you have to read them in ...
Elio Diaz's user avatar
  • 3,486
1 vote

Assessing if two variables (measured at point locations) covary in space?

This is a common question in fields like pollution tracking and exploration geochemistry but it is seldom straightforward. The fact you seem to have a positive correlation using (non-directional) ...
Leigh Bettenay's user avatar
1 vote
Accepted

Correlating Point Samples and MODIS SST in Google Earth Engine

If you are interested in the MODIS sst of a composite image between the dates you have set at every of your sample points, you can simply use reduce regions: var addTempMODIS = modisSST.reduceRegions(...
Kuik's user avatar
  • 10.1k
1 vote

Using a template matching correlation image to extract lines

You can use the "line extraction" to detect the lines. Here's a tutorial tutorial with sample dataset. http://community.ecognition.com/home/line-extraction
hugonbg's user avatar
  • 854
1 vote

Test Statistic, p-value interpretation for Local Moran's I

Unfortunately, the global or local Moran's-I is not at all appropriate for multi-temporal data. There is a bivariate version of the statistic, available in GeoDa that can be used to compare two time-...
Jeffrey Evans's user avatar
1 vote

Autoregressive parameter from autocorrelation using R

If you just want to spatially lag your variable for an autoregressive model an alternative is the autocov_dist in the spdep package. For more complex representation of spatial structure, that could be ...
Jeffrey Evans's user avatar
1 vote

Correlation between layers

In determining correlation between layers, one method to use is the "point data" and "rank field" you have in your attribute data. For suitable assessment, i suggest your points should not be less ...
Terah Antwi's user avatar
1 vote

Correlation between layers

Perhaps a heat-map type analysis would be suitable. You could convert the proximity to settlements into a raster (with the ranking score being the raster value). After that you could then use the ...
TectonicTerra's user avatar
1 vote

Finding correlation between two rasters in ArcGIS for Desktop?

It is likely statistical overkill to sample every single cell in your rasters. For the same statistical result, you could create a random point layer with the Create Random Points tool and choose the ...
mmoore's user avatar
  • 1,011
1 vote

Is there a spatial gradient in my data

One option would be to look at a multivariate regression in R. Let us assume that you have create a data.frame with your density, lat & lon. Then you can do something along these lines (rough ...
Mikkel Lydholm Rasmussen's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible