Social structure and population dynamics are closely intertwined (Shizuka & Johnson, 2019). The social structure of populations is critical in shaping key ecological processes, such as the spread of information and infections (Allen et al., 2013;Aplin et al., 2015;White et al., 2017), and in driving patterns of evolutionary change (Fisher & McAdam, 2017). On the one hand, social relationships will be influenced by demographic changes; for example, individuals may interact more with others at higher population densities (O'Brien et al., 2018). On the other hand, social relationships may influence key demographic processes, such as reproductive rates (McDonald, 2007), dispersal (Blumstein et al., 2009) or survival (Ellis et al., 2017). Hence, the interplay between demography and social structure is of immediate relevance to tackling numerous important questions in behavioural and evolutionary ecology, and yet longterm demographic data are rarely associated with detailed social analyses.Many long-term studies of wild animals involve the collection of data based on capture-mark-recapture (CMR) approaches, where individuals are given a unique identifier when first captured, allowing identification if subsequently recaptured. If CMR data are spatiotemporally referenced (i.e. the location, time and date of each capture are recorded), then under the assumption that co-located