KSTMCTEST procedure

Performs a Monte-Carlo test for space-time interaction (D.A. Murray, P.J. Diggle & B.S. Rowlingson).


Options

PRINT = string
Controls printed output (statistic, rank); default stat, rank

PLOT = string
Whether to produce a plot of the test statistic (histogram); default hist

NTIMES = scalar
Number of simulations for Monte-Carlo test; default 49

SEED = scalar
Seed for random number generator; default 0 continues from previous generation or uses system clock


Parameters

Y = variates
Vertical coordinates of the first spatial point patterns; no default - this parameter must be set

X = variates
Horizontal coordinates of the first spatial point patterns; no default - this parameter must be set

TIMES = variates
Times for each event

YPOLYGON = variates
Vertical coordinates of the polygons; no default - this parameter must be set

XPOLYGON = variates
Horizontal coordinates of the polygons; no default - this parameter must be set

S = variates
Vectors of distances to use; no default - this parameter must be set

TVALUES = variates
Time scales for the analysis

TLOWER = variates
Lower temporal domain

TUPPER = variates
Upper temporal domain

STATISTIC = scalars
Saves the Monte-Carlo statistic


Description

For data that consist of locations and times of events within a specified spatial region and time-period, it is often of interest to examine whether events that are relatively close in space are also relatively close in time. Data that have events both close in space and time are said to exhibit space-time clustering. KSTMCTEST performs a Monte-Carlo test for space-time interaction using a sum of the residuals as a test statistic. For a given number of simulations the procedure randomly permutes the times of set of points, and computes the sum of differences between the space-time K function and the product of the spatial and temporal K functions. The first simulation represents the observed value of the test statistic.

   The data required by the procedure are the coordinates of a spatial point pattern (specified by the parameters X and Y), and the times for each of the events (specified by TIMES). The coordinates of a polygon containing the spatial points are specified by the parameters XPOLYGON and YPOLYGON, and the S parameter is used to supply the vector of distances at which to calculate the spatial K function. The TLOWER and TUPPER parameters specify the start and finish of the temporal range. The TVALUES parameter is used to supply the vector of times at which to calculate the temporal K function. The output of the procedure are vectors of estimates of the spatial and temporal K function corresponding to the distances in S and times in TIMES. The values of the test statistic can be saved using the STATISTIC parameter.

   The NTIMES option allows you to specify the number of simulations and the SEED option allows you to set a randomization seed. By default SEED=0, so the random numbers will continue any existing sequence, used earlier in the GenStat program. The setting PLOT=histogram can be used to produce a histogram of the test statistics with the value for the data indicated with a vertical line.

   Printed output is controlled using the PRINT option. The default setting of summary prints the test statistic for the Monte-Carlo test, and rank prints how the test statistic for the data ranks with the simulations.

 

Options: PRINT, PLOT, NSIM, SEED.

Parameters: Y, X, TIMES, YPOLYGON, XPOLYGON, S, TVALUES, TLOWER, TUPPER, STATISTIC.


Method

A procedure PTCHECKXY is called to check that X, Y and TIMES have identical restrictions. A similar check is made on XPOLYGON and YPOLYGON. The procedure then calls PTCLOSEPOLYGON to close the polygon specified by XPOLYGON and YPOLYGON. For each simulation the procedure randomly permutes the times of the set of points and then calls a procedure PTPASS to call a Fortran program to calculate an estimate of the space-time K functions. The difference between the space-time K function and the product of the spatial and temporal K functions is then calculated.


Action with RESTRICT

The variates X, Y, TIMES, XPOLYGON, YPOLYGON, S and TVALUES may be restricted, as long as X, Y and TIMES have the same restriction, 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., Haggkvist, R. & Morris, S.E. (1995). Second-order analysis of space-time clustering. Statistical Methods in Medical Research, 4, 124-136.