Animal sociability measurements based on inter-individual distances or nearest-neighbour distributions can be obtained automatically with telemetry collars. So far, all the indices that have been used require the whole group to be observed. Here, we propose an index of the variability in affinity relationships in groups of domestic herbivores, whose definition does not depend on group size and that can be used even if some data are missing. This index and its estimators are based on a function that measures how frequently an animal is closer than another one from a third animal. When no data are missing, we show that our estimator and the variance of the sociability matrix sensu Sibbald (considered as the reference method) are strongly correlated. We then consider two cases of missing data. In the first case, some animals are randomly missing, that is, to account for random breakdown of telemetry collars. Our estimator is unbiased by such missing data and its variance decreases as the number of observation dates increases. In the second case, the same animals are missing at all observation dates, that is, in large herds where there are more individuals to be observed than available telemetry collars. Our estimator of affinity variance within a group is biased by such missing data. Thus, it requires changing animals equipped with telemetry collars regularly during the experiment. Conversely, the estimator remains unbiased at the population level, that is, if several independent groups are being analysed. We finally illustrate how this estimator can be used by investigating changes in the variability of affinities according to group size in grazing heifers.