Select to view content in your preferred language

Stratified sample with Create Spatially Balanced Points tool

2509
3
08-26-2011 08:01 AM
GregDillon
Emerging Contributor
I'm trying to create a sample of pixel locations to feed into a binary response model. My raster that depicts the response variable is just coded with zeros and ones. I would like my point sample to be balanced so that I have an even number of zeros and ones.

Is there any way to create a stratified sample using the Create Spatially Balanced Points tool, so that half the samples are from class zero and half are from class one? Or do I just need to draw one big sample (much larger than I'll need), and then as a second step extract the response value at each sample point and select an even number of sample points from within each of my response categories?
0 Kudos
3 Replies
EricKrause
Esri Regular Contributor
This functionality isn't built into the tool, but you can do it pretty easily.  Let's say that you want 100 points total, 50 points in each strata.  First, use the Create Spatially Balanced Points tool with your binary raster, and create 50 points.  Then, use the Raster Calculator in Spatial Analyst to switch the 0's and 1's of your raster; the code will be (1 - "value").  Then create 50 more points with the new raster.  You'll now have two point feature classes, each with 50 points, and they'll each be within a different strata.  You can then combine them into a single feature class using the Append tool.

Let me know if you have any questions.
0 Kudos
GregDillon
Emerging Contributor
Thanks for the suggestion. I had thought about that approach, but worried that by taking two independent samples and appending them, the combined sample isn't truly spatially balanced anymore (for example, points from the first sample could be adjacent to points from the second sample). Does that make sense? Is it worth worrying about? I agree with you that it'd be the most efficient solution.
0 Kudos
EricKrause
Esri Regular Contributor
Yeah, I thought of that a bit after I posted.  It's not a perfect solution, but I don't think there's a better way to do it with ArcGIS tools.

And remember that kriging doesn't require spatially balanced points for the math to work correctly.  But the closer the points are to being spatially balanced, the lower the standard errors.  So I don't think you'll be losing much using the technique I suggested.
0 Kudos