Randomly labels two or more spatial point patterns (M.A. Mugglestone, S.A. Harding, B.Y.Y. Lee, P.J. Diggle & B.S. Rowlingson).
|What to print (
||Seed for the random numbers used to create the random labellings; default 0|
||Vertical coordinates of two or more spatial point patterns; no default – this parameter must be set|
||Horizontal coordinates of two or more spatial point patterns; no default – this parameter must be set|
||Variates to receive the vertical coordinates of the spatial point patterns created by random labelling|
||Variates to receive the horizontal coordinates of the spatial point patterns created by random labelling|
This procedure pools the coordinates of two or more spatial point patterns (specified using the
OLDY parameters) and randomly groups (or labels) the points to form n new patterns, where n is the number of patterns supplied using
OLDY. Each new pattern contains the same number of points as its old counterpart. The coordinates of the new patterns can be saved using the parameters
SEED option allows a seed to be supplied for generating the random numbers used to create the random labelling (thereby producing reproducible results). If this is not supplied, the default of 0 initializes the random number generator (if necessary) from the system clock.
Printed output is controlled using the
i = 1 … n).
PTCHECKXY is called to check that each pair of structures in
OLDY have identical restrictions. The procedure
APPEND is then used to create a single variate containing the horizontal coordinates of all the point patterns and a factor whose levels indicate the source (original label) of the points. The vertical coordinates are combined in a similar way. The
SORT functions are then used to randomly permute the labels. Finally, the
RESTRICT directive is used to extract the horizontal and vertical coordinates corresponding to each level of the permuted factor.
If any of the variates in
OLDY are restricted, only the subset of values specified by the restriction will be included in the calculations.
CAPTION 'GRLABEL example'; STYLE=meta VARIATE xcross; VALUES=!( 4, 5, 6, 6, 6, 6, 7, 8) & ycross; VALUES=!(16,16,14,15,17,18,16,16) & xcircle; VALUES=!(14,14,15,15,16,16,17,17) & ycircle; VALUES=!(10,11, 9,12, 9,12,10,11) GRLABEL [PRINT=*; SEED=841641] OLDY=ycross,ycircle; OLDX=xcross,xcircle;\ NEWY=rly1,rly2; NEWX=rlx1,rlx2 DPTMAP [YLOWER=0; YUPPER=20; XLOWER=0; XUPPER=20]\ Y=rly1,rly2; X=rlx1,rlx2