
COMPLETE SPATIAL RANDOMNESSName:
In the univariate case, spatial randomness implies that the data points can be modeled with a uniform distribution. Likewise, in the twodimensional case, spatial randomness implies that the data can be modeled with a bivariate uniform distribution with zero correlation between the two dimensions. So a quick graphical assessment of spatial randomness can be obtained by simply plotting the points. If there is complete spatial randomness, this plot should show no obvious structure. This command implements the following formal tests for complete spatial randomness:
Note that there are many ways in which the data can be nonrandom. In particular, a broad distinction is typically made between 1) random (i.e., complete spatial randomness); 2) underdispersed (clumped or aggregated); and 3) overdispersed (spaced or regular). In addition, nonrandomness can be scale dependent. That is, nonrandomness may appear either "locally" or "globably". For example, a set of points may appear random if examined in smaller subsets (i.e., local) but not if examined as a whole. A large number of tests have been developed to test for spatial randomness. These tests vary in what types of nonrandomness they are sensitive to. According to Zimmerman, tests based on nearest neighbors tend to be sensitive to "local" nonrandomness while being relatively insensitive to "global" characteristics. So these tests are quite good at detecting aggregation and regularity but not good at detecting heterogeneity. On the other hand, the bivariate Cramer Von Mises test is more senstive to global characteristics and less sensitive to local characteristics. So it tends to be good at detecting heterogeneity but not as good at detecting aggregation and regularity. The Pollard test expands the "local" neighborhood by looking at the first through fifth nearest neighbors rather than just the single nearest neighbor. So taken together, this combination of tests should be able to detect many different types of nonrandomness.
<SUBSET/EXCEPT/FOR qualification> where <x> is a response variable; <y> is a factor identifier variable; and where the <SUBSET/EXCEPT/FOR qualification> is optional.
LET XMAX = <value> LET YMIN = <value> LET YMAX = <value>
LET A = BIVARIATE CRAMER VON MISES TEST CV95 X Y LET A = BIVARIATE CRAMER VON MISES TEST CV05 X Y
LET A = MEAN NEAREST NEIGHBOR DISTANCE TEST X Y
LET A = POLLARD <ONE/TWO/THREE/FOUR/FIVE> TEST X Y Dataplot statistics can be used in a number of commands. For details, enter
Clark and Evans (1954), "Distance to Nearest Neighbor as a Measure of Spatial Relationships in Populations", Ecology, 35, pp. 2330. Donnelly (1978), "Simulations to Determine the Variance and EdgeEffect of Total NearestNeighbor Distance", in Simulation Studies in Archaeology (ed. Hodder), pp. 9195, London: Cambridge University Press. Fortin and Dale (2005), "Spatial Analysis: A Guide for Ecologists", Cambridge University Press, pp. 3435. Pollard (1971), "On Distance Estimators of Density in Randomly Distributed Forests", Biometrics, 27, pp. 9911002. Liu (2001), "A Comparison of Five DistanceBased Methods for Pattern Analysis", Journal of Vegetation Science, 12, pp. 411416.
. Step 1: Generate some random points. . let lowlim = data 0 0 let upplim = data 1 1 let n = 40 let m = independent uniform random numbers lowlim upplim n let y = m1 let x = m2 . . Step 2: Plot the uniform random numbers . char circle char fill on char hw 0.5 0.375 line blank plot y x . . Step 3: Complete Spatial Randomness Test . set write decimals 3 complete spatial randomness test y xThe following output is generated Bivariate Cramer VonMises Test for Complete Spatial Randomness First Response Variable: Y Second Response Variable: X H0: Complete Spatial Randomness Ha: Not Complete Spatial Randomness Number of Observations: 40 Data Minimum for X: 0.001 Data Maximum for X: 0.973 Data Minimum for Y: 0.035 Data Maximum for Y: 0.970 Test Statistic Value: 0.177 Percent Points of the Reference Distribution  Percent Point Value  0.01 = 0.043 0.02 = 0.049 0.05 = 0.057 0.10 = 0.066 0.15 = 0.075 0.25 = 0.088 0.50 = 0.122 0.75 = 0.171 0.85 = 0.206 0.90 = 0.234 0.95 = 0.281 0.98 = 0.342 0.99 = 0.389 Conclusions (TwoTailed Test)  Lower Upper Alpha Critical Value Critical Value Conclusion  20% 0.066 0.234 Accept H0 10% 0.057 0.281 Accept H0 4% 0.049 0.342 Accept H0 2% 0.043 0.389 Accept H0 Mean Nearest Neighbors Test for Complete Spatial Randomness First Response Variable: Y Second Response Variable: X H0: Complete Spatial Randomness Ha: Not Complete Spatial Randomness Number of Observations: 40 Test Statistic Value: 0.028 Test Statistic CDF: 0.489 Test Statistic PValue: 0.978 TwoTailed Test for Complete Spatial Randomness H0: Complete Spatial Randomness  Null Significance Test Critical Hypothesis Level Statistic Value (+/) Conclusion  50% 0.028 0.674 ACCEPT 75% 0.028 1.149 ACCEPT 80% 0.028 1.282 ACCEPT 90% 0.028 1.645 ACCEPT 95% 0.028 1.960 ACCEPT 99% 0.028 2.576 ACCEPT 99.9% 0.028 3.290 ACCEPT Pollard Statistic Test (index = 1) for Complete Spatial Randomness First Response Variable: Y Second Response Variable: X H0: Complete Spatial Randomness Ha: Not Complete Spatial Randomness Number of Observations: 40 Nearest Neighbor Index: 1 Test Statistic Value: 1.014 Adjusted Test Statistic Value: 39.545 Test Statistic CDF: 0.489 Test Statistic PValue: 0.978 TwoTailed Test for Complete Spatial Randomness H0: Complete Spatial Randomness  Lower Upper Null Significance Test Critical Critical Hypothesis Level Statistic Value (+/) Value (+/) Conclusion  50% 39.545 32.737 44.539 ACCEPT 75% 39.545 29.138 49.292 ACCEPT 80% 39.545 28.196 50.659 ACCEPT 90% 39.545 25.695 54.572 ACCEPT 95% 39.545 23.653 58.119 ACCEPT 99% 39.545 19.995 65.475 ACCEPT 99.9% 39.545 16.272 74.724 ACCEPT Pollard Statistic Test (index = 2) for Complete Spatial Randomness First Response Variable: Y Second Response Variable: X H0: Complete Spatial Randomness Ha: Not Complete Spatial Randomness Number of Observations: 40 Nearest Neighbor Index: 2 Test Statistic Value: 0.760 Adjusted Test Statistic Value: 29.628 Test Statistic CDF: 0.489 Test Statistic PValue: 0.978 TwoTailed Test for Complete Spatial Randomness H0: Complete Spatial Randomness  Lower Upper Null Significance Test Critical Critical Hypothesis Level Statistic Value (+/) Value (+/) Conclusion  50% 29.628 32.737 44.539 REJECT 75% 29.628 29.138 49.292 ACCEPT 80% 29.628 28.196 50.659 ACCEPT 90% 29.628 25.695 54.572 ACCEPT 95% 29.628 23.653 58.119 ACCEPT 99% 29.628 19.995 65.475 ACCEPT 99.9% 29.628 16.272 74.724 ACCEPT Pollard Statistic Test (index = 3) for Complete Spatial Randomness First Response Variable: Y Second Response Variable: X H0: Complete Spatial Randomness Ha: Not Complete Spatial Randomness Number of Observations: 40 Nearest Neighbor Index: 3 Test Statistic Value: 0.998 Adjusted Test Statistic Value: 38.923 Test Statistic CDF: 0.489 Test Statistic PValue: 0.978 TwoTailed Test for Complete Spatial Randomness H0: Complete Spatial Randomness  Lower Upper Null Significance Test Critical Critical Hypothesis Level Statistic Value (+/) Value (+/) Conclusion  50% 38.923 32.737 44.539 ACCEPT 75% 38.923 29.138 49.292 ACCEPT 80% 38.923 28.196 50.659 ACCEPT 90% 38.923 25.695 54.572 ACCEPT 95% 38.923 23.653 58.119 ACCEPT 99% 38.923 19.995 65.475 ACCEPT 99.9% 38.923 16.272 74.724 ACCEPT Pollard Statistic Test (index = 4) for Complete Spatial Randomness First Response Variable: Y Second Response Variable: X H0: Complete Spatial Randomness Ha: Not Complete Spatial Randomness Number of Observations: 40 Nearest Neighbor Index: 4 Test Statistic Value: 0.814 Adjusted Test Statistic Value: 31.750 Test Statistic CDF: 0.489 Test Statistic PValue: 0.978 TwoTailed Test for Complete Spatial Randomness H0: Complete Spatial Randomness  Lower Upper Null Significance Test Critical Critical Hypothesis Level Statistic Value (+/) Value (+/) Conclusion  50% 31.750 32.737 44.539 REJECT 75% 31.750 29.138 49.292 ACCEPT 80% 31.750 28.196 50.659 ACCEPT 90% 31.750 25.695 54.572 ACCEPT 95% 31.750 23.653 58.119 ACCEPT 99% 31.750 19.995 65.475 ACCEPT 99.9% 31.750 16.272 74.724 ACCEPT Pollard Statistic Test (index = 5) for Complete Spatial Randomness First Response Variable: Y Second Response Variable: X H0: Complete Spatial Randomness Ha: Not Complete Spatial Randomness Number of Observations: 40 Nearest Neighbor Index: 5 Test Statistic Value: 0.867 Adjusted Test Statistic Value: 33.831 Test Statistic CDF: 0.489 Test Statistic PValue: 0.978 TwoTailed Test for Complete Spatial Randomness H0: Complete Spatial Randomness  Lower Upper Null Significance Test Critical Critical Hypothesis Level Statistic Value (+/) Value (+/) Conclusion  50% 33.831 32.737 44.539 ACCEPT 75% 33.831 29.138 49.292 ACCEPT 80% 33.831 28.196 50.659 ACCEPT 90% 33.831 25.695 54.572 ACCEPT 95% 33.831 23.653 58.119 ACCEPT 99% 33.831 19.995 65.475 ACCEPT 99.9% 33.831 16.272 74.724 ACCEPT . . Step 4: Demonstrate how to extract individual statistics . let tval = mean nearest neighor distance test x y let tcdf = mean nearest neighor distance cdf x y let tpval = mean nearest neighor distance pvalue x y print tval tcdf tpval PARAMETERS AND CONSTANTS TVAL  0.489 TCDF  0.028 TPVAL  0.978 let bval = bivariate cramer von mises test x y let cv95 = bivariate cramer von mises 95 critical value x y let cv05 = bivariate cramer von mises 05 critical value x y print bval cv95 cv05 PARAMETERS AND CONSTANTS BVAL  0.177 CV95  0.281 CV05  0.057 let xmin = 0 let xmax = 1 let ymin = 0 let ymax = 1 let bval2 = bivariate cramer von mises test x y PARAMETERS AND CONSTANTS BVAL2  0.145 CV95  0.281 CV05  0.057 . let pol1 = pollard one test x y let pol1cdf = pollard one cdf x y let pol1pval = pollard one pvalue x y print pol1 pol1cdf pol1pval PARAMETERS AND CONSTANTS POL1  1.014 POL1CDF  0.554 POL1PVAL 0.891 . let pol2 = pollard two test x y let pol2cdf = pollard two cdf x y let pol2pval = pollard two pvalue x y print pol2 pol2cdf pol2pval PARAMETERS AND CONSTANTS POL2  0.760 POL2CDF  0.139 POL2PVAL 0.279 . let pol3 = pollard three test x y let pol3cdf = pollard three cdf x y let pol3pval = pollard three pvalue x y print pol3 pol3cdf pol3pval PARAMETERS AND CONSTANTS POL3  0.998 POL3CDF  0.527 POL3PVAL 0.947 . let pol4 = pollard four test x y let pol4cdf = pollard four cdf x y let pol4pval = pollard four pvalue x y print pol4 pol4cdf pol4pval PARAMETERS AND CONSTANTS POL4  0.814 POL4CDF  0.211 POL4PVAL 0.423 . let pol5 = pollard five test x y let pol5cdf = pollard five cdf x y let pol5pval = pollard five pvalue x y print pol5 pol5cdf pol5pval PARAMETERS AND CONSTANTS POL5  0.867 POL5CDF  0.296 POL5PVAL 0.591  
Privacy
Policy/Security Notice
NIST is an agency of the U.S. Commerce Department.
Date created: 09/11/2014 