In socially living animals, relationships between group members are typically highly differentiated. Some dyads maintain strong and long-lasting relationships, while others are only connected by weak ties. There is growing evidence that the number and strength of social bonds are related to reproductive success and survival. Yet, few of these analyses have considered that frequent or prolonged affiliative interactions between two individuals are driven by two different processes: namely, the overall gregariousness of the individuals involved and their dyadic affinity, i.e., the preference the members of the dyad have to interact specifically with one another. Crucially, these two axes of sociality cannot be observed directly, although distinguishing them is essential for many research questions, for example, when estimating kin bias or when studying the link between sociality and fitness. We present a principled statistical framework to estimate the two underlying sociality axes using dyadic interaction data. We provide the R packagebamoso, which builds on Stan code to implement models based on the proposed framework and allows visual and numerical evaluation of the estimated sociality axes. We demonstrate the application and some of the critical advantages of our proposed modeling framework with simulated and empirical data: (1) the possibility of checking model fit against observed data, (2) the assessment of uncertainty in the estimated sociality parameters, and (3) the possibility to extend it to more complex models that use interaction data to estimate the relationship between individual-level sociality and individual-level outcomes in a unified model. Our model will help to understand how and why individuals interact with each other and will help address questions about the relationship between variation in sociality and other features of interest, both within and across species.