Say I have a raster with attribute values over some spatial area.

Also, say I have circular polygons of varying sizes contained within the raster's area.

What would be the proper method to test if the raster attribute values contained within a polygon are statistically different from raster attribute values in other polygons?

I first thought to put all raster cell values within polygons into a dataset and test their differences with a t-test, however, it doesn't seem proper to treat each raster cell as an "observation". The t-test would have far too many observations in each polygon and would give the test unwarranted statistical power.

Are there any proper methods for performing such a hypothesis test?

  • You did not state any software you use. I added an answer for QGIS and added this as tag as well.
    – Babel
    Jul 2, 2021 at 20:53
  • 1
    I think my question pertains to the specific spatial statistical method, rather than the software. Jul 2, 2021 at 20:53
  • 1
    Treating each circle as an observations would seem more reasonable. You could take the average of the raster cells covered by each polygon. Jul 3, 2021 at 2:44

1 Answer 1


Zonal statistics is the tool to use for such a purpose, see Zonal statistics documentation for QGIS.

By the way: rasters do not have attributes, but each pixel contains a value (in one or more bands).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.