In recent years we have seen an increasing interest in the study of longitudinal crime concentrations at small geographic scales such as street segments and neighbourhoods. That said, the prospect of being able to adequately identify the slowly changing character of these place-based crime profiles has been hindered by one key methodological drawback: the heightened sensitivity of existing longitudinal clustering methods to short-term fluctuations. Amongst the methods currently available, k-means clustering is the most malleable, allowing the opportunity for bespoke adjustments which might be prompted by theoretical or empirical insight.
Against this backdrop, we have developed a new clustering method termed ‘anchored k-medoids’ (ak-medoids). It leverages the adaptability of k-means to implement three fundamental modifications to the default method: (1) a trajectory approximation, to provide estimations from which non-random initialisation points can be calculated, (2) a non-random initialisation step and (3) a bespoke expectation-maximisation procedure. The result is the partition of crime trajectories into classes characterised by within-group homogeneity, but between group heterogeneity, with reference to their longer-term crime slopes. The expectation is that this approach will generate more theoretically meaningful cluster solutions than the default implementation of k-means.
In order to facilitate wider application and reproducibility of the method, we have developed an open-source package in R. Besides the main clustering functions, the user manual details numerous other data manipulation functions that can be used for longitudinal data preparation. You can find the user manual online here.
We also provide a worked example of how to deploy the package functions to study shifting inequality in the exposure to crime across small areas under a citywide crime drop situation - this can be found online here.
The worked demonstration uses a small example dataset which should allow users to get a clear understanding of how the method can be implemented using the package. The utility of the functions in the package are not limited to criminology, but rather can be applicable to longitudinal datasets more generally.
This package is being updated on a regular basis to maintain and append its existing functionalities. If you have any questions about this work, please email Monsuru Adepeju