Modelling associations between animal social structure and demography