A SAS Macro for Adaptive Spatial Sampling

This paper presents a SAS macro to estimate adaptive spatial sampling, which has been used to survey rare species. This technique is computationally difficult because of use of algorithms with GIS features such the creation of a grid, points inside polygons and contiguity. The results indicates that the SAS macro that was developed was capable of incorporating these GIS features, as well as estimating the parameters of the adaptive spatial sampling.


Introduction
The purpose of sampling is to obtain information based on the results of a sample.According to Cochran (1977), sampling theory was developed to achieve the most efficient sampling, that is, to produce more accurate estimates with the lowest possible cost.Thus, the basic problem of any sampling procedure is to obtain reliable estimates of some characteristic of the population of interest, based on only part of this population.
A procedure that has been studied and tested in surveys of populations of rare species that display aggregated pattern distribution is adaptive sampling.In this kind of sampling, the selection of sampling units depends on observations made during the survey because if a criterion is met, the close sample is added to the initial sample.Thus, this type of sampling has advantages such as more extensive use of the sample and greater sampling intensity depending on the observations made during the survey; in addition, it can help find the local maximum (Thompson and Seber, 1996).
The adaptive sampling literature includes the following: algorithms that address the effects of mutations on the properties of folding RNA, the purpose of which is to decipher the principles of conduction and molecular evolution for the design of new molecules, in other words, these algorithms are for unbiased adaptive sampling that allows RNAmutants to sample regions of the mutational landscape that have not been fully addressed by previous techniques (Waldispühl and Ponty, 2011); designs for clinical study that focus on adaptation projects for two stage sample size re-estimation (Chang, 2008(Chang, , 2009)); mining applications that have a large amount of data, where random sampling may not be applicable due to the diffculty of determining an appropriate sample size (Domingo et al., 2002); and, finally, cases where the available algorithms for mining information on a large database are prohibitive due to computational constraints (time and memory) (Satyanarayana and Davidson, 2005).
In the case presented by Thompson (1990), another kind of adaptive sampling was considered, where the spatial distribution of aggregate data influences the formation of the sample selection of the data into clusters.This sample design, in which the procedure for the selection of units can be added to the initial sample based on an area and its spatial distribution, will be referred to from now on as adaptive spatial sampling.Thus, adaptive spatial sampling provides a viable solution to the longstanding problem of estimating the abundance of rare populations and it has gained rapid acceptance in the natural and social sciences (Seber, 1986;Ramsey and Seber, 1992;Brown, 1994Brown, , 1996;;Khan and Muttlak, 2002;Stein and Ettema, 2003;Sengupta and Sengupta, 2011;Jain and Chang, 2004;Thompson, 2011;Yu et al., 2012).However, adaptive procedures are more complicated to design and analyze, and computational implementations are few as a results of the complexity of the algorithms for spatial analysis (Thompson, 2011).
This implementation requires at least three steps: the development of a computational design for a regular grid; the selection of specific areas of the grid to identify which part of the grid the data are in; and identifying the neighbors of the selected areas: upper, lower, right and left.Thus, the objective of this work is to implement computationally adaptive spatial sampling in SAS software.

A Basic Outline of Adaptive Spatial Sampling
It has been observed that adaptive spatial sampling is performed in cluster sampling, because the data to be analyzed are divided into distinct subpopulations and have the geographical coordinates of a given area.Thus, the process of adaptive spatial sampling involves selecting certain areas, recording their geographical coordinates and defining the areas in which the data are located.Usually, these data are grouped in a particular area as shown in Figure 1(a), which characterize the clusters.
The first step is to draw a grid based on the geographical coordinates of the area to be analyzed, as shown in Figure 1(b).Then, some areas of the grid are selected by Simple Random Sampling (S RS ) and it is determined whether there are data points within these areas, as shown in the blue areas of Figure 1(c).Next, the neighbors of these selected units are identified successively -top, bottom, right and left -until the selection criterion of the adaptive spatial sampling is exhausted.This adaptive spatial sampling is represented by one population sample (n) of the regular grid, as in Figure 1(d).
Figure 1.Steps of adaptive spatial cluster sampling In summary, adaptive cluster sampling or simply adaptive spatial sampling refers to designs in which an initial set of units is selected by some probability sampling procedure and, whenever the variable of interest of a selected unit satisfies a given criterion, additional units in the neighborhood of that unit are added to the sample (Thompson, 1990).In the models considered in this paper, the initial sample can be selected by Simple Random Sampling with replacement S RS R or without replacement S RS WR .

Estimators
Classical estimators for the population mean are biased under an adaptive sampling design, in contrast with S RS .In this section two unbiased estimators for the population mean under an adaptive spatial sampling design will be addressed.

Estimators Using Initial Intersection Probabilities
This section shows an estimator based on a modification of a Horvitz-Thompson estimator (Thompson, 1990) and it is compared to the sample mean of the initial sample, given by where y i is the variable in study of the unit i and n 1 is the initial sample size.
When an initial sample n 1 of units is selected by a S RS WR , these units in the first sample are distinguished not as a result of replacement.However, the data itself may contain repeated observations if more than one unit in the cluster is selected in the initial sample.The unit i will be included in the final sample if any unit of A i (including i itself), where A i is a neighborhood of the point i, is selected as part of the initial sample, or if any unit of a network of which unit i is an edge unit is selected, where an edge unit is a neighborhood of the point i but without sample points.
Let m i denote the number of units in A i ; N is the population size; and a i , the total number of units in the network (neighbors of the selected grid: upper, lower, right and left), of which unit i is an edge unit.Note that if the unit satisfies the criterion C, i.e., some data point is found inside the selected grid, then a i = 0, but if the unit i does not satisfy this condition, then m i = 1.The selection probability of unit i in either n 1 observations is p i = m i +a i N .The probability that unit i is included in the sample is given by (Thompson, 1990): When the selection of the initial sample is taken by S RS R , repeated observations in the data can occur either because of possible repeated selections in the initial sample or the initial selection of more than one unit in the cluster.In this sample design, selection probability of unit i in either n 1 observation is p i = m i +a i N , and the probability of inclusion is given by (Thompson, 1990): If the values of Π i are known for all sample units, one can use the Horvitz-Thompson estimator given by µ HT = However, although the values of m i in Equation ( 2) for all units in the sample are known, only a few values of a i are known.This means that i is a unit of edge somewhere in a cluster belonging to the sample, and thus, all clusters that this unit is related to do not need to be sampled.Thus, the value of a i is unknown.To solve this problem, (Thompson, 1990) adopted the practice of dropping the value of a i in Equation ( 2) and considering only the partial inclusion probability.Thus, This probability Π ′ i is now considered for n 1 networks instead of n 1 clusters and can be understood as the probability of the sample initial intercept A i , the network for the unit i, to be used in the estimator.Thus, one obtains an unbiased estimator of the population mean based on the initial intersection probabilities as the following: where I ′ i takes the value 1 (with probability Π ′ i ) if the initial sample intersects A i , and 0 otherwise.In addition where y 1 . . .y n represent the n distinct values of units in the final sample and I i has the value 1 when the unit is included in the sample and 0 otherwise.
Using the properties of mathematical expectation it turns out that the estimator of Equation ( 5) is unbiased, The classical estimator of the population mean under adaptive spatial sampling design is a biased estimator as follows: To facilitate the analysis of Equation ( 5) it is more convenient to rewrite it in terms of distinct networks because the probability of intersection Π ′ i is the same (also called α k ) for each unit i in the kth network.Thus, Similar to the equations of the probability of inclusion and as p jk is the probability that kth and jth networks do not intersect, so where x j is the number of units in the k-th network and J k is the initial sample intersect of the kth network and takes the value 1 (with probability α k ) and 0 otherwise.
Using Equations ( 9) and ( 10) we obtain α jk (the probability of intersection of the kth and jth networks) as Therewith, where y * k is the sum of the y-values for kth network, K is the total number of distinct networks in the population, and k is the number of distinct networks in the sample.
From the properties of mathematical expectation, variance, covariance and the definitions above, one can obtain the expected value and the variance of Equation ( 5) by the following: and an unbiased estimator of the variance of Equation ( 14) is: Another known estimator for adaptive spatial cluster sampling is one that uses the expected number of initial intersection as follows.

Estimators Using the Expected Number of Initial Intersection
The estimator given by Equation ( 5) can be rewritten as: where f i represents the number of units in the initial sample that fall in network A i , which includes the unit i; N is the number of regular grids.If during the estimation process the units edge of clusters is ignored, f i would be interpreted as the number of times the ith unit of the final sample appears in the estimator.Then one realizes that f i = 0 if no units in the initial sample intersect A i .
The estimator in Equation ( 16) is unbiased because Because m i is the number of units on the network to which i belongs, using the Horvitz-Thompson estimator, another unbiased estimator can be found: As f i units are selected from m i units in A i , f i follows a hypergeometric distribution with the following parameters: (N, m i , n 1 ) (Thompson, 1991).Thus, E[ f i ] = n 1 m i N and substituting the expected value in Equation ( 16) we obtain the following: To find the variance of the estimator of Equation ( 18), the approach in terms of n 1 networks being connected is used, although this is not necessarily distinct.Because m i has the same value for all units in A i and w i is the average of m i observations A i (Thompson, 1990), then Thus, µ is the sample mean obtained by taking a selection of an S RS of size n 1 of a population of w i values rather then y i values.Because w i = v k is the same for each unit in the kth network, where v k is the mean of the y-values in β k , there are x k units in the kth network and B K is a set of units in the kth network; thus, From the equations of cluster sampling in two stages, we obtain an unbiased estimator of this variance: where As in some populations a priori information may be known; i.e., where aggregations occur, one can use the technique to reduce the stratified sample variance estimators.To do this, we can use stratified adaptive spatial sampling, where the population is divided into strata and the number of units are sampled for each stratum that is used.

Stratified Adaptive Spatial Cluster Sampling
In the case of adaptive spatial sampling techniques, one must also know the geographic coordinates of the selected area.Thereafter, one stratifies the area using a priori information and draws the grid throughout the selected area (including stratified areas) through their respective locations as indicated in Figure 2 (a).After that, a sample is selected using S RS, as in Figure 2   In the estimators to be considered, the initial sample can also be selected by S RS R or S RS WR .The next section will show three unbiased estimators for this kind of sampling.

Estimators
Suppose that the population total of N units is partitioned into L stratum, with n h units in the hth stratum (h = 1, 2, . . ., L). Define unit (h, i) as the ith unit in the hth stratum with associated y-value y hi .This process begins with a S RS of n h units that is taken from stratum L, and we now define n 0 = ∑ L h=1 n h to be the initial total sample size.From this, the clusters begin to have neighbors added according to the condition set C (Thompson and Seber, 1996).

Estimators Using Initial Intersection Probabilities
Using the full adaptive sample, the first estimator we can consider is given by (5) based on the initial intersection probabilities, we obtain where the K distinct networks are labeled (1, 2, . . ., k) without regard for stratum boundaries, J k equals 1 (with probability α k ) if the initial sample size n 0 intersects network k, and 0 otherwise and, finally, y * k is the sum of the y-values for the network k.
To derive α k it is necessary to consider the probabilities of intersecting network k with the initial samples in each strata.Therefore, we define x hk as the number of units in stratum h that lie in network k.This number assumes the value 0 if the network k lies totally outside stratum h.If the network straddles a boundary, we ignore the network units that lie outside stratum h in the definition of x hk .Thus, with this definition of x hk , we obtain The variance of the estimator of the unbiased average, defined as the probability of the initial sample intercede network in k and k ′ , is obtained in the following way: Because α kk = α k and from the variance properties, it follows that and an unbiased estimator for this variance is given by Another estimator for this kind of sampling is to use the expected number of the initial intersection, which will be explained in the next section.

Estimators Using the Expected Number of the Initial Intersection
Let A hi , the network that contains the unit (h, i), u hi , and A ghi be part of A hi stratum g.Suppose that f ghi is the number of units from the initial sample in stratum g that fall in A ghi , and let m ghi be the number of units in A ghi .
Then, the number of units of an initial sample n 0 units is A hi given by (Thompson and Seber, 1996), From Equation ( 16) one obtains the estimator for the mean As in Equation ( 7) and from the properties of expectation and variance, this estimator is unbiased.
As with f i in Equation ( 16), f ghi follows a hypergeometric distribution with parameters (N g , m ghi , n g ).Therefore, it is known that (Thompson, 1991).Thus, where f ghi represents the number of units in the initial sample that is at the intersection of stratum g with the network drive to which the unit u hi belongs.
If there is a match to add the same neighbors, we obtain an estimator of the independent stratum combined with the estimator with weights, providing an estimator of the population mean as Equation . This characteristic aggregation of equal neighbors generates a loss of efficiency, a more efficient system would allow groups to overlap the boundaries of the strata (Thompson, 1991).So, to find the variance estimator of the mean, we use Equation ( 19) to rewrite µ st in terms of the weights of the sample means.For this, relate the observations to the intercept of the initial sample networks.Thus, the term y hi f .himeans that A hi is intersected f hi times by the initial sample, so that µ st represents a weighted sum of all units in all the networks corresponding to the initial sample, with some networks being repeated.Because the weight E[ f .hi] is the same for each unit in A hi , we have where Y hi is the sum of yth observations in A hi .
Let E[ f.hi] ; then, another way to rewrite Equation ( 31) is where w hi = Y hi ∑ g m ghi ; when n h N h have the same value for all strata.Thus, Equation ( 32) represents a stratified sample mean from a stratified random sampling without replacement, with the interest of w hi variable.
So, the variance estimator for the mean is given by where σ 2 h represents the stratum population variance, that is, where is the stratum population mean.
An unbiased estimator of variance of the mean (33) can be obtained by replacing σ 2 h by sample variance,

Estimators that Ignore Units Added through Crossing Boundaries
According to Thompson (1991), the estimator that ignores units added through crossing stratum boundaries is given by the following: where n h and w ′′ hi is the total of the y-values in the intersection of the stratum h with A hi divided by the number of units in the intersection; i.e., this value represents the network mean for that part of the network A hi in stratum h.

The mathematical expectation of µ
′′ st is given by The variance var[µ ′′ st ] is given by where the stratum population variance is

SAS Macros
The SAS Macros basically use the IML Procedure and GMAP and SQL Procedures.The computational implementation of adaptive spatial sampling requires four steps: 1) development of the computational design of regular grids (Figure 3

Drawing a Regular Grid
To create regular grids it is necessary to create four points with coordinates entered clockwise (lines of Table 1) or counterclockwise.(1,0) In the case of a square, beginning with the clockwise points, i.e., the reference points in the following order: 1, 2, 3, 4, the polygon appears to be like Figure 4 (Square).If that order is not followed, the result is a distorted polygon, as shown in Figure 4 (Distorted Polygon).As one wishes to draw a grid on a field of study, it is necessary to know the upper and lower boundaries of the region, i.e., the minimum and maximum coordinates of the y axis (latitude) and minimum and maximum coordinates of the x axis (longitude).The definition of the size of each polygon is given by %grid macro: %grid(minx =, maxx =, miny =, maxy =, dim =, anno =, printN = YES ); where the parameters are: MINX = the minimum value of the x coordinate; MAXX= the maximum value of the x coordinate.Similarly, for the y coordinates we have: MINY= and MAXY=.Another parameter of this macro is the size of the square drawn given by DIM= (for instance, if DIM= 20, 20 2 = 400 squares will be created).
Finally, the last two parameters, ANNO= and PRINTN = YES, indicate the dataset with the location of samples and whether the numbering of each square will be printed using the command YES(Figure 5   Next, we define the element, id to the coordinates of the square.Thus, the first square has the points (0, 0), (0, 1), (1, 0), (1, 1), id = 1 and so on.This is achieved by joining the This numbering starts from a unit numeric value and goes to the value of N to count the vertical direction, starting from left to right.In the case of Figure 5, it is found that the size of the square is N = 20 × 20 = 400, varying the id from 1 to 400.
The next step is to make the selection of specific areas of the grid; i.e., the grids are drawn by S RS , and if there are samples inside a grid, it is selected by its neighbors.

Selection of Specific Areas of the Grid
The samples to be drawn in adaptive spatial sampling correspond to the polygons of the grid.This selection can be done by a generator corresponding to the number of grid squares of random numbers.In SAS, this can be done by PROC SURVEYSELECT, where a S RS is obtained with a seed value of size n given by the variable SEED.The parameter OUT indicates where the sample will be stored.
proc surveyselect data=&data sampsize=&n out=&saida seed=&seed noprint; run; The identification of the neighbors of the selected areas in the next section involves three concepts: check point inside the polygon; definition of the neighbors; and identification of neighboring polygons.
of the mean (varu1), Equation ( 21) the estimator of the total (Totu1) given by multiplying the number of grids by the estimator u1, i.e., Totu1 = NN× u1, and the estimator of the variance of Totu1, named TotVaru1.
The %as macro computes the estimators and automatically uses the macros presented previously.
%as(data = , n = , sample = , out = , strata = , seed = , map = , id = , anno = , typen = ROOK , printN = YES ); where the parameters are the same as those presented earlier, and n= the sample size and SAMPLE= a dataset containing a predefined sample.Thompson (1990) presents an example of how adaptive spatial sampling works and compares the results obtained from the S RS estimator and from S RS with adaptive spatial sampling, which is given by changing the denominator of Equation ( 19) to the denominator of Equation ( 8).This example could represent a reserve of animals that are grouped (as herds of elephants) or deposits of minerals (such as gold, diamond, iron) spread over large areas.

An Example of Adaptive Spatial Cluster Sampling
Initially, a regular grid is drawn on the area to be sampled, and then, n units (squares) are selected by the S RS method.In this example, the initial sample consists of 10 units (total squares on the grid in red) selected in a total of N = 400 units (representing the total number of regular square grids, where each side has a length of 20, or 20 × 20 = 400), with a total of 190 points (Figure 7 (c)).
Selecting the neighbors (by the ROOK methodology) of the initial units containing at least one unit in the initial sample, we obtain the final sample, as shown in Figure 7(d).The upper unit has an element that intersects with the network m 1 = 6 units, containing a total of y * 1 = 36 units of interest.Another point in which there is unity within the polygon that intersects the network m 2 = 11 units and contains y * 2 = 107 units.For the other 8 units of the initial sample, the values are y i = 0 and m i = 1.
There are also 20 edge units that are not used in calculating the estimates; these are selected for adaptive selection, but they do not contain units of interest.In Figure 7(d) networks within the two groups that are described as being adaptively added are in the color red.For w 1 = 36 6 = 6 objects per unit, for w 2 = 107 11 = 9.727 and for the remaining w i = 0, one can calculates the values for the mean estimators, µ, and from the total of the adaptive sampling: )] = 1.573 For S RS , where N is the total number of square areas selected and n is the number of selected squares of the initial sample, one obtains the values for the estimators of the mean y and for the total Ny: For the 45 units, which includes the 25 edge units of the final sample, the values for the estimators of the average y AD for adaptive S RS are calculated; that is, the amount of S RS Equation in Equation ( 19) is used.Thus, 178 Table 2 presents the estimates found and it appears that the variance, mean and total sampling of the adaptive S RS is the lowest compared to the others.However, their estimated average is higher, because there is a bias when using the estimator of S RS in this sample.Comparing the ratio of the variances y AD and µ, we observe that there is a reduction of 13% in this value.Thus, given that it has a total of 190 points and the actual population mean is µ = 190 400 = 0.475, adaptive spatial sampling in this case was very close to the S RS ; however as will be seen later, adaptive spatial sampling varies much less when N varies.
The computational output of the program implemented in SAS software for this example is given in Figure 8 (the results are the same as in Thompson (1990)).Thus, there is the number of observations (n = 10), population size (N = 400), the estimators for the mean and total and their respective variances in the three cases analyzed: adaptive spatial cluster sampling, S RS and adaptive S RS sampling (biased).

Comparison between Different Population Sizes
In this section, interference variation for the total areas (grids) in the estimates will be checked, i.e., the variation in N. Thus we have simulated different sizes of squares and the initial samples were set to have the same sample as the sample (Thompson, 1990).Thus, we obtained the results in Table 3, with the respective values of the estimators of the mean and their estimated variances.Figure 9 shows how the estimated average is influenced in the case of population variation.We can see that adaptive spatial cluster sampling (solid green line) had the lowest average interference with the change in population, undergoing a decrease with an increase in the size of the regular grid, except when N = 7. S RS (blue dotted line) underwent a large change throughout the process.In addition, adaptive S RS sampling -S RS AD (dashed red line) -shows a decrease with a slight increase when N = 8. Figure 10 represents how the estimate of the variance of the average is influenced in the case of variation in the population.It is apparent that the variance in adaptive sampling is less affected by population size, having a range of 0 to 15, while S RS ranges from 10 to 75 and S RS AD from 0 to 15.
Figure 10.Analysis of the variance when the population size increases (ROOK).
Similarly, we obtain the results in Table 4 for the estimators of the Total.Figure 11 shows the behavior of the total estimator when the population size varies.For this case, the estimator of the total adaptive sampling -Nµ -is the one with less variation when compared with the other two (Ny and Ny AD ).The variation of the estimator Ny increases when the population increases.Figure 12 represents how the estimator of the variance in the estimator of the total changes with the variation in the population.We can observed that the estimator N 2 var(µ) and N 2 var(y AD ) are closer and N 2 var(y) has large variation throughout the process.
Figure 12. Analysis of the variance of the total when the population size increases (ROOK).
Figure 13 represents how the estimator of the variance in the estimator of the total changes with the variation in the population, with the largest values of N 2 var(y) removed.Notably, the variance is not constant as in Figure 12, showing disorganized growth for S RS and similar growth in the other two cases.
Figure 13.Analysis of the variance of the total when the population size increases (ROOK).Thompson (1990) shows an example of how the stratified adaptive spatial cluster sampling technique works and compares the obtained results when considering whether the boundaries are present between the stratum.Initially, a regular grid is drawn on top of the area to be surveyed, and then, n units (squares) are selected by the S RS method.

Stratified Adaptive Spatial Cluster Sampling
Figure 13.Stratified adaptive spatial cluster sampling.
The number of objects found in the analyzed area in Figure 14 (a) is 397 elements, within a total of N = 400 squares.Thus, it follows that the population mean is µ = 397 400 = 0.9925.For this example, the region was divided into two strata, where for S RS , an initial n = 10 elements was selected with stratified adaptive spatial cluster sampling with equal sizes in each stratum.In stratum 1, we see a total of N = 200 squares and n = 5 elements for the initial sampling units, whereas in stratum 2, the others are N = 200 squares and n = 5, the total for the area.
As an example of adaptive spatial cluster sampling, the unit satisfies the condition if in each selected square one or more elements of interest is found.Because this condition is verified, it selects its neighbors.The neighborhood of each unit includes all adjacent units.Thus, a neighborhood can be analyzed in two ways: ignoring the existing boundary between strata to select the neighbors of a unit, or considering this limit.
In the first case, a unit to be selected as an element and that is in the square that has contact with the division of the stratum will have four neighbors -top, bottom, right and left -regardless of whether it is in a different stratum.Thus, the value of w ′ hi for the estimator µ ′ , which ignores the limits of the strata, is zero for all units that do not satisfy the condition.
The first network intersect stratum 1, given in Figure 14 (d), and has a value of w ′ 11 = 96 6 = 16.For the second network of intersection, the value is given by w ′ 12 = 78 5 = 15.6, based only on the units of stratum 1.Thus, there is no intersection in stratum 2. Therefore, the estimate of the mean of the population and the estimated variance of µ ′ , given by Equations ( 35) and (37), respectively, is: where 74.9 is the variance of the five numbers (16; 15.6; 0; 0; 0).
In the second case, a unit to be selected as an element and that is in the square that has contact with the division of the stratum will have three neighbors: top, bottom, right (or left), depending on whether this is in a different stratum.Thus, to calculate the estimator µ (32), it is used for the same stratum n h N h .This obtains the variables w hi , i.e., w 11 = 96 6 = 16 for the first network and w 12 = 192 11 = 17.45 for the second.The estimate for the mean and its variance given by Equations ( 32) and (33), respectively, is:  Vol. 4, No. 4;2015 where 84.2 is the variance given by the five values of w 1i .
Table 5 presents the calculated estimates and Figure 15 shows the output of SAS; it appears that there is no significant difference between the estimators of the mean and variance of the estimated average if the boundaries of the strata are considered.
Table 5.Comparison between the estimators of stratified adaptive spatial cluster sampling.

Final Remarks
This study shows that adaptive spatial cluster sampling suffers less variation between S RS and adaptive S RS , which demonstrates that it is a biased estimate.In Section 5, a comparison between different population sizes indicated that adaptive spatial sampling by cluster suffers less variation in the estimators than the other two samples.
Stratified adaptive spatial cluster sampling showed no significant difference between the estimators of the mean, or the estimated average, regardless of whether we consider the limits of the strata variances.
In conclusion, it follows that the computational algorithm for adaptive spatial sampling in this work is important, as this new technique has a variety of applications and users thus far do not have a computational tool to use it.
(b).Then, the units of interest are identified, as in Figure2 (c).Finally, one successively adds the neighbors of selected areas -upper, lower, right and left -until the selection criterion of the adaptive sample is exhausted, as in Figure2 (d).

Figure 2 .
Figure 2. Steps of stratified adaptive spatial cluster sampling (a)); 2) selection of specific areas of the grid, that is, identifying a sample and determining in which part of the grid the data are located (Figure 3(b)); 3) identification of the neighbors of the selected areas: upper, lower, right and left (Figure 3(c)(d)); 4) calculation of the parameters.

Figure 3 .
Figure 3. Steps of adaptive spatial sampling

Figure 8 .
Figure 8.Output of adaptive spatial cluster sampling.

Figure 9 .
Figure 9. Analysis of the mean when the population size increases (ROOK).

Figure 11 .
Figure 11.Analysis of the total when the population size increases (ROOK).

Figure 15 .
Figure 15.Output of the stratified adaptive spatial cluster sampling.

Table 1 .
Coordinates of a square

Table 2 .
Table of comparison of the estimators of adaptive sampling, S RS and adaptive S RS

Table 3 .
Comparison between the estimators of Mean: adaptive sampling, S RS , adaptive S RS (ROOK)

Table 4 .
Comparison between the estimators of the total: adaptive sampling, S RS , adaptive S RS (ROOK)