The Scientific World Journal

Volume 2014 (2014), Article ID 698296, 23 pages

http://dx.doi.org/10.1155/2014/698296

Research Article

Testing Spatial Symmetry Using Contingency Tables Based on Nearest Neighbor Relations

Elvan Ceyhan

Department of Mathematics, Koç University, Sarıyer, 34450 Istanbul, Turkey

Received 23 August 2013; Accepted 22 October 2013; Published 19 January 2014

Academic Editors: A. Barra, S. Casado, and J. Pacheco

Copyright © 2014 Elvan Ceyhan. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

Abstract.

We consider two types of spatial symmetry, namely, symmetry in the mixed or shared nearest neighbor (NN) structures. We use Pielou’s and Dixon’s symmetry tests which are defined using contingency tables based on the NN relationships between the data points. We generalize these tests to multiple classes and demonstrate that both the asymptotic and exact versions of Pielou’s first type of symmetry test are extremely conservative in rejecting symmetry in the mixed NN structure and hence should be avoided or only the Monte Carlo randomized version should be used. Under RL, we derive the asymptotic distribution for Dixon’s symmetry test and also observe that the usual independence test seems to be appropriate for Pielou’s second type of test. Moreover, we apply variants of Fisher’s exact test on the shared NN contingency table for Pielou’s second test and determine the most appropriate version for our setting. We also consider pairwise and one-versus-rest type tests in post hoc analysis after a significant overall symmetry test. We investigate the asymptotic properties of the tests, prove their consistency under appropriate null hypotheses, and investigate finite sample performance of them by extensive Monte Carlo simulations. The methods are illustrated on a real-life ecological data set.

1. Introduction

The analysis of spatial point patterns in natural populations (in and ) has been studied extensively. In particular, spatial patterns in epidemiology, population biology, and ecology have important practical consequences. Since the early days of this research, most of the research has been on data from one class, that is, on spatial pattern of one class with respect to the ground (e.g., intensity, clustering, etc). An example of a pattern in a one-class framework is aggregation [1]. It is also of practical importance to investigate the spatial interaction between two or more classes, for example, spatial patterns of one class with respect to other classes [2]. Two frequently studied spatial patterns between multiple classes or species are segregation and association. Segregation occurs when an individual is more likely to be found near conspecifics (i.e., individuals of the same species) [3] and association occurs when an individual from one class is more likely to be found near individuals from the other class.

There are many tests available in the literature for the analysis of spatial point patterns in various fields. An extensive survey is provided by Kulldorff [4] who enumerates more than 100 such tests, most of which need adjustment for some sort of inhomogeneity. However, none of the tests surveyed by Kulldorff [4] are designed for testing spatial symmetry. Most of the tests for multiple classes deal with the existence (or lack) of spatial interaction (in the form of spatial association or segregation) between the classes.

In the literature, Baczkowski and Mardia [5] proposed methods for testing spatial symmetry based on the sample semivariogram. Their methods are applicable for a Gaussian doubly geometric process on a regular lattice. The latest methods for testing and detecting isotropy, symmetry, and separability in spatiotemporal models are discussed in a recent book by Sherman [6] who investigated these properties in the directional sense. For example, isotropy is assessed in the sense of direction-independence of the second-order properties of the spatial point pattern. Spatial symmetry is not only useful in ecological contexts (as in spatial symmetry of plant species in a region of interest), but also in socioeconomic theory to help understand spatial equilibrium configurations [7]. Axial symmetry methods based on the sample periodogram for data collected on a rectangular lattice are also considered and shown to perform well in Scaccia and Martin [8].

The methods discussed in the current paper are the spatial symmetry tests based on NN relationships. There are at least six different groups of NN methods for spatial patterns (see, e.g., [9]). These methods are based on some measure of (dis)similarity between a point and its NN, such as the distance between the point and its NN or the class types of the point and its NN. For example, Pielou [2] constructed nearest neighbor contingency tables (NNCTs) which yield tests of segregation (positive or negative), symmetry, and niche specificity, and a coefficient of segregation in a two-class setting. Additionally, Dixon devised overall, class- and cell-specific tests based on NNCTs for the two-class case in [10] and extended his methodology to multiclass case in [3]. Pielou’s and Dixon’s symmetry tests are designed to detect the symmetry (or lack of it) in the mixed or shared NN structure and are the only tests for detecting such symmetry structure (to the authors knowledge). Symmetry in mixed NN structure implies equality of the expected values of the number of NN pairs in which the points in the pair are from different classes, while symmetry in shared NN structure implies that the proportion—with respect to the class size—of number of times points from one class serving as NN to other classes is equal for all classes. Asymmetry in mixed NN structure would be suggestive of different types or levels of spatial interaction between the two classes of points, while asymmetry in shared NN structure would indicate differences in spatial distribution of points from one class with respect to all the points (from both classes) in the study region compared to that of points from the other class.

Pielou has described her symmetry tests for completely mapped data in , although her tests are not appropriate for such data [10, 11]. A data set is completely mapped, if the locations of all events in a defined space are observed. We assume that data is sparsely sampled; that is, only a (random) subset of NN pairs is observed for Pielou’s first type of symmetry test. Pielou’s first type of symmetry and Dixon’s symmetry test are based on the NNCTs that are constructed using the NN frequencies. Both tests are defined for the two-class case only. Pielou’s second type of symmetry test is based on the frequencies of number of times points in a class serve as NNs yielding a contingency table which we call -symmetry contingency table. So, points from each class are categorized into six groups, namely , where a point serving as a NN to no other point is in category “0,” to one other point is in category “1,” and so on. Due to geometric constraints, in , a point can not serve as a NN to more than six points. For data from a continuous distribution, a point can serve as a NN to at most five points almost surely. Under spatial symmetry in shared NN structure in a multiclass case, the frequencies of these six categories should have the same distributional form for each class.

Pielou’s symmetry tests were introduced and illustrated in [2], while Dixon’s symmetry test was introduced in passing in [10]. None of tests were extensively studied nor investigated for size and/or power performance. In this paper, we investigate the underlying assumptions for these symmetry tests. We derive their asymptotic distributions under appropriate null hypotheses and extend these symmetry tests to multiclass case. In particular, we demonstrate that Pielou’s first type of symmetry test is extremely conservative when used as McNemar’s test with its asymptotic critical value and hence should be avoided in practice (or its Monte Carlo randomized version can be used). We also show that various patterns can constitute as the null case for Dixon’s symmetry test and Pielou’s second type of symmetry test but derive the asymptotic distributions of these tests under CSR independence and RL patterns only. We also investigate the use of Fisher’s exact test on the -symmetry contingency table used for Pielou’s second type of symmetry test (for shared NN structure). Moreover, the tests discussed in this paper are constructed using the NN relations based on the usual Euclidean distance; so we discuss the generalization of the tests for the case in which NN relations are defined by a dissimilarity measure. Furthermore, we discuss the extension of the methodology to high or infinite dimensional data. In a multiclass setting, first the overall symmetry is tested and if the overall test is significant we propose various post hoc tests such as pairwise symmetry tests or one-versus-rest type tests. The local asymptotic power of the tests is also investigated using the local approximation of the power function or Pitman asymptotic efficiency. Finite sample empirical (size and power) performance comparisons are investigated by Monte Carlo simulations.

We describe and discuss switch the order of these two parts, tests of symmetry in NN structure, their extension to multiclass case, and the corresponding sampling frameworks for the cell counts (i.e., entries in the contingency tables) in Section 2. We discuss the variants of Fisher’s exact test for the -symmetry contingency table in Section 3 and asymptotic power analysis (i.e., consistency of the tests and their asymptotic efficiency) in Section 4 and provide an extensive empirical performance analysis by Monte Carlo simulations in Section 5. We discuss the use of one-versus-rest and pairwise tests as post hoc tests in Section 6, illustrate the methodology on an ecological data set in Section 7, discuss the extension of the methodology to the case where NN relations are defined with dissimilarity measures in Section 8, and provide some guidelines and discussion in Section 9.

2. Tests of Symmetry in the NN Structure

Two or more classes may exhibit many different forms of spatial asymmetry. Although it is not possible to list all possible asymmetry types or configurations, existence of asymmetry can be detected by an analysis of the NN relationships of the class members.

2.1. Preliminaries

The null case for asymmetry alternatives is that there is symmetry in the allocations of points with respect to each other. In particular, consider symmetry in mixed NN structure for two classes and . Then the null case is that the expected number of times class points serving as NN to class would be the same as the expected number of times class points serving as NN to class . On the other hand, for symmetry in shared NN structure, the vector of relative frequencies (with respect to the class size) of points from each class serving as NN to other points is the same for all classes. In general, the null hypothesis for symmetry in mixed NN structure would be implied by a more general pattern, namely, if there is randomness in the NN structure in such a way that the probability of a NN of a point being from a class is proportional to the relative frequency of that class. This assumption holds, for example, under RL or CSR independence of the points from each class. Under CSR independence, the points from each class are independent realizations of homogeneous Poisson process (HPP) with fixed class sizes. In particular, conditioned on the class sizes, the points are independently uniformly distributed in the region of interest. Under RL, class labels are independently and randomly assigned to a set of given locations, where these locations could be from HPP or some other clustered or regular pattern. The null hypothesis for symmetry in shared NN structure would be implied if there is randomness in the NN structure in such a way that the probability of a point from a class serving as NN to other points is proportional to the relative frequency of that class. This assumption also holds under RL or CSR independence of the points from each class. Therefore, both CSR independence and RL patterns would imply symmetry in the mixed or shared NN structure.

Pielou suggests two types and Dixon suggests one type of symmetry tests in the two-class case. Pielou’s first type of symmetry test and Dixon’s symmetry test are defined for the two-class case only and are based on the corresponding NNCT. We provide a brief description of NNCTs; for a more detailed discussion see, for example, [12]. Suppose that there are classes labeled as . NNCTs are constructed using NN frequencies for each class. Let be the number of points from class for and . If we record the class of each point and its NN, the NN relationships fall into categories: , where in category , class is the base class and class is the class of the NN. Denoting as the observed frequency of category for , we obtain the NNCT in Table 1, where is the sum of column ; that is, a number of times class points serve as NNs for . Note also that , , and . Throughout the paper, we adopt the convention that random variables are denoted with upper case letters and fixed quantities with lower case letters. Notice that row sums (i.e., class sizes) are assumed to be fixed, while column sums (i.e., number of times a class serves as NN) is random in our NNCTs.

Table 1: The NNCT for two classes.

NN class
Total

Class 1
Class 2

Base class

    Class 1

    Class 2

Total

2.2. Pielou’s First Type of Symmetry Test

Pielou’s first type of symmetry test involves testing equality of expected values of mixed NN frequencies, that is, the equality of expected values of off-diagonal entries in the NNCT. So Pielou’s first type of symmetry test is used to detect the symmetry in the “mixed NN structure.” In this case, if , spatial allocation of points from two classes is symmetric with respect to the (mixed) NN structure; otherwise, the population is asymmetric. When two classes, and , are of equal size, in a symmetric population, points from each class are equally likely to serve as NN to points from the other class, and, in an asymmetric population, points from one class, say class , tend to serve more as NN to points from class compared to class serving as NN to points from class . So the null hypothesis is

which may have various forms based on the assumed underlying frameworks for the contingency tables in general and for the NNCTs.

The two-sided alternative is usually a more reasonable alternative, although one-sided alternatives are also possible. Pielou [2] tests for significant differences between and with a test (with Yates’ correction) with 1 df using

which is the same as the McNemar’s test with continuity correction [13]. This test is appropriate only for sparsely sampled data and large with neither or being too small compared to each other and applicable only for the two-class case. So we suggest the approach recommended in Remark 1 below. The discussion till the end of this subsection is for (properly) sparsely sampled data. Furthermore, in a population in which two classes are highly segregated or the intensities (number of points per unit area) of the classes are very different, the frequencies and can be too small, which renders the approximation inappropriate for the test in (2). In such a case, one can use the exact finite sample distribution of which follows a binomial distribution (conditionally). Given that , the test statistic has a distribution under for properly sparsely sampled data, where stands for the binomial distribution with independent trials with probability of success . So, for small , the statistic, , can be used with the binomial critical values. For large ,

has approximately distribution, so can be used for the one-sided alternatives. Furthermore, the test in (2) has approximately distribution, which can only be used for the two-sided alternative.

Pielou’s first type of symmetry test can be extended to the multiclass case (with ) as

Under : “, for all ”, in (4) is the same as Bowker’s test of symmetry, which is an extension of McNemar’s test for the contingency tables [14]. The test statistic in this case has distribution asymptotically.

2.2.1. The Row-Wise Multinomial Framework

In general, a contingency table may result from various frameworks. The first type of framework is the row-wise multinomial framework, where each row in a contingency table is independent of other rows and is from a multinomial distribution. That is, letting the entries of the contingency table be denoted as (as in the NNCT in Table 1), we have entries in row having , where is the probability of an experimental unit being from row category and column category simultaneously and standing for the multinomial distribution with independent trials and the probability of a trial resulting in category is with . In the contingency table, the rows will have two entries, so the multinomial distribution reduces to a binomial distribution. More specifically, we would have (or ) for .

In a NNCT, is the number of classes and is the probability of a point from class serving as a NN to a point from class for . However, a NNCT is unlikely to result from a row-wise multinomial framework. In a NNCT, a trial is the categorization of a base-NN pair; that is, a trial is “determining the type of a base-NN pair.” For entry , a trial results in success, if a base-NN pair belongs to category (i.e., base point is from class and its NN point is from class ). For example, in a contingency table, in general, and are assumed to be independent and so are the individual trials under the row-wise multinomial framework. This assumption is invalid when the NNCT is based on completely mapped data because independence between rows is violated (see also Remark 1). If the NNCT is constructed using a random sample of base-NN pairs, then the usual contingency table assumptions under the row-wise multinomial framework would hold. Such a NNCT can be (approximately) obtained only if a (small) subset of all the base-NN pairs obtained from the data in the study region was randomly selected; that is, if the data is obtained by an appropriate sparse sampling. When the data were properly sparsely sampled, we will assume that the NNCT satisfies the usual independence assumptions in the row-wise multinomial framework henceforth. In this framework, the explicit form of the null hypothesis becomes

When the NNCT is constructed from a sparsely sampled data, the rows are assumed to be from the same multinomial distribution, so the entries in row satisfy for , where is the probability of a NN point being from class . Then, under in (5), we have , which holds if and only if if and only if . Since in a two-class setting, we have if and only if . Letting be the proportion of points from class in our sample, we have if and only if . One-sided or two-sided alternatives are possible for the in (5).

2.2.2. The Overall Multinomial Framework

An alternative framework for a general contingency table is the overall multinomial framework. In this case, the cell counts are assumed to arise from independent multinomial trials. That is, for example, for a contingency table,

For a NNCT, if the data is completely mapped, independence between trials is violated again. Under sparse sampling, this framework is able to model a NNCT approximately. That is, if the NNCT is based on a random sample of base-NN pairs, it will (approximately) satisfy the assumptions in the overall multinomial framework because of the inherent correlation between components or entries of a multinomially distributed random variable. For example, in a two-class setting with sparsely sampled data, we have

where and . Then the null hypothesis of symmetry becomes

which is equivalent to or equivalently since and . Row-wise and overall multinomial frameworks are closely related. Conditional on , the overall multinomial framework reduces to the row-wise multinomial framework. But a NNCT for completely mapped data does not fit to the overall multinomial framework either, due to the inherent spatial dependence and the row sums being fixed. McNemar’s test (and hence Bowker’s test) is only appropriate in the overall multinomial framework and is extremely conservative for the row-wise multinomial framework. In particular, in a NNCT for completely mapped data, we have row sums (i.e., class sizes) fixed as in the row-wise multinomial framework. Hence, Pielou’s first type of symmetry test would also be extremely conservative for the NNCTs.

Remark 1. In Pielou’s first type of symmetry test, both of the above multinomial frameworks assume that the trials are independent multinomial trials. However, when a trial is the base-NN relation, the assumption of independence between trials is violated. The dependence mainly originates from the fact that a point is more likely to be the NN of its own NN (i.e., more likely to form a reflexive (base, NN) pair); hence, many reflexive pairs are possible. Thus, Pielou’s test is influenced by deviations not only from the null case but also by deviations from dependence on trials. The dependence due to reflexivity can not merely be avoided by random subsampling but can be circumvent by an appropriate sparse sampling [15]. The assessment of various sparse sampling schemes for these tests is a topic of ongoing research. Furthermore, Pielou’s first type of symmetry test requires the NNCT resulting from an overall multinomial framework, which does not hold for a NNCT based on completely mapped data either. So Pielou’s first type of symmetry test is only appropriate under the overall multinomial framework (with random row sums), which can be satisfied by an appropriate sparse sampling. Our suggestion for Pielou’s first type of symmetry test is as follows. If the data is properly sparsely sampled under the overall multinomial framework, then one can employ it. But if the data is completely mapped, to remove the influence of spatial dependence on Pielou’s first type of symmetry test, we suggest the usual Monte Carlo randomization, where class labels are randomly assigned to the given points a large number of times and test statistics are computed, and the value of the test is based on the rank (scaled by the number of Monte Carlo replications) of the test statistic of the original data in the sample of test statistics obtained from Monte Carlo randomization procedure.

2.3. Dixon’s Symmetry Test

Dixon [10] also suggested a symmetry test for testing the equality of frequency of mixed NNs (or between class NNs), that is, the equality of the expected values of the off-diagonal entries in the NNCTs. So the null hypothesis is given by

and, under RL or CSR independence, for . Notice that the null hypotheses for Dixon’s symmetry test and Pielou’s first type of symmetry test look identical; however, the corresponding underlying assumptions are different. Pielou’s first type of symmetry test is only appropriate when the data are (properly) sparsely sampled under overall multinomial framework, whereas Dixon’s symmetry test is appropriate when the data are completely mapped. That is, Pielou’s first type of symmetry test is appropriate when we have a random sample of base-NN pairs under overall multinomial framework; that is, between-row independence assumptions are satisfied (up to the inherent correlation for multinomial entries) and, hence, ignore the spatial information. On the other hand, Dixon’s test can be used for completely mapped data and takes the spatial dependence into account.

Under RL, the test statistic for Dixon’s symmetry test is given by

where since and with

for and

Here , , and are the probabilities that a randomly picked pair, triplet, or quartet of points, respectively, are from the indicated classes and are given by

Furthermore, is the number of points with shared NNs, which occurs when two or more points share a NN and is twice the number of reflexive pairs. Then , where is the number of points that serves as a NN to other points times. For large , asymptotically has distribution. A two-sided alternative and one-sided alternatives are possible with the test statistic, .

We describe this setting in a broader context with classes. Let be the probability of an arbitrary point being from class and be the probability of a base-NN pair with base point being from class and its NN being from class . Then, under RL, we have and the expression     () can be viewed as an estimator or approximation for for large , where stands for the indicator function. Furthermore, for large , the null hypothesis of symmetry is equivalent to

In Dixon’s framework, for large , the row marginals satisfy and the column marginals satisfy .

The symmetry in mixed NN frequencies may result from various patterns. In particular, under RL or CSR independence, in (9) would hold. In a RL framework with fixed allocation of points, the quantities and are also fixed, but, for a CSR allocation of points, and are random with and for large (estimated empirically by Monte Carlo simulations for homogeneous planar Poisson pattern). Hence, in (10) and its distribution is conditional on and under CSR independence but unconditional under RL. To be more precise, under CSR independence, the expected values for are as in RL, but the variances and covariances are conditional on and . Given the difficulty in finding the distribution of and under CSR, we use their observed values even if the null hypothesis is implied by CSR independence.

2.3.1. Extension of Dixon’s Symmetry Test to Multiclass Case

Dixon’s symmetry test can be extended to the case as follows. Consider the values for . Combining values for , we obtain the vector

which has length . Under RL, and , where . For large ,

approximately has distribution.

To combine the entries of the vector in one overall test statistic for symmetry, we also need the covariance matrix of , denoted . The diagonal entries of are in the order of entries of . For the off-diagonal entries, we need the covariance terms . By construction, we have and and there are six cases regarding these covariance terms.

Case  1 ( and ). In this case, the covariance term is just the variance term, .

Case  2 ( and ). − .

Case  3 ( and ). − .

Case  4 ( and ). − .

Case  5 ( and ). − .

Case  6 (, and , ). − .

The covariance term in Case 6 above is zero, since

Notice that is a matrix with and . Then

asymptotically has distribution.

2.4. Pielou’s Second Type of Symmetry Test

In the two-class case, a more elaborate test of symmetry due to Pielou [2] is based on a contingency table, called the -symmetry contingency table, where the class of each observation and the number of times it serves as a NN are recorded. A point can only serve as a NN to , or other observations due to geometric constraints in provided that the points are from a continuous distribution (as in CSR independence). For a two-class population, the observations are sorted into two sets of frequencies, namely, , for , where is the frequency of class observations serving as a NN to other points for . So Pielou’s second type of symmetry test uses more spatial information than just the categorization of base-NN relations. Notice that is also the number of class points shared as a NN by other points.

The corresponding contingency table for the two-class case is given in Table 2(a), where is the column sum, that is, the total number of points serving as a NN times or the number of points shared as a NN by other points for . Only if the allocation of the points from both populations is symmetric in terms of frequency of “serving as a NN” property, the expected proportions of classes 1 and 2 points serving as NNs times will be the same for each value. Hence, this type of symmetry refers to “symmetry in shared NN structure.” Let be the vector of probabilities (or proportions) associated with row for in the -symmetry contingency table under the row-wise multinomial framework. In a -symmetry contingency table, sum of row equals (i.e., size of class ). Hence, -symmetry contingency table may not result from the overall multinomial framework, since row sums in a -symmetry contingency table are fixed for completely mapped data. Furthermore, under RL, column sums are fixed and hence can be denoted as , but, under CSR independence, are random quantities.

Table 2: The -symmetry contingency table for with (a) and (b).

(a)

The number of times a point serving as a NN
Total

0
1
2
3
4
5

Classes

    Class 1

    Class 2

Total

(b)

The number of times a point serving as a NN
Total

0
1
2
3
4
5

Classes

    Class 1

    Class

Total

Thus, the null hypothesis of symmetry in the shared NN structure is given by

In general, if the independence assumptions in the row-wise multinomial framework hold, we would have . Then we may test the equality of proportions by using the usual Pearson’s test

which has approximately a distribution for large . Under RL, although it would be possible for a point to serve as NN to 6 other points with a positive probability (depending on the fixed allocation of the points), we will only consider up to 5 (and combine 5 and 6 categories and treat them as one category). If these categories have nonnegligible counts, then the above discussion can easily be extended to the case that shared NN frequencies have 7 levels, and the corresponding test has distribution for large .

A conservative requirement for the cell frequencies in the contingency table is that no expected cell count is less than 1 and no more than 20% of the cell counts are less than 5 [16]. Otherwise, it is recommended to merge some of the categories. For the -symmetry contingency table, in practice, such a merging would usually be necessary for , whence the dimension of the contingency table becomes and df becomes 2. Large values of indicate deviations from the null case. Hence, if the value is significant, then the population can be assumed to be asymmetric in the shared NN structure in the sense that the distribution of the rows in the -symmetry contingency table would be different for the two classes; that is, there is significant asymmetry in the shared NN structure.

Pielou’s second type of symmetry test can immediately be extended to the multiclass case. With , we record the frequency of class members serving as NN times in a contingency table (merging cells when necessary which might be needed for ). Then we obtain the contingency table given in Table 2(b). In the -class case, the null hypothesis is

The corresponding test statistic would be approximately distributed as (and when columns are merged for , we obtain a -symmetry contingency table and the asymptotic distribution is ) for large and provided that the independence assumptions in the row-wise multinomial framework hold.

This test seems to arise from the row-wise multinomial framework by construction, with the test statistic, , given in (20). Furthermore, the trials here are “base point-” “number of times the point serving as a NN” or “base point-” “number of times the point is shared as a NN.” Under RL or CSR independence, between row or column independence is violated for the -symmetry contingency table. For example, under RL with two classes, and are highly correlated; in fact, correlation between them is −1 when , since . Furthermore, and are also highly dependent and so are and . Hence, the suggested asymptotic distribution for should be appropriate under sparse sampling only. However, our extensive Monte Carlo simulations suggest that the asymptotic approximation with the reduced contingency table using distribution seems to hold for completely mapped data as well. Therefore, the test seems to be appropriate for both sparsely sampled or completely mapped data. Yet, finding the exact and asymptotic distribution of is still open problems.

3. Fisher’s Exact Test for the -Symmetry Contingency Table

Fisher’s exact test is widely used for contingency tables for small sample sizes (see, e.g., [17]). However, it can neither be used to test Pielou’s first type of symmetry nor Dixon’s symmetry test for two classes nor for their extensions to case, since we only consider the equality of off-diagonal entries in these tests, while Fisher’s exact test is used to detect any departure from independence for all cell count in the contingency table. An alternative exact test for small can be obtained by using the usual binomial test for Pielou’s first type of symmetry test under the appropriate sampling framework. The use of exact tests on NNCTs for testing segregation/association is discussed in Ceyhan [18]. We can apply Fisher’s exact test for the   -symmetry contingency table given in Table 2 (or the reduced contingency table) for Pielou’s second type of symmetry test.

If calculated manually, Fisher’s exact test is feasible only for small size contingency tables. Furthermore, the underlying assumption of the Fisher’s exact test is that the total number of observations, row and column sums are fixed, so Fisher’s exact test is a test conditional on the marginals. For contingency tables, when , then Fisher’s exact test can be one-sided or two-sided, whereas, when (hence for the -symmetry contingency table), it is two-sided only [17].

There are numerous ways to obtain values for the two-sided alternatives for exact inference on contingency tables [17]. These variants of Fisher’s exact test are described below. The values based on Fisher’s exact tests tend to be more conservative than most approximate (asymptotic) ones [17].

3.1. Variants of Fisher’s Exact Test for Two-Sided Alternatives

To find the values for Fisher’s exact test, we find the probabilities of the contingency tables obtained from the distribution with the same row and column marginal sums. For the two-sided alternatives, a recommended method is adding up probabilities of contingency tables of the same size and smaller than the probability associated with the current table. Alternatively, twice the one-sided value can also be used for a contingency table [17]. Let the probability of the contingency table, , be denoted as , where , and let sum of row be , let sum of column be , and let entry be . Then the probability of the contingency table, , is [13]

In particular, for the reduced -symmetry contingency table, we get

Let the probability of the current contingency table be denoted as .

For summing the values of more extreme tables than the current table in both directions, the following variants of the exact test are obtained. The value is calculated as for the appropriate choice of the set of contingency tables, , as follows:

(i)table-inclusive version, denoted as : take ;(ii)twice-table-inclusive version, : the probability of the observed table is included twice, once for each side;(iii)table-exclusive version, : table-inclusive minus ;(iv)mid- version, : table-exclusive plus one-half the ;(v)Tocher corrected version, , is obtained as follows.

Tocher’s correction makes Fisher’s exact test less conservative, by including the probability for the current table based on a randomized test [19]. When table-inclusive version of the value, , is larger than the level of the test , but table-exclusive version, , is less than , a random number, , is generated from uniform distribution in , and if , then is used as the value, otherwise is used as the value. That is,

Observe that and . Additionally, and .

4. Asymptotic Power Analysis

The null hypotheses are different for the symmetry tests and so are the alternative hypotheses. This makes the comparison of the tests inappropriate even for large samples; however, under specific alternatives and assumptions, we can estimate asymptotic efficiency scores, such as those of Pitman asymptotic efficiency. A reasonable test should have more power as the sample size increases. So, we first prove the consistency of the tests in question under appropriate hypotheses.

4.1. Consistency of Tests

The consistency of Pielou’s second and first types of symmetry tests is shown as below.

Theorem 2. For properly sparsely sampled data under the row-wise multinomial framework, Pielou’s second type of symmetry test for the multiclass case with the contingency table; that is, the test rejecting for all for with is consistent.

Proof. In the multiclass case with , deviations from may have many possible forms. In any deviation from , that is, under , for large , is approximately distributed as a distribution with noncentrality parameter and  df, which is denoted as . The noncentrality parameter is a quadratic form which can be written as for some positive definite matrix of rank (see, e.g., [20]); hence, under . Then, for large , the null and alternative hypotheses are equivalent to versus . Then, by standard arguments for the consistency of -tests, the result follows.

The consistency of Pielou’s second type of symmetry test for the (reduced) contingency table can be shown similarly.

Theorem 3. Let the NNCT be constructed by a random sample of base-NN pairs (i.e., data is obtained by an appropriate sparse sampling) under an overall multinomial framework. Then, Pielou’s first type of symmetry test, that is, the test rejecting for all with against for some with for with as in (4) is consistent. The corresponding one-sided tests using given in (3) are also consistent.

Proof. In the two-class case, recall that this test is the same as McNemar’s test with a continuity correction. Given that , the correction is used for small and its impact vanishes as . So we prove the consistency for the uncorrected version (i.e., for the test without continuity correction), . Let . Then, under , we have . So . Hence, is approximately distributed as for large under the null hypothesis and a normal distribution under alternative hypothesis. Notice that in the uncorrected version. Under , and, under , or . Then, by the standard arguments for the consistency of -tests, the test using is consistent. The -level test based on is equivalent to -level two-sided test based on . Hence, the consistency of follows as well. For , consistency of is similar to with and consistency of follows as in the proof of Theorem 2.

Theorem 4. Let the NNCT be constructed from a completely mapped data under RL. Then Dixon’s symmetry test, that is, the test rejecting for all with against for some with for with as in (18) is consistent. The corresponding one-sided tests using given in (10) are also consistent.

Proof. In the two-class case, let ; then . Under RL, since and is approximately distributed as for large under the null hypotheses. Under , or and and − . So, under , and as . Hence, the test using is consistent. The -level test based on is consistent as in the proof of Theorem 2, since is a quadratic based on values; that is, for some .

Remark 5. The consistency result for Pielou’s first type of symmetry test is only for sparsely sampled data with contingency table from the overall multinomial framework. Pielou’s second type of symmetry test is consistent only for sparsely sampled data with the row-wise multinomial framework. For completely mapped data, these tests do not have the appropriate size. In particular, Monte Carlo simulations suggest that Pielou’s first type of symmetry test (with approximation or exact binomial version) is extremely conservative. See also Section 5.

4.2. Asymptotic Power Comparison of the Tests

The power of a test in hypothesis testing depends on the statistic being employed, sample size, the level of the test , and the parameter(s) under . To be able to compare the tests, we should consider the asymptotics with only , where the asymptotic power tends to 1 for consistent tests. Since the power depends on multiple parameters, many asymptotic efficiency methods are introduced to compare asymptotic power performance. See [21] for a brief survey of asymptotic efficiency measures.

The tests with small level and high power under alternatives close to null hypothesis have practical importance. Hence, Pitman asymptotic efficiency (PAE) is widely used in practice. PAE analysis provides for an investigation of local power around , which involves the limit as together with the limit of alternative parameter converging to the null parameter. See, for example [22, 23] for more details.

Remark 6. Suppose that the distribution under consideration can be indexed by and consider versus . If the test statistic satisfies central limit theorem together with the Pitman’s conditions [23] with and , then PAE of is given by

If a test statistic, , converges in law to distribution as , then the local power approximation using asymptotic normality of is not appropriate [24]. By suitable transformations, the corresponding test asymptotically boils down to versus , where is the noncentrality parameter for the distribution. Therefore, we investigate the local power around . Let and be the pdf and cdf of distribution, respectively.

Theorem 7. Suppose that is a test statistic which converges in law to with under and to with under . Then the local power for small ( around 0) is given by

The proof is provided in the Appendix.

4.2.1. Asymptotic Local Power Analysis of the Tests

Pielou’s first type of symmetry test is used for testing versus . Under , given that , , since . Under , for . Let . Then which is equal to (without Yates’ correction) in (2). Under , and and under , let . Next, let and . Then and satisfy the Pitman conditions and (see [23]). Then by Remark 6, the PAE of (for the parameterization ) is

The asymptotic local power for Dixon’s symmetry test for the two-class case can also be investigated with PAE analysis. For Dixon’s symmetry test for the two-class case, consider . Then

Let , , , and . That is, is the probability of a point being a shared NN and is the probability of a pair being reflexive. Then, under , and

where for large

for and

and, under , let . Then, by Remark 6, PAE of (for the parameterization ) is given by

For the asymptotic relative efficiency between Pielou’s first type of symmetry test and Dixon’s symmetry test to make sense, the null assumptions for these tests should match and so should the alternatives and the parameterizations of the alternatives (under which PAE scores are computed). Otherwise, and would not be comparable. In particular, since the (appropriate) null and alternatives are different for these tests, we refrain from computing asymptotic relative efficiency for these tests. On the other hand, for Dixon’s symmetry test with varying and , notice that increases as gets closer to 0 or 1 or gets smaller. For example, for fixed , PAE of gets larger as the relative abundances of the classes get more and more different (which implies that gets closer to 0 or 1). The smallest values are obtained when for any . That is, the power of Dixon’s test for spatial symmetry (in mixed structure) highly depends on the relative abundances of the classes. The PAE of in the multiclass case is similar.

5. Empirical Performance of the Tests

In this section we investigate the finite sample behavior of the tests under various patterns via Monte Carlo simulations.

5.1. Empirical Performance Analysis under RL and CSR Independence

Both CSR independence and RL patterns imply symmetry in the mixed or shared NN structure. That is, under these cases, the asymmetry would occur at expected levels. More specifically, we expect that would hold for symmetry in mixed NN structure, and in (19) would hold for symmetry in shared NN structure. Hence, these patterns imply our null hypotheses and hence can be used to assess the empirical size performance of the tests.

In what follows empirical size estimates are based on the asymptotic critical values (except for the exact tests). In particular, for a test, , with a distribution asymptotically, empirical sizes are estimated as follows. Let be the value of test statistic for the sample generated at th Monte Carlo replication for . Then the empirical size of at level , denoted , is computed as   , where is the th percentile of distribution. For an exact test, let be the value for th sample generated. Then the empirical size of this test, denoted , is computed as   . With , an empirical size estimate larger than 0.0536 is deemed liberal, while an estimate smaller than 0.0464 is deemed conservative at .05 level (based on binomial critical values with trials and probability of success 0.05).

5.1.1. Empirical Size Analysis under CSR Independence

We consider the two-class case, with classes 1 and 2 (also referred to as the classes and , resp.) of sizes and , respectively. Let be the set of class 1 points and let be the set of class 2 points. Under , at each of replicates, we generate and points independently of each other and iid from , the uniform distribution on the unit square. We consider two cases for CSR independence.

Case  1. We generate points iid from . In this case, the sample sizes are equal and increasing.

Case  2. To determine the influence of differences in the sample sizes (i.e., differences in relative abundances) on the empirical levels of the tests, we generate the samples from the CSR independence pattern with and .

The empirical significance levels (under CSR independence Cases 1 and 2) for the symmetry tests are presented in Table 3, where and are the (estimated) empirical significance levels for Pielou’s first type of symmetry test using approximation with and without Yates’ continuity correction, respectively; is for the exact binomial version of Pielou’s first type of symmetry test conditional on ; is the empirical significance level for Pielou’s second type of symmetry test; is for Dixon’s symmetry test. Notice that Pielou’s first type of symmetry tests and the exact binomial test are extremely conservative. Furthermore, we recommend the use of the Monte Carlo randomized versions of these tests or with Monte Carlo critical values rather than the approximate asymptotic critical values. A Monte critical value is determined as the appropriately ranked value of the test statistic in a certain number of generated data sets under the null hypothesis. The other tests seem to be of the desired level for each sample size considered.

Table 3: The empirical significance levels of the symmetry tests under CSR independence Case  1: and Case  2: with at . and stand for the empirical significance levels for Pielou's first type of symmetry test using approximation with and without Yates' continuity correction, respectively; stands for the exact binomial version of Pielou's first type of symmetry test conditional on ; stands for the empirical significance level for Pielou's second type of symmetry test; stands for Dixon's symmetry test.

CSR independence Case  1

10
.0002
.0011
.0111
.0483
.0466

20
.0001
.0006
.0080
.0533
.0480

30
.0000
.0008
.0073
.0487
.0492

40
.0001
.0006
.0061
.0501
.0514

50
.0000
.0007
.0044
.0522
.0484

CSR independence Case  2

20
.0001
.0006
.0093
.0533
.0473

30
.0002
.0001
.0088
.0527
.0500

40
.0001
.0008
.0089
.0536
.0539

50
.0002
.0008
.0092
.0491
.0483

60
.0002
.0010
.0080
.0508
.0483

The empirical significance levels for the exact tests on the -symmetry contingency table under CSR independence Cases 1 and 2 are presented in Table 4, where is the empirical significance level for the two-sided test with the table-inclusive version, is for table-exclusive version, is for mid- value version, and is for Tocher corrected version. Notice that only the table exclusive version is about the desired level, while the others are more conservative. Hence, in what follows, only the table exclusive version will be employed for exact inference on -symmetry contingency table.

Table 4: The empirical significance levels for Fisher's two-sided exact tests for the -symmetry contingency tables under CSR independence Cases 1 and 2 with , for some combinations of at . is for the empirical significance level for the table-inclusive version of the two-sided test, is for table-exclusive version, is for mid- value version, and is for Tocher corrected version.

CSR independence Case 1

10
.0392
.0424
.0413
.0410
.0319

20
.0466
.0505
.0480
.0487
.0451

30
.0459
.0484
.0465
.0466
.0430

40
.0457
.0481
.0475
.0472
.0434

50
.0475
.0490
.0478
.0479
.0462

CSR independence Case 2

20
.0454
.0497
.0462
.0469
.0444

30
.0484
.0533
.0504
.0512
.0435

40
.0479
.0505
.0489
.0490
.0460

50
.0485
.0524
.0504
.0509
.0460

60
.0474
.0500
.0489
.0487
.0445

5.1.2. Empirical Size Analysis under RL

For the RL pattern, the locations of the points are given and the marks or class labels are assigned randomly to these points. The pattern generating these locations is referred to as the background pattern henceforth. Let be the given set of locations for points from the background pattern. We consider RL of class labels of 1 and 2 (or and ) to these points which are generated from homogeneous or clustered patterns. We generate 100 different realizations of the background pattern, , to mitigate the influence of a particular background realization on the size performance of the tests. At each background realization, of the points are labeled as class 1 and the remaining points are labeled as class 2.

Types of the Background Patterns

Case  1. The background points, , are generated iid in the unit square . That is, for . To determine the effect of increasing equal sample sizes, we consider . The above RL scheme is repeated times for each combination of background realization.

Case  2. The background points, , are generated as in Case 1 above with and to determine the differences in the sample sizes with number of class 1 points fixed and number of class 2 points increasing. The above RL scheme is repeated times for each combination of background realization.

Case  3. We generate the background points from a Matérn cluster process. More specifically, points are generated from process, which is the Matérn cluster process in the unit square [25]. In this process, first “parent” points are generated from a Poisson process with intensity and then one replaces each parent point by new points which are generated iid inside the circle centered at the parent point with radius . Here is also random; . At each background realization, one realization of is generated from . Let be the number of points in a particular realization. Then of these points are labeled as class 1, where stands for the floor of and as class 2. In our simulations, we use , , and . That is, we take , in order to have about 100 points, where about half of them are class 1 and the other half are class 2 points on the average.

In RL Cases 1 and 2, the points are from HPP in the unit square (with fixed and ), where Case 1 is for assessing the effect of increasing but equal sample sizes on the tests, while Case 2 is for assessing the effect of increasing differences in relative abundances of the classes (with one class size being fixed, while the other is increasing). On the other hand, in Case 3, we have the background realizations with cluster centers and cluster numbers being random. On the average, with increasing , the number of clusters tend to increase, and cluster sizes tend to decrease (so as to have fixed class sizes on the average). Hence, in Case 3, we investigate the influence of increasing number of clusters with randomly determined centers on the size performance of the tests.

The empirical size estimates of the tests under RL Cases 1–3 are presented in Table 5. The empirical size performance of the tests under Cases 1 and 2 is similar to that under CSR independence Cases 1 and 2, respectively. Tests of Pielou’s first type of symmetry are extremely conservative, while the other tests are about the desired level. The empirical size estimates of the exact test for Pielou’s second type of symmetry (the table exclusive version) are denoted as for notational convenience. Furthermore, is close to the nominal level for all sample sizes or values. Notice also that the size estimates of the tests are not influenced by the number of clusters, , when the class sizes are fixed.

Table 5: The empirical significance levels of the tests under RL Cases  1–3 with for each of 100 background realization at . The empirical size labeling is as in Table 3. stands for the empirical size estimates of the exact tests for Pielou's second type of symmetry (the table exclusive version).

RL Case  1

10
.00011
.00089
.00092
.04368
.04989
.04205

20
.00018
.00096
.00106
.04797
.05283
.04831

30
.00017
.00095
.00110
.05037
.05147
.04974

40
.00016
.00056
.00042
.05156
.05242
.04994

50
.00028
.00070
.00050
.04981
.05020
.04934

RL Case  2

20
.00016
.00089
.00109
.04907
.05298
.04987

30
.00016
.00090
.00063
.05087
.05143
.05258

40
.00015
.00069
.00048
.04880
.05087
.05222

50
.00026
.00099
.00079
.04700
.05010
.05271

60
.00027
.00097
.00084
.04991
.04985
.05104

RL Case  3

2
.00018
.00063
.00065
.05158
.05241
.05006

4
.00023
.08451
.00083
.04848
.05024
.04988

6
.00012
.00051
.00048
.04953
.05061
.05057

8
.00024
.00076
.00074
.05075
.05007
.04963

10
.00024
.00070
.00083
.04939
.05087
.05063

Based on the empirical size performance of the tests, we observe that variants of Pielou’s first type of symmetry test are extremely conservative and hence are not reliable in practice. On the other hand, Pielou’s second type of symmetry test and Dixon’s symmetry test are appropriate for balanced or unbalanced sample sizes. When the relative abundances of the classes are close to one (i.e., for ), we call the class sizes to be balanced, but when the relative abundances deviate substantially from one we call the class sizes to be unbalanced. For the exact tests on -symmetry contingency table, we recommend the table-exclusive version.

5.2. Empirical Performance of the Tests under Various Other Patterns

To assess the empirical performance of the tests, we consider six pattern cases for the NN structure. Empirical rejection rate estimates are computed as the size estimates in Section 5.1.

Case I. For the first class of patterns, we generate for and for , where is the bivariate normal distribution with mean and covariance . In our simulations, we set and . We consider three patterns in which

The classes 1 and 2 (i.e., and ) have different distributions with different local intensities. In particular, points constitute a realization of HPP process in the unit square, while points are clustered around the center of the unit square, namely . In fact, the level of clustering of points increases as decreases.

The means (SD (standard deviations)) of the off-diagonal entries, , , and their difference and empirical rejection rate estimates under the patterns, , , and , with are presented in Table 6(a), where and stand for the empirical rejection rates for Pielou’s first type of symmetry test using approximation with and without Yates’ continuity correction, respectively; is for the exact binomial version of Pielou’s first type of symmetry test conditional on ; is for Dixon’s symmetry test; is for Pielou’s second type of symmetry test; is for the exact test on the -symmetry contingency table. Notice that, under Case I patterns, the off-diagonal entries, , , in the NNCTs tend to be much smaller than expected under and values tend to be larger than values which suggests asymmetry in the mixed NN structure. Furthermore, , tend to decrease with decreasing . That is, when the level of clustering of points in the center of the unit square increases (i.e., level of segregation of points from points increases), the off-diagonal entries tend to decrease (in a similar fashion). The exact binomial version of Pielou’s first type of symmetry test has the highest rejection rates which are increasing as is decreasing. The rejection rate estimates for all other symmetry tests are significantly smaller than the nominal level of .05, indicating lack of asymmetry in the mixed and shared NN structure. However, the fact that off-diagonal entries are small seems to render the asymptotic approximations inappropriate. Although the difference of the off-diagonal entries is larger than zero, the standard deviations of the differences are much smaller compared to those under CSR independence or RL (see also Table 7). Moreover, the exact binomial test is not appropriate either due to the dependence between trials (hence dependence between rows of the NNCT) for spatial data. Thus, in this situation, we recommend performing Monte Carlo randomization to determine more reliable rejection rate estimates. To that end, for each of the 100 generated samples under each of Case I patterns, 1000 Monte Carlo resampling is performed, and rejection rate for a test is estimated based on how many of the test statistics on resamplings are at and above the original test statistic. The corresponding Monte Carlo randomization rejection rate estimates are presented in Table 6(b), where the binomial version of Pielou’s first type of symmetry test is omitted since it is conditional on which is not fixed under Monte Carlo randomization steps. The rejection rate estimates are high for all tests and much higher than the nominal rate of 0.05. Hence, Case I patterns are actually providing significant asymmetry in mixed and shared NN structure, which was not revealed by the asymptotic approximation of the tests. Hence, this pattern is actually an alternative pattern for both symmetry structures, and the rejection rates are in fact power estimates under this alternative pattern. The highest power estimates are observed for Monte Carlo randomized version of Pielou’s first type of test (and lowest estimates are for Dixon’s symmetry test). Furthermore, the power estimates for Pielou’s second type of symmetry tests are very similar. The power estimates for Monte Carlo randomized version of Pielou’s first type of symmetry test and the two versions of Pielou’s second type of symmetry test increase and those for other tests decrease as decreases.

Table 6: Presented are the means (±SD (standard deviations)) of the off-diagonal entries, , , and their difference and the rejection rate estimates under Case I patterns in (33) with , at (a) and rejection rate estimates based on Monte Carlo randomization with and 1000 Monte Carlo randomization steps are performed for each of generated samples under Case I patterns (b). and stand for the empirical rejection rate estimates for Pielou's first type of symmetry test using approximation with and without Yates' continuity correction, respectively; stands for the exact binomial version of Pielou's first type of symmetry test conditional on ; stands for Dixon's symmetry test; is for Pielou's second type of symmetry test; stands for the exact test on the -symmetry contingency table.

(a)

Mean ± SD
Rejection rate estimates for Case I patterns

I-(i)

.0018
.0060
.0721
.0092
.0379
.0359

I-(ii)

.0118
.0511
.3109
.0017
.0345
.0324

I-(iii)

.0338
.0919
.5345
.0002
.0324
.0296

(b)

Rejection rate estimates for Case I patterns based on Monte Carlo randomization

I-(i)
.641219
.480581
.409682
.546873
.546491

I-(ii)
.670268
.402391
.271784
.569909
.569605

I-(iii)
.696817
.397304
.196840
.577398
.576899

Table 7: The means (±SD) of the off-diagonal entries, , , and their difference under CSR independence Case  1 and RL Case  1 with at .

Mean ± SD

CSR-ind Case  1

RL Case  1

Case II. For Case II, we consider the following three patterns. First, we generate for and, for each , we generate around a randomly picked with probability in such a way that , where represents transpose of the vector , and , or generate uniformly in the unit square with probability . In the pattern generated, are more associated with . The three values of constitute the following patterns:

In this case, points constitute a realization of a HPP process in the unit square, while points are clustered around the points and the level of clustering increases as the parameter increases. The means (SD) of the off-diagonal entries, , , and their difference and the empirical rejection rate estimates for Case II patterns with are presented in Table 8. Notice that and in the NNCTs tend to be similar and larger than expected and values tend to be slightly larger than values. Furthermore, , tend to increase with increasing . That is, when the level of clustering of points around points increases (i.e., level of association of points with points increases), the off-diagonal entries tend to increase (in a similar fashion), indicating symmetry in the NN structure (but the difference between and values tends to increase with increasing ). Variants of Pielou’s first type of symmetry test have virtually zero rejection rates, and, although Dixon’s symmetry test has higher rejection rates than Pielou’s first type, it has rates smaller than 0.05; hence there is symmetry in the mixed NN structure. In fact, under this pattern, expected value of the difference, , is mostly positive and with a larger variance compared to those under CSR independence and RL. However, there is severe asymmetry in shared NN structure, since Pielou’s second type of symmetry test and its exact version have rejection rate estimates much larger than 0.05, and these estimates increase as increases. Hence, this pattern type can serve as an alternative to symmetry in the shared NN structure and perhaps a null pattern for the tests of symmetry in the mixed NN structure for the range of considered. However, using the asymptotic critical values based on the distribution under RL, the tests of symmetry in mixed NN structure would be extremely conservative for this null case. If the correct form of the variance and covariance terms can be determined as a function of , then the tests for symmetry in mixed NN structure would have the desired level. Otherwise, Dixon’s symmetry test and Pielou’s first type of symmetry test can be used with Monte Carlo randomization.

Table 8: The means (±SD) of the off-diagonal entries, , , and their difference and the rejection rate estimates for Case II patterns in (34) with , at . Column labeling is as in Table 6.

Mean ± SD
Rejection rate estimates for Case II patterns

II-(i)

.0002
.0002
.0030
.0198
.3313
.3225

II-(ii)

.0001
.0009
.0084
.0124
.8395
.8326

II-(iii)

.0049
.0079
.0524
.0434
.9923
.9913

Case III. For the third class of patterns, we consider for and for . The three values of constitute the following patterns:

Notice that these are the segregation patterns considered for Monte Carlo analysis in Ceyhan [12]. The means (SD)) of the off-diagonal entries, , , and their difference and the empirical rejection rate estimates for the segregation patterns are presented in Table 9. The off-diagonal entries, , , are very similar under these segregation patterns and are much smaller than expected under RL and tend to decrease as (i.e., level of segregation) increases. Hence, mixed structure seems to be symmetric under these segregation patterns. The symmetry tests and the exact tests have very small rejection rates, with Pielou’s first type and Dixon’s symmetry tests having virtually zero rates and the others having rates lower than .05. There seems to be symmetry in both mixed and shared structure, since the null hypotheses seem to be satisfied. That is, the expected difference is zero, and the cell counts in the -symmetry table are as expected under RL. However, the variances seem to be much smaller compared to the ones under RL or CSR independence (see Table 7). Thus, these segregation patterns can form null patterns for both types of symmetry tests; however, the correct variance and covariance terms should be computed; otherwise, the symmetry tests would be extremely conservative when the critical values are based on the distribution under RL or CSR independence.

Table 9: The means (±SD) of the off-diagonal entries, , , and their difference and the rejection rate estimates for Case III patterns with , at . Column labeling is as in Table 6.

Mean ± SD
Rejection rate estimates for Case III patterns

III-(i)

.0004
.0009
.0086
.0225
.0385
.0368

III-(ii)

.0000
.0011
.0096
.0073
.0341
.0321

III-(iii)

.0002
.0013
.0128
.0005
.0336
.0308

Case IV. We also consider patterns in which self-reflexive pairs are more frequent than expected by construction. We generate for and for . Then, for , we generate and, for , we generate , where and . Appropriate small choices of will yield an abundance of self-reflexive pairs. The three values of we consider constitute the below self-reflexivity patterns at each support pair . Then the nine pattern combinations we consider are given by the following:

(i), (a) , (b) , and (c) ;(ii) and , (a) , (b) , and (c) ;(iii) and (a) , (b) , and (c) .

The means (SD) of the off-diagonal entries, , , and their difference and the empirical rejection rate estimates for Case IV patterns with are presented in Table 10. In this case, the off-diagonal entries, , , tend to be very similar but smaller than expected under RL, indicating symmetry in mixed NN structure. Furthermore, as pattern changes from (i) to (iii) , values tend to decrease, and, at each case IV pattern, , values tend to decrease, as (i.e., the level of self-reflexivity) decreases. Variants of Pielou’s first type of symmetry test have small rejection rates (with the asymptotic versions having virtually zero rates and the exact version slightly higher rates); Dixon’s symmetry test has rejection rates smaller than 0.05. Hence, we conclude that, under these self-reflexivity patterns, there is in fact symmetry in mixed NN structure, as the expected difference is zero, but the variance of this difference is much smaller than that under RL. Hence, using the asymptotic distribution under RL, these tests would be extremely conservative. To get the desired level, one needs the correct form of the variances and covariances for Dixon’s symmetry test under these patterns. On the other hand, Pielou’s second type of symmetry tests has rejection rates about the nominal level of .05, indicating that these self-reflexivity patterns can also be viewed as the null pattern for symmetry in the shared NN structure.

Table 10: The means (±SD) of the off-diagonal entries, , , and their difference and the rejection rate estimates for Case IV patterns with , at . The rejection rate labeling and superscripting for “<” and “>” are as in Table 6.

Mean ± SD
Rejection rate estimates for Case IV patterns

IV-(i)

1/7

.0012
.0055
.0256
.0361
.0565
.0525

1/8

.0021
.0052
.0307
.0318
.0572
.0552

1/9

.0023
.0071
.0351
.0295
.0579
.0562

IV-(ii)

1/7

.0014
.0039
.0235
.0176
.0526
.0509

1/8

.0015
.0064
.0312
.0192
.0609
.0583

1/9

.0028
.0075
.0395
.0172
.0616
.0601

IV-(iii)

1/7

.0014
.0039
.0286
.0070
.0496
.0470

1/8

.0020
.0061
.0345
.0094
.0539
.0518

1/9

.0027
.0074
.0392
.0070
.0590
.0565

Case V. In this case, first, we generate and then generate as , where and . In the pattern generated, appropriate choices of will cause and more associated. That is, a point is more likely to be the NN of an point and vice versa. The four values of we consider constitute the four association patterns:

The patterns are also the association patterns considered for Monte Carlo analysis in Ceyhan [12].

The means (SD) of the off-diagonal entries, , , and their difference and the empirical rejection rate estimates for Case V patterns with are presented in Table 11. Notice that the off-diagonal entries, , , tend to be at or above the expected value under RL and tend to increase as (i.e., level of association) increases. Furthermore, values tend to be slightly smaller than values and the differences between and tend to decrease as decreases. Variants of Pielou’s first type of symmetry test have virtually zero rejection rates, and, under stronger association with , Dixon’s symmetry test and exact and asymptotic versions of Pielou’s second type of symmetry test have rates around .05, and, under moderate association with , these tests have rates mildly above .05. Hence, stronger association with could serve as the null pattern for both types of symmetry tests, while, under moderate association with , the expected values are smaller in the negative direction compared to those under RL, with the variances about those under RL.

Table 11: The means (±SD) of the off-diagonal entries, , , and their difference and the rejection rate estimates for Case V patterns with , at . Column labeling is as in Table 6.

Mean ± SD
Rejection rate estimates for Case V patterns

V-(i)

.0004
.0019
.0076
.0982
.0805
.0982

V-(ii)

.0002
.0007
.0033
.0752
.0699
.0676

V-(iii)

.0001
.0003
.0021
.0565
.0503
.0490

V-(iv)

.0001
.0002
.0012
.0513
.0485
.0454

Case VI. In this case, first, we generate for and, for each generated, we find the distance of NN point from , denoted (i.e., ). Then we generate points as follows. First generate from and from . Then set for . For , we first generate from and from . Then set for and . Then we merge the ’s and ’s to form the points (which would have many points). Moreover, we generate for . Let be the distance of NN point to among the above generated points. For , we first generate from and from . Then set for . Then we merge the ’s, ’s, and ’s to form the points (which would also have many points). In the pattern generated, appropriate choices of will cause of the points to have NNs more from points and of the points to have NNs more from points; additionally, of points would have NNs more from points. Hence, in this way, the off-diagonal entries (i.e., and ) would tend to be different, indicating asymmetry in mixed NN structure. The three values of we consider constitute the following patterns:

The means (SD) of the off-diagonal entries, , , and their difference and the empirical rejection rate estimates for these patterns are presented in Table 12. The off-diagonal entries, , , tend to be different at or above the expected value under RL and they tend to increase as increases. However, values tend to be much smaller than values, and their difference tends to decrease as increases. The asymptotic versions of Pielou’s first type of symmetry tests virtually have zero rejection rate, and the exact version has small rates which are slightly larger than .05 for . On the other hand, Dixon’s test and versions of Pielou’s second type of symmetry test have high rejection rates (much higher than 0.05), which decrease as increases. Hence, there is strong asymmetry in mixed and shared NN structure, and the level of asymmetry is increasing with decreasing . Thus, these patterns can serve as alternative patterns for both types of symmetry tests and the rejection rates are power estimates. Notice also that the asymmetry in the shared NN structure is stronger than the asymmetry in the mixed NN structure.

Table 12: The means (±SD) of the off-diagonal entries, , , and their difference and the rejection rate estimates for Case VI patterns with , , (hence ) at . Column labeling is as in Table 6.

Mean ± SD
Rejection rate estimates for Case VI patterns

VI-(i)

.0019
.0091
.0629
.8883
.9911
.9907

VI-(ii)

.0003
.0012
.0073
.5460
.7782
.7730

VI-(iii)

.0000
.0000
.0009
.1860
.3029
.2980

6. Pairwise versus One-versus-Rest Tests

In the multiclass case with , we first perform an overall omnibus test (as in ANOVA -test for multigroup comparisons) and then, if the omnibus test is significant, then we perform post hoc tests to determine the specifics of the differences. These post hoc tests could be pairwise tests (as in pairwise -tests) or one-versus-rest tests, where one class is compared with respect to all other classes combined. More specifically, with classes, in the pairwise comparison, we only consider classes . The pairwise tests for Dixon’s symmetry test and Pielou’s second type of symmetry test can be defined in two different ways: (i) unrestricted pairwise symmetry tests and (ii) restricted pairwise symmetry tests. In the unrestricted version, for the pairwise test for classes , , we keep all the points in consideration. That is, for Dixon’s symmetry test, we extract and from the overall NNCT and, in computing and values, we do not ignore but use all the other classes. In the restricted version, we restrict our attention to two classes, , with , only, and treat the classes as in the two-class case. That is, we only consider classes and and ignore the remaining classes and hence obtain a NNCT just for classes and extract and from this NNCT, and compute and for the data consisting of classes and only. The unrestricted version of Pielou’s second type symmetry is based on the contingency table extracting only row and in the -symmetry contingency table. On the other hand, in the restricted version, we compute a   -symmetry contingency table based on data consisting of classes and only.

In the one-versus-rest type of test for class , we pool the remaining classes and treat them as the other class in a two-class setting and hence the name one-versus-rest test. In a multiclass setting with classes, there are one-versus-rest type tests and pairwise tests. As increases, performing one-versus-rest analysis is computationally less intensive and easier to interpret.

Although Pielou’s first type of symmetry test and Dixon’s symmetry test were designed only for the two-class case, we have extended them to the multiclass case. Hence, if we have more than 2 classes; for Pielou’s first type of symmetry, we can perform Bowker’s test of symmetry in (4) (under the appropriate sampling distribution framework) as the overall test and use the test in (2) as the post hoc test. For Dixon’s symmetry test, the overall test is performed with in (18) and the post hoc tests are performed with in (10) for the restricted pairwise and one-versus-rest tests or for the restricted pairwise tests. For Pielou’s second type of symmetry test, the overall test can be performed with for the   -symmetry contingency table and post hoc tests with for the   -symmetry contingency table. In the mixed or shared structure, significant overall tests indicate some form of deviation from symmetry for all classes combined, while the post hoc tests suggest which classes deviate significantly from symmetry. In particular, pairwise tests indicate which pairs are asymmetric in the structure, while one-versus-rest tests indicate which class is asymmetric with respect to the remaining classes.

In all the above cases, the post hoc tests can give different and seemingly conflicting results (e.g., one class can be symmetric with respect to the rest and at the same time it can be asymmetric with respect to one of the other classes). Even if the pairwise symmetry tests are used, the restricted or unrestricted versions might yield different results. So extra care should be exercised for which post hoc test is used and how it should be interpreted.

7. Example Data: Lansing Woods Data

To illustrate the methodology, we use the Lansing Woods data, which contains locations of trees (in feet (ft)) and botanical classification of trees (according to their species) in a 924 ft × 924 ft (19.6 acre) plot in Lansing Woods, Clinton County, MI, USA [26]. The data set is available in the spatstat package in [25] and comprise of 2251 trees together with their species as hickories, maples, red oaks, white oaks, black oaks, and miscellaneous trees. In our analysis, we only consider the black oaks, maples, and white oaks which constitute a total of 1097 trees. The scatter plot of these tree locations are presented in Figure 1.

Figure 1: The scatter plot of the locations of black oaks (circles ), maples (triangles ), and white oaks (pluses +) in the Lansing Woods, Clinton County, MI, USA.

7.1. Overall Symmetry Analysis

The NNCT for this data set is presented in Table 13. Notice that the off-diagonal entries (i.e., and values with ) are very similar for , and , , indicating symmetry in the mixed NN structure for black oaks versus maples and black oaks versus white oaks. But and values seem to be very different suggesting strong asymmetry in mixed NN structure for maples versus white oaks. We will be formally testing symmetry and attaching significance to it later in this section.

Table 13: The NNCT for the Lansing Woods data set containing black oak, maple, and white oak trees.

NN species
Total

Black oak
Maple
White oak

Base species

    Black oak
53
35
47
135

    Maple
28
366
120
514

    White oak
50
161
237
448

Total
131
562
404
1097

The (reduced) -symmetry contingency table is presented in Table 14, where the relative frequencies with respect to row sums are provided in parentheses. Observe that the column relative frequencies (i.e., column sums divided by the grand sum or the overall ratios of shared NNs for 0, 1, and ≥2 shared NNs) are 0.27, 0.50, and 0.24. The ratios of shared NNs for black oaks (i.e., the row entries for black oaks divided by the row sum for black oaks) are 0.27, 0.50, and 0.23, the ratios for maple trees are 0.22, 0.50, and 0.28, and the ratios for white oaks are 0.32, 0.49, and 0.19. Hence, the relative frequencies for black oaks are very similar to the overall frequencies, but those for other species (especially for white oaks) are very different from the overall frequencies. This suggests that there are differences in the shared NN structure for the three species, suggesting asymmetry in the shared NN structure, especially for white oaks compared to the other species.

Table 14: The (reduced) -symmetry contingency table for the Lansing Woods data. The values in the parentheses are relative frequencies of the cells in each row with respect to the row sums.

Number of times a point serving as a NN
Total

0
1
≥2

Classes

    Black oak
37 (.27)
67 (.50)
31 (.23)
135

    Maple
113 (.22)
259 (.50)
142 (.28)
514

    White oak
143 (.32)
220 (.49)
85 (.19)
448

Total
293 (.27)
546 (.50)
258 (.24)
1097

We present the test statistics and the associated values for the overall symmetry analysis in Table 15, where , , and are as defined in the text, and the superscript stands for “uncorrected for continuity” or “no Yates correction.” Furthermore, stands for the table exclusive version of two-sided Fisher’s exact test on the -symmetry contingency table (which by definition only yields a value but not a test statistic). Furthermore, in this table stands for the value based on the asymptotic approximation (i.e., asymptotic critical value) except for the exact test; is based on Monte Carlo randomization of the labels on the given locations of the trees 1000 times. For the exact tests, the value written for the row is computed as in Section 3. Notice that and are very different for Pielou’s first type of symmetry test with and without Yates correction. This is in agreement with the fact that Pielou’s first type of symmetry tests is not appropriate for NNCTs based on completely mapped spatial data (yielding very conservative tests under the null hypotheses). For the tests with the correct asymptotic sampling distributions, and are very similar.

Table 15: The test statistics and the p-values for the overall symmetry analysis for the Lansing Woods data. TS stands for the test statistic, for the p-values based on asymptotic critical values (except for the exact tests), and for the p-values based on Monte Carlo randomization. The p-values for the exact tests are not the asymptotic p-values but computed as described in Section 3.

Overall test statistics and p-values

TS
13.482
5.694
6.182
16.595
—

.004
.128
.103
.002
.002*

.006
.002
.002
.004
.004

Notice that the test statistics and the corresponding values imply that the allocations of the tree species are asymmetric in mixed and shared NN structure (as was suggested in the NNCT and -symmetry contingency table), since the corresponding values for Dixon’s symmetry test and Pielou’s second type of symmetry test and Fisher’s exact test are significant ( values based on Monte Carlo randomization are significant for all tests). Hence, we will perform post hoc symmetry tests to determine which pair(s) of species or which species when compared to the rest exhibit significant asymmetry in the NN structure.

7.2. Post Hoc Symmetry Analysis

7.2.1. Unrestricted Pairwise Symmetry Analysis

For the unrestricted pairwise analysis, we use (parts of) the contingency tables in the overall symmetry analysis. For example, for the unrestricted pairwise tests for Dixon’s symmetry test, we use the off-diagonal entries and in the NNCT in Table 13 and the test statistic in (16). For the unrestricted pairwise tests for Pielou’s second type of symmetry test for species and , we use the -symmetry contingency table which is obtained by using rows and in Table 14.

We present the test statistics and the associated values for the unrestricted pairwise symmetry tests in Table 16. Notice that and are very different for Pielou’s first type of symmetry test with and without Yates correction and very similar for other tests. The test statistics and the corresponding values imply that there is symmetry in NN structure for black oaks versus maples and for black oaks versus white oaks. However, maples versus white oaks exhibit significant asymmetry in NN structure.

Table 16: The test statistics and the p-values for the unrestricted pairwise symmetry analysis for the Lansing Woods data. Row labelings and the asterisks are in Table 15.

Unrestricted pairwise test statistics and p-values

Black oaks versus maples

TS
.769
.246
.385
2.245
—

.442
.620
.535
.326
.331*

.412
.311
.282
.331
.337

Black oaks versus white oaks

TS
−.657
.092
.163
1.520
—

.511
.762
.686
.468
.466*

.473
.483
.483
.481
.481

Maples versus white oaks

TS
−3.470
5.356
5.634
16.554
—

<.001
.021
.018
<.001
<.001*

<.001
<.001
<.001
<.001
<.001

7.2.2. Restricted Pairwise Symmetry Analysis

For the restricted pairwise symmetry tests, we construct the contingency tables for the two species in question (ignoring the other species). The NNCTs for the three pairs of species are presented in Table 17. Notice that the off-diagonal entries are very similar for black oaks versus maples and black oaks versus white oaks, indicating symmetry in the mixed NN structure for these pairs of species. The off-diagonal entries are very different for maples versus white oaks indicating strong asymmetry in mixed NN structure for these species.

Table 17: The restricted NNCTs for each pair of species in the Lansing Woods data (i.e., only the points for the pair of species are considered, the other species is ignored). B.O. stands for black oaks and W.O. for white oaks.

(a)

NN species
Total

B.O.
Maple

Base species

    B.O.
82
53
135

    Maple
49
465
514

Total
131
518
649

(b)

NN species
Total

B.O.
W.O.

B.O.
78
67
135

W.O.
72
376
448

Total
140
443
583

(c)

NN species
Total

Maple
W.O.

Maple
379
135
514

W.O.
172
276
448

Total
551
411
962

The (reduced) -symmetry contingency tables for each pair of species in the restricted sense are presented in Table 18, where relative frequencies of cell counts with respect to row sums are presented in parentheses. Relative frequencies of black oaks and maples seem to be very similar to the overall frequencies for the column sums, and the same holds for black oaks and white oaks, indicating symmetry in the shared structure. On the other hand, the relative frequencies for the maples and white oaks seem to be different from the overall frequencies, indicating asymmetry in the shared structure.

Table 18: The (reduced) Q-symmetry contingency tables for the restricted pairwise analysis for the Lansing Woods data. The relative frequencies in parentheses are with respect to the row sums. B.O. stands for black oaks, M. for maples, and W.O. for white oaks.

(a)

Number of times a point serving as a NN
Total

0
1
≥2

Classes

    B.O.
38 (.28)
65 (.48)
32 (.24)
135

    M.
142 (.28)
242 (.47)
130 (.25)
514

Total
180 (.28)
307 (.47)
162 (.25)
649

(b)

Number of times a point serving as a NN
Total

0
1
≥2

B.O.
36 (.27)
64 (.47)
35 (.26)
135

W.O.
135 (.30)
203 (.45)
110 (.25)
448

Total
171 (.29)
267 (.46)
145 (.25)
583

(c)

Number of times a point serving as a NN
Total

0
1
≥2

M.
117 (.23)
258 (.50)
139 (.27)
514

W.O.
136 (.30)
224 (.50)
88 (.20)
448

Total
253 (.26)
482 (.50)
227 (.24)
962

We present the test statistics and the associated values for the restricted pairwise symmetry analysis in Table 19. Black oaks versus maples exhibit symmetry in the NN structures and likewise for black oaks versus white oaks. However, maples versus white oaks exhibit significant asymmetry in the NN structures.

Table 19: The test statistics and the p-values for the unrestricted pairwise symmetry analysis for the Lansing Woods data. Row labelings and the asterisks are in Table 15.

Restricted pairwise test statistics and p-values

Black oaks versus maples

TS
.246
.010
.038
.144
—

.806
.922
.845
.930
.937*

.819
.778
.773
.932
.945

Black oaks versus white oaks

TS
−.597
.115
.180
.603
—

.551
.734
.671
.740
.759*

.598
.497
.455
.764
.778

Maples versus white oaks

TS
−2.923
3.717
3.939
10.806
—

.003
.054
.047
.005
.005*

<.001
<.001
<.001
.004
.004

7.2.3. One-versus-Rest Symmetry Analysis

For the one-versus-rest type symmetry tests, we construct the contingency tables for each species in question pooling the other species in one class. The NNCTs for the three species are presented in Table 20. Notice that the off-diagonal entries are very similar for black oaks versus rest, indicating symmetry in mixed NN structure. The off-diagonal entries for maples versus rest and white oaks versus rest are very different suggesting asymmetry in mixed NN structure.

Table 20: The NNCTs for the one-versus-rest type of symmetry analysis for the Lansing Woods data (i.e., the species in question is taken as class 1 and the others combined is treated as class 2). B.O. stands for black oaks and W.O. for white oak.

(a)

NN species
Total

B.O.
Rest

Base species

    B.O.
53
82
135

    Rest
78
884
964

Total
131
966
1097

(b)

NN species
Total

Maple
Rest

Maple
352
150
514

Rest
196
387
583

Total
560
537
1097

(c)

NN species
Total

W.O.
Rest

W.O.
236
212
448

Rest
167
482
649

Total
403
694
1097

The (reduced) -symmetry contingency tables for each species in the one-versus-rest sense are presented in Table 21 which also contains the relative frequencies with respect to row sums in parentheses. The relative frequencies for black oaks versus rest are similar to the overall frequencies indicating symmetry in the shared NN structure, while they are different for maples versus rest and white oaks versus rest, indicating asymmetry in the shared NN structure.

Table 21: The (reduced) -symmetry contingency tables for the one-versus-rest analysis for the Lansing Woods data. The relative frequencies in parentheses are with respect to row sums. B.O. stands for black oaks, M. for maples, W.O. for white oaks, and R. for rest.

(a)

Number of times a point serving as a NN
Total

0
1
≥2

Classes

    B.O.
37 (.27)
67 (.50)
31 (.23)
135

    R.
256 (.27)
479 (.50)
227 (.24)
962

Total
293 (.27)
546 (.50)
258 (.24)
1097

(b)

Number of times a point serving as a NN
Total

0
1
≥2

M.
112 (.22)
259 (.50)
148 (.29)
514

R.
181 (.31)
286 (.49)
116 (.20)
583

Total
293 (.27)
545 (.50)
259 (.24)
1097

(c)

Number of times a point serving as a NN
Total

0
1
≥2

W.O.
143 (.32)
219 (.49)
86 (.19)
448

R.
150 (.23)
327 (.50)
172 (.27)
649

Total
293 (.27)
546 (.50)
258 (.24)
1097

We present the test statistics and the associated values for the one-versus-rest symmetry analysis in Table 22. There is symmetry in NN structures for black oaks versus rest, while significant asymmetry in NN structures for maples versus rest and white oaks versus rest.

Table 22: The test statistics and the p-values for the unrestricted pairwise symmetry analysis for the Lansing Woods data. Row labelings and the asterisks are in Table 15.

One-versus-rest test statistics and P-values

Black oak versus rest

TS
.118
.000
.006
.049
—

.906
1.000
.938
.976
.970*

.889
1.000
.866
.968
.968

Maples versus rest

TS
−3.471
5.547
5.802
16.125
—

<.001
.019
.016
<.001
<.001*

<.001
<.001
<.001
<.001
<.001

White oaks versus rest

TS
3.447
4.840
5.068
13.832
—

<.001
.028
.024
<.001
<.001*

.001
<.001
<.001
.002
.002

8. Interpoint Dissimilarity Measures

A dissimilarity measure, , on a set of objects is the valued function on such that for all . A similarity measure, , on is the valued function on such that for all . Generally, and for all . In particular, if , then . We focus on dissimilarity measures only, since any similarity measure can easily be converted to a dissimilarity measure [27]. Any distance metric is by definition a dissimilarity measure. In practice, the term distance is often used to describe precisely the differences of actual measurements, while “dissimilarity” might be an estimation of a distance we can not measure physically. Among the widely used distances are Euclidean, Minkowski, Mahalanobis, and taxi-cab distances; among the nonmetric dissimilarity measures are maximum coordinate difference, minimum coordinate difference, dot product, Pearson’s linear dissimilarity, and Spearman’s rank dissimilarity.

In the literature usually NN relationships defined with distance metrics are used. In particular, Euclidean distance in is the only metric used in this paper. The use of distances for obtaining the relations can be generalized to dissimilarity measures in such a way that the of an object, , refers to the object with the minimum dissimilarity to . We assume that the objects (events) lie in a finite or infinite dimensional space satisfying the symmetry conditions. Under RL, the objects are fixed in the sense that they yield fixed interpoint dissimilarity measures, but the labels are assigned randomly.

The spatial patterns have broader interpretations in this extension. Symmetry occurs when the classes have similar NN structures with respect to each other. The extension of Pielou’s first type of symmetry test is straightforward. However, Pielou’s second type of symmetry test and Dixon’s tests are constructed assuming that data are in in the literature. In Dixon’s tests, the term which is the number of points with shared NNs needs to be updated for higher dimensional data. The general form of is defined as . In practice, usually . One may check the appropriateness of this assumption by using the interpoint dissimilarity matrix in the classical multidimensional scaling of the data to . If the relations do not change considerably, it might be more practical to just use instead of for computational reasons. Furthermore, with non-Euclidean distances or dissimilarity measures, a point can serve as a to more than 6 points, so the -symmetry contingency table should be updated accordingly.

Here is a possible example for which we have dissimilarity measures between objects that lie in a high or infinite dimensional space. In medical image analysis the differences in morphometry (shape and size) of tissues are measured by a distance metric called LDDMM (see, e.g., [28]). Based on the distances measured between certain brain tissues (like hippocampus), one is interested, say, in the symmetry of the shapes of the tissues with respect to NN relationships. This aspect of spatial dependence in the (abstract) morphometric space is a topic of prospective research.

9. Discussion and Conclusions

In this paper, we investigate tests of symmetry in mixed and shared nearest neighbor (NN) structures using contingency tables based on the NN relations between classes. We consider Pielou’s two types of symmetry tests and Dixon’s symmetry test and determine their appropriate null hypotheses and the underlying assumptions. Pielou’s first type of symmetry test and Dixon’s symmetry tests are for symmetry in mixed NN structure and are based on the nearest neighbor contingency table (NNCT), while Pielou’s second type of symmetry test is for symmetry in shared NN structure and is based on the -symmetry contingency table. We derive the asymptotic distribution of Dixon’s symmetry test under RL, which is also valid under CSR independence conditional on spatial allocation of the points in the study region. We extend Pielou’s and Dixon’s symmetry tests to multiclass case and prove the consistency of these tests under their appropriate null hypotheses. In particular, we prove consistency for Pielou’s first type of symmetry test under the appropriate sparse sampling in the overall multinomial framework, for Pielou’s second type of symmetry test under the appropriate sparse sampling in the row-wise multinomial framework and for Dixon’s symmetry test under RL patterns with completely mapped data.

Among the symmetry tests, we demonstrate that versions of Pielou’s first type of symmetry test are extremely conservative when used with the asymptotic critical value for the McNemar’s test, due to dependence between base-NN pairs and the underlying framework for the NNCT. Hence, these tests should be avoided in practice with the asymptotic critical values but can be used with Monte Carlo randomization. On the other hand, Pielou’s second type of symmetry test and Dixon’s symmetry test are about the desired level under complete spatial randomness (CSR) independence and random labeling (RL). We also consider the use of Fisher’s exact test for the -symmetry contingency table. In particular, we demonstrate that the table exclusive version of the two-sided exact test has the desired level under CSR independence and RL. It is also desirable for a test not only to be consistent but also powerful; hence, determining appropriate alternatives for these tests is an important task. We consider various patterns for assessing the finite sample performance of symmetry tests and discover other patterns under which the null hypotheses for these types of symmetry tests are satisfied. However, the variances and covariances (and hence the asymptotic distributions) should be adjusted to have the desired level for these patterns, because the asymptotic distribution of Dixon’s symmetry test is only derived under CSR independence and RL. With the critical values based on the asymptotic distribution under CSR independence or RL, the tests are either extremely conservative or liberal (although the null hypotheses are satisfied). We also find that some of the patterns can serve as alternatives for symmetry in shared NN structure or for symmetry in mixed NN structure. Under these alternatives, we observe that Pielou’s second type of symmetry test has higher power compared to Dixon’s test of symmetry. Furthermore, Pielou’s second type of symmetry test is only empirically shown to be appropriate under CSR independence and RL by Monte Carlo simulations. Finding the distribution of Dixon’s symmetry test under the null hypothesis of symmetry in mixed NN structure in general (as CSR independence and RL are only two special cases in this setting) and finding the distribution of Pielou’s second type of symmetry under the null hypothesis of symmetry in shared NN structure (even under CSR independence or RL) are still open problems.

In a multiclass setting, first an overall symmetry test can be conducted as an omnibus test. If significant, then either one-versus-rest or pairwise type post hoc tests can be applied. If the interest is in the symmetry of one class with respect to the remaining classes, then a one-versus-rest type analysis should be performed. On the other hand, if the interest is in determining which pair(s) significantly deviate from symmetry, then pairwise symmetry tests can be employed. When we are doing the pairwise tests after an overall symmetry test, we recommend the unrestricted pairwise version, which takes all the data into account (indeed the significant overall test was based on all the data considered). But if the interest is only on two of the classes, then a restricted pairwise test (considering only the classes in question) can be employed. For symmetry in shared NN structure (with -symmetry contingency table), we recommend the use of one-versus-rest type post hoc tests, as they are more consistent with the overall symmetry test.

Throughout the paper, we assumed that the total sample size is a fixed quantity. To make it a random variable, one may consider that data are from a Poisson point process over the (bounded) region of interest. The generalizations of the tests to high dimensional data and NNCTs based on general dissimilarity measures make this methodology useful for other fields as well.

Finally, the tests in this paper are not adjusted for the influence of the edges or boundary of the support, which usually causes the tests to be slightly liberal or conservative. Such an adjustment is only necessary when the spatial allocation of the points is not fixed but results from a stochastic process whose support contains the study region (as in the CSR independence case). To make the size of the test appropriate, the tests need to be adjusted for boundary effects, which is also a topic of prospective research.

Appendix

Proof of Theorem 7

Let . Then the pdf of is

for , a positive integer, and with the conventions of . Then and . The power at level is

The Taylor series expansion of around for fixed and is given by

where as . Note that

since under power equals the level of the test. Next,

(see, e.g., [29]), where

Substituting , we get

So . Thus, for small ,

Conflict of Interests

The author declares that there is no conflict of interests regarding the publication of this paper.

Acknowledgments

The author would like to thank the anonymous editors whose constructive comments and suggestions greatly improved the presentation and flow of the paper. This research was supported by the research agency TUBITAK via Project no. 111T767 and the European Commission under the Marie Curie International Outgoing Fellowship Programme via Project no. 329370 titled PRinHDD.

References

D. A. Coomes, M. Rees, and L. Turnbull, “Identifying aggregation and association in fully mapped spatial data,” Ecology, vol. 80, no. 2, pp. 554–565, 1999.

E. C. Pielou, “Segregation and symmetry in two-species populations as studied by nearest-neighbor relation-ships,” Journal of Ecology, vol. 49, no. 2, pp. 255–269, 1961.

P. M. Dixon, “Nearest-neighbor contingency table analysis of spatial segregation for several species,” Ecoscience, vol. 9, no. 2, pp. 142–151, 2002.

M. Kulldorff, “Tests of spatial randomness adjusted for an inhomogeneity: a general framework,” Journal of the American Statistical Association, vol. 101, no. 475, pp. 1289–1305, 2006.

A. J. Baczkowski and K. V. Mardia, “A test of spatial symmetry with general application,” Communications in Statistics, vol. 19, no. 2, pp. 555–572, 1990.

M. Sherman, Spatial Statistics and Spatio-Temporal Data. Covariance Functions and Directional Properties, John Wiley & Sons, Chichester, UK, 2011.

P. Mossay and P. M. Picard, “On spatial equilibria in a social interaction model,” Journal of Economic Theory, vol. 146, no. 6, pp. 2455–2477, 2011.

L. Scaccia and R. J. Martin, “Testing axial symmetry and separability of lattice processes,” Journal of Statistical Planning and Inference, vol. 131, no. 1, pp. 19–39, 2005.

P. M. Dixon, Testing Spatial Independence in Multivariate Point Processes, vol. 2215 of Institute of Statistics Mimeo, Raleigh, NC, USA, 1992.

P. Dixon, “Testing spatial segregation using a nearest-neighbor contingency table,” Ecology, vol. 75, no. 7, pp. 1940–1948, 1994.

T. R. Meagher and D. S. Burdick, “The use of nearest neighbor frequency analysis in studies of association,” Ecology, vol. 61, no. 5, pp. 1253–1255, 1980.

E. Ceyhan, “On the use of nearest neighbor contingency tables for testing spatial segregation,” Environmental and Ecological Statistics, vol. 17, no. 3, pp. 247–282, 2010.

W. J. Conover, Practical Nonparametric Statistics, John Wiley & Sons, 3rd edition, 1999.

A. H. Bowker, “A test for symmetry in contingency tables,” Journal of the American Statistical Association, vol. 43, no. 244, pp. 572–574, 1948.

P. J. Diggle, “On parameter estimation and goodness-of-fit testing for spatial point patterns,” Biometrics, vol. 35, no. 1, pp. 87–101, 1979.

D. Yates, D. Moore, and G. McCabe, Nonparametrics: Statistical Methods Based on Rank, W.H. Freeman, New York, NY, USA, 1st edition, 1999.

A. Agresti, “A survey of exact inference for contingency tables,” Statistical Science, vol. 7, no. 1, pp. 131–153, 1992.

E. Ceyhan, “Exact inference for testing spatial patterns by nearest neighbor contingency tables,” Journal of Probability and Statistical Science, vol. 8, no. 1, pp. 45–68, 2010.

K. D. Tocher, “Extension of the Neyman-Pearson theory of tests to discontinuous variates,” Biometrika, vol. 37, no. 1-2, pp. 130–144, 1950.

B. K. Moser, Linear Models: A Mean Model Approach, Academic Press, 1996.

J. Xie, Generalizing the Mann-Whitney-Wilcoxon statistic. [Ph.D. thesis], The Johns Hopkins University, Baltimore, Md, USA, 1999.

M. Kendall and A. Stuart, The Advanced Theory of Statistics, vol. 2, Griffin, UK, 4th edition, 1979.

C. van Eeden, “The relation between Pitman’s asymptotic relative efficiency of two tests and the correlation coefficient between their test statistics,” The Annals of Mathematical Statistics, vol. 34, no. 4, pp. 1442–1451, 1963.

P. J. Bickel and A. K. Doksum, Mathematical Statistics, Basic Ideas and Selected Topics, Prentice Hall, Englewood Cliffs, NJ, USA, 1977.

A. Baddeley and R. Turner, “spatstat: an R package for analyzing spatial point patterns,” Journal of Statistical Software, vol. 12, no. 6, pp. 1–42, 2005.

D. J. Gerrard, Competition Quotient: A New Measure of the Competition Affecting Individual Forest Trees, vol. 20 of Research Bulletin, Agricultural Experiment Station, Michigan State University, 1969.

D. Malerba, F. Esposito, and M. Monopoli, “Comparing dissimilarity measures for probabilistic symbolic objects,” Management Information Systems, vol. 6, pp. 31–40, 2002.

M. F. Beg, M. I. Miller, A. Trouvé, and L. Younes, “Computing large deformation metric mappings via geodesic flows of diffeomorphisms,” International Journal of Computer Vision, vol. 61, no. 2, pp. 139–157, 2005.

R. S. Strichartz, The Way of Analysis, Jones and Bartlett, 2000.