Testing for dependence has been a well-established component of spatial
statistical analyses for decades. In particular, several popular test
statistics have desirable properties for testing for the presence of spatial
autocorrelation in continuous variables. In this paper we propose two
contributions to the literature on tests for autocorrelation. First, we propose
a new test for autocorrelation in categorical variables. While some methods
currently exist for assessing spatial autocorrelation in categorical variables,
the most popular method is unwieldy, somewhat ad hoc, and fails to provide
grounds for a single omnibus test. Second, we discuss the importance of testing
for autocorrelation in data sampled from the nodes of a network, motivated by
social network applications. We demonstrate that our proposed statistic for
categorical variables can both be used in the spatial and network setting