Select to view content in your preferred language

Looking for a way to compare the distribution of a variable between to rasters

1010
3
09-24-2018 10:29 AM
AlejandroFigueroa1
Emerging Contributor

I have a set of environmental variables (slope, aspect, vegetation, landforms, etc.) in raster format. I would like to evaluate if the distribution of each variable is comparable across rasters created by two different polygons. Basically, I am doing some analyses on a sample of a larger area/raster, and want to make sure that the environmental variables are representative of the larger area.

 

It's been suggested that I try to export the attribute tables for each raster clipped to each polygon and look at the data in excel, which means a lot of work. Is there a way to do this in ArcGIS - something like a difference of means t-test that compares the distribution of a single variable across two rasters?

0 Kudos
3 Replies
DanPatterson_Retired
MVP Emeritus

extract your areas using your polygons, then perhaps

Raster to Point—Conversion toolbox | ArcGIS Desktop 

from there it depends on what you want to do.

Of course, exporting your samples to numpy arrays 

(see RasterToNumPyArray RasterToNumPyArray—ArcPy Functions | ArcGIS Desktop )

would enable you to use scipy stack tools like

scipy.stats.ttest_ind — SciPy v1.1.0 Reference Guide 

scipy.stats.ttest_rel — SciPy v1.1.0 Reference Guide 

and I am sure R has stuff, but it requires extra hurdl e

0 Kudos
CodyBenkelman
Esri Regular Contributor

If you define your polygon and then Run the “clip” tool, be sure to turn on checkbox to clip to geometry, and define a NoData value for pixels outside the polygon, you'll clip out a new image containing pixels only within the polygon:

Clip raster screenshot

If you do not wish to save your clipped file to disk, you can also use the CLIP raster function to create a temporary layer.

Then run "Band Collection Statistics" to calculate mean, standard deviation, more:

(note this requires the Spatial Analyst extension)

calculate statistics

Your statistics should not be counting the NoData pixels - verify that in your statistics table.  If you have a multiband file, you'll get statistics for each band


Cody B. 

0 Kudos
DanPatterson_Retired
MVP Emeritus

and from that you should be able to construct your desired t-test manually

0 Kudos