> Script Details
Simple Random Sample
report inappropriate content
Jun 27 2003
Status of work
ArcScripts is intended for the free exchange of scripts and tools related to ESRI software products. Please alert the moderator if this script is a demo, trial-version, or an advertisement for a retail product.
Simple Random Sample generates statistical sampling designs with the push of a button in ArcView 3.x. It specializes in producing so-called "simple random" samples of features in polygon themes. For an extension that provides fill-in-the blank design and documentation of gridded sampling designs, see the Sample extension available at http://www.quantdec.com/sample . Together, these extensions provide fundamental, easy to use sample design capabilities for ArcView users.
Simple Random Sample computes random sets of points within polygons in two ways. It can (1) choose points independently and uniformly within the selected features of a theme or (2) choose points independently within features with a sampling intensity proportional to feature area. In the first mode, "by number", you are creating a simple random sample of the union of all selected features. It is the nature of randomness that some of the features may receive no samples while others may receive far more than their "fair share." In the second mode, "by intensity", you can guarantee that each feature has approximately the "right" number of samples. (The sample points will look like a dot density map for the feature areas.)
Output is in the form of a point shapefile. The output points receive sequential identifiers only. ArcView makes it simple to add attributes from the original features: just perform a spatial join. (This is done by opening the feature table for the polygon theme, activating its [shape] field, opening the feature table for the sample point theme, activating its [shape] field, then pressing the "Join" button.)
Why offer this extension when several other free sampling extensions and scripts are already available for ArcView? First, correctness : the well-known anomalous behavior of Avenue's "MakeRandom" request causes many (but not all) of the other extensions to fail or to provide inaccurate results. (Inaccuracy is usually hard to determine unless you sample a region repeatedly: then the lack of independence or uniformity becomes clear.) Second, flexibility : the option to sample with a fixed intensity is useful but hard to find in other software. Third, documentation : this software documents the sample sets using comments within the theme properties. Fourth, failure avoidance : all sampling programs can fail in certain cases, especially when sampling regions are full of holes, tortuous, or disconnected. Most fail by going into infinite loops. This one issues specific warnings for the pathological features, but otherwise completes the sampling for all other features.
To use this extension, download the file (simplers.avx) into the EXT32 directory. By default, this is at C:/esri/av_gis30/arcview/ext32. It will appear in the extension list (found in the Project|Extensions menu) as "Simple random sampling". It adds a single menu item, "Sample..", to the View|Themes menu when loaded.
27 June 2003: Version 1.1.
the complete description can be found in the readme.txt file included in the zipfile download.