KSED procedure
Calculates the standard error for K function differences under random labelling (M.A. Mugglestone, S.A. Harding, B.Y.Y. Lee, P.J. Diggle & B.S. Rowlingson).
Option
Parameters
Description
The K function, or reduced second-order moment function, relates to the distribution of the inter-event distances between all ordered pairs of events in a spatial point pattern (see Diggle 1983). The procedure KHAT can be used to obtain an approximately unbiased estimator of K(s) for an observed pattern, and this may be used to investigate the degree of clustering/regularity in the pattern. Patterns consisting of two different types of events may be separated into two patterns, one for each type of event. The difference between the K functions for the two univariate patterns may then be used to investigate whether the two types of events display similar degrees of clustering/regularity. (If the difference between the K functions is positive (negative) then the first pattern is more (less) strongly clustered than the second.)
The term random labelling is used to represent the hypothesis that the spatial distributions of different types of events within an overall pattern are completely random. The expected value of the difference between two K functions under random labelling is zero. The standard error of the estimated difference can be obtained using the method of Diggle & Chetwynd (1991).
The procedure KSED calculates the standard error for the difference between two K functions under random labelling. The data required by the procedure are the coordinates of two spatial point patterns (specified by parameters X1, Y1, X2 and Y2), the coordinates of a polygon containing the points (specified by the parameters XPOLYGON and YPOLYGON) and a vector of distances at which to estimate the K functions (specified by the parameter S). The output of the procedure is a vector containing the standard error for the difference between the two K functions for each distance in S. The values of the standard error can be saved using the parameter KSED.
Printed output is controlled using the PRINT option. The default setting of summary prints the distances at which the standard error is calculated and the values of the standard error under the headings S and KSED.
Option: PRINT.
Parameters: Y1, X1, Y2, X2, YPOLYGON, XPOLYGON, S, KSED.
Method
A procedure PTCHECKXY is called to check that X1 and Y1 have identical restrictions. Similar checks are made on X2 and Y2, and XPOLYGON and YPOLYGON. The procedure then calls PTCLOSEPOLYGON to close the polygon specified by XPOLYGON and YPOLYGON. The SORT function is then used to create a variate containing the distances in S arranged in ascending order. (The original variate is left unchanged.) The procedure then calls APPEND to combine the horizontal coordinates for both patterns, and again to combine the vertical coordinates. The coordinates of the closed polygon, the sorted values of S and the combined coordinates for the two patterns are then passed to the Fortran program using a procedure PTPASS. This program calculates the variance-covariance matrix for the difference between the K functions for the two patterns. Finally, the standard error for the difference between the two K functions is obtained using the CALCULATE directive by taking the square root of the values on the diagonal of the variance-covariance matrix.
Action with
RESTRICT
The variates X1, Y1, X2, Y2, XPOLYGON, YPOLYGON and S may be restricted as long as X1 has the same restriction as Y1, X2 has the same restriction as Y2, and XPOLYGON has the same restriction as YPOLYGON. Only the subset of values specified by each restriction will be included in the calculations.
References
Diggle, P.J. (1983). Statistical Analysis of Spatial Point Patterns. Academic Press, London.
Diggle, P.J. & Chetwynd, A.G. (1991). Second-order analysis of spatial clustering. Biometrics, 47, 1155-63.