Cow characteristics associated with the variation in number of contacts between dairy cows

In modern freestall barns where large groups of cows are housed together, the behavior displayed by herd mates can influence the welfare and production of other individuals. Therefore, understanding social interactions in groups of dairy cows is important to enhance herd management and optimize the outcomes of both animal health and welfare in the future. Many factors can affect the number of social contacts in a group. This study aimed to identify which characteristics of a cow are associated with the number of contacts it has with other group members in 2 different functional areas (feeding and resting area) to increase our understanding of the social behavior of dairy cows. Inside 2 herds housed in freestall barns with around 200 lactating cows each, cow positions were recorded with an ultra-wideband real-time location system collecting all cows’ positions every second over 2 wk. Using the positioning data of the cows, we quantified the number of contacts between them, assuming that cows spending time in proximity to one another (within a distance of 2.5 m for at least 10 min per day) were interacting socially. We documented in which barn areas these interactions occurred and used linear mixed models to investigate if lactation stage, parity, breed, pregnancy status, estrus, udder health, and claw health affect the number of contacts. We found variation in the number of contacts a cow had between individuals in both functional areas. Cows in later lactation had more contacts in the feeding area than cows in early lactation. Furthermore, in one herd, higher parity cows had fewer contacts in the feeding area than first parity cows, and in the other herd, cows in third parity or higher had more contacts in the resting area. This study indicates that cow characteristics such as parity and days in milk are associated with the number of contacts a cow has daily to its herd mates and provides useful information for further research on social interactions of dairy cows.


INTRODUCTION
Social interactions in dairy cattle play an important role in their everyday activities and could be crucial to the understanding of optimal management, welfare, and disease transmission.Domesticated cattle are gregarious and live in herds, based on dominance hierarchies, where they form relationships based on social interactions between individuals (Bouissou et al., 2001).These interactions can be categorized into agonistic or affiliative interactions having either negative or positive effects on individuals.Management procedures such as mixing of groups, introducing new individuals, large group sizes, and insufficient space allowance can cause social tension in the herd and increase the agonistic behaviors (Talebi et al., 2014;Foris et al., 2021;Scheurwater et al., 2021).Social tension can cause stress, which may not only affect animal welfare but also production, as stressed cows tend to produce less milk (Hedlund and Løvlie, 2015).Furthermore, the contact intensity between individuals is also a major factor for the transmission of diseases (Chen and Lanzas, 2016).Positive social behavior, in contrast, defined as either spatial proximity between certain individuals or allogrooming, is believed to reduce aggression, have a calming effect, and strengthen relationships between individuals (Boissy et al., 2007), hence potentially increasing both animal welfare and milk production.
Cows differ in their tendency to stay close to other individuals (Boyland et al., 2016;Rocha et al., 2020) and they may form strong bonds with other cows, especially when sharing long-term experiences (Gutmann et al., 2015;de Freslon et al., 2020).Cows also seem to have preferential assortment to individuals with similar attributes, such as parity, breed, milk production, or gregariousness (Boyland et al., 2016;Churakov et al., 2021).Other studies have shown that cows can have preferred feeding partners, which has mostly been seen in pairs of primiparous cows (Val-Laillet et al., 2009).
There are many factors that can affect the number of social interactions in a group.Different functional areas of the housing system are, for example, important to consider because the social network patterns can alter between the walking alley, feeding, and lying areas (Gygax et al., 2010;Foris et al., 2021).Cows more familiar with each other have spent longer time together and formed stronger social bonds compared with cows less familiar with each other (Gutmann et al., 2015).In addition, more active cows may have more opportunities to interact with other individuals in the group than less active cows.For example, the activity increases significantly on the day of estrus for a cow (Schofield et al., 1991).Veissier et al. (2017) also found that cows in early or late lactation and younger cows tend to be more active.However, Chopra et al. (2020) did not find any correlation between parity and spatial proximity to specific individuals.Sickness and injuries may cause alterations in a cow's behavior and activity levels, and the individual may potentially decrease interactions with other group members (Fogsgaard et al., 2015;Sepúlveda-Varas et al., 2016;Weigele et al., 2018).
Automated bio-logging technology has opened up a myriad of possibilities to study social interaction between animals in both wild environments (Smith and Pinter-Wollman, 2021), and conventional production systems (Foris et al., 2019;Rocha et al., 2020).This includes a systematic sampling or collecting of individual animals' behavior without affecting the observed animals as much as traditional behavioral studies can (Altmann, 1974).Using a real-time locating system (RTLS) we can get detailed information about spatiotemporal co-occurrences and investigate which cows tend to spend more time close to other cows.A major benefit of studying a production animal is the fine-scale individual information retrieved on for example age, pregnancy status, or time at the feeding table.Combining individual information with positioning data, we can try to explain the differences in proximity using individual characteristics.Investigating social interactions of cows opens up the possibility to improve animal welfare and production by improving the social environment of individual cows.
Increased understanding of factors driving social interaction can help disentangle the most effective social conditions for dairy cattle and optimize the size and composition of dairy cow groups.The aim of this study was, therefore, to identify which characteristics of a cow were associated with the number of contacts it has with other group members in 2 different functional areas (feeding and resting area) to increase our understanding of the social behavior of dairy cows.Using positioning data of cows from 2 indoor dairy farms, we (1) quantified and explored the variation of the number of contacts between cows in 2 separate areas in the barn (feeding and resting) and (2) investigated if lactation stage, parity, breed, pregnancy status, estrus, udder health, and claw health affected the number of contacts.

MATERIALS AND METHODS
All data were collected in accordance with the Swedish Animal Welfare Act.No ethical approval was needed for this type of study; thus the research was not submitted to an Animal Ethics Committee.

Animals and Housing
Data were collected from 2 commercial dairy farms, one in Sweden (farm A) and one in Netherlands (farm B).Farm A housed around 210 lactating dairy cows (Holstein Friesian, Swedish Red, and crossbreds) in a noninsulated freestall barn.The barn was divided into 2 milking groups, G1 and G2, each with a pen area of 14 m × 56 m and 102 and 103 cubicles, respectively, with rubber mattresses and sawdust as bedding material (Figure 1).Approximately 2 wk before the start of the study period a sample of 22 cubicles all over the barn was measured in farm A. These 22 cubicles were chosen as a representative sample of all cubicles because all cubicles in the farm could not be measured due to time limitations.The width was on median 120.5 cm (range: 108-126).
Group 1 consisted predominantly of newly calved cows and cows with high milk yield, and G2 contained mainly pregnant cows or cows decided for slaughter.Cows were routinely moved, usually at approximately 170 DIM, from G1 to G2 when confirmed pregnant, or at the decision of slaughter.However, the group compositions were also dependent on the current sizes of the 2 groups.The dry cows were housed in a separate group in another building.The cows were fed a TMR 12 times a day, and had approximately 0.57 m of feed space per cow in G1 and 0.62 m in G2.The cows were milked twice a day (around 0430 h and 1630 h) in a milking parlor from GEA (2 × 12 GEA Euro class 800 with Dematron 75, GEA Farm Technologies), and each group spent around 1.5 h in the milking parlor during each milking event.
Farm B housed around 210 lactating Holstein Friesian cows in a noninsulated freestall barn, consisting of one milking group with the feeding table in the middle of the barn (Figure 1).The pen area was 30 m × 58 m.The cows in the milking group had access to 228 deeplitter cubicles (median width 112 cm, range 110-125 cm) with compost made of the cow's manure as bedding material.The dry cows were housed in a separated group in another building.The cows were milked at least twice a day in 2 double-automatic milking machines (Mlone, 5-box, GEA Farm Technologies) and were fed a partial mixed ration ad libitum, delivered once a day, with additional concentrate in the milking robots and feeding stations according to milk production.The cows had approximately 0.51 m of feed space per cow at the feeding table.Both farms had water troughs evenly distributed in the whole barn, placed at the end of the cubicle rows.

Positioning Data
Data Collection.In both farms, each lactating cow was equipped with a tag mounted on the top of the collar connected to an RTLS (CowView, GEA Farm Technologies) automatically collecting individual positioning data of the cows with a 1-s fix rate.The tags sent ultra-wideband signals, which were received by anchors located throughout the barns' ceiling.Cow positions were estimated through triangulation and preprocessed through a chain of built-in data-processing modules in the CowView system (Sloth and Frederiksen, 2019), with a reported accuracy of 50 cm (Meunier et al., 2018).Positioning data files were downloaded directly from GEA's server on each farm from October 16 to 29, 2020.The files (referred to as FA data files in the CowView system) contained a tag-ID, timestamp, and the (x, y) coordinates.We validated the accuracy in the 2 farms by computing the mean error distance for the fixed performance tags (13 tags in farm A, 21 tags in farm B), with a mean error distance of 78 and 54 cm in farms A and B, respectively.The variation between days for the same tag was negligible, whereas the standard deviation (SD) between tags was 88 cm in farm A and 35 cm in farm B. Following the recommendation by  and G2, where the cubicles are located in the middle of the barn and the feeding tables along the sides.The area shown in beige is out of reach for the cows in the milking group, except for transport between the pen area and the milking parlor.(B) Farm B contains one big milking group, where the feeding table is located in the middle of the barn and the cubicles along the sides.The area shown in beige is out of reach for the cows in the milking group except for the automatic milking system (AMS).Melzer et al. (2021), we also inspected heatmaps of the cows' positions during entire days and did not observe any apparent shifts in the data given the blueprints of the farms (Supplemental Material S1; https: / / pub .epsilon.slu.se/29185/ ; Hansson et al., 2022).
Data Processing.After downloading the position data from the GEA system, we used MATLAB (MATLAB, 2020) to interpolate missing positions and calculate the total duration of proximity interactions.Farm A had on average 33.8% missing positions over the 14 d with a SD of 9.3% between individuals and days.The average for farm B was 27.1% (SD 9.3%).Only tags mounted on cows were considered, whereby tags on cows with more than 70% of missing data during a 24 h period were also excluded [9 tags in farm A (6 in G1 and 2 in G2) and 1 tag in farm B] following Ren et al. (2021).Interpolation was performed using the Modified Akima Interpolation (Akima, 1970;Fried and Zietz, 1973) following the recommendation by Ren et al. (2022).Missing data at the beginning and the end of a day were treated separately.If a tag was missing data at the beginning of a day, the first nonmissing position was filled in for that period.Similarly, if a tag was missing data at the end of the day, the previous nonmissing position was filled in.Furthermore, if an interpolated position was out of range (i.e., outside the barn given the coordinates of the barn; Figure 1), it was positioned at the border of the barn.Farm A did not have enough tag collars for both the lactating and dry cows and therefore moved the tag collar from a dried-off cow to a newly calved cow.The tag-ID was linked to the correct cow using start and end date for a tag to the cow's calving and dry-off date, respectively.

Definition of the Response Variable: Contact Rate
This study focuses on the number of contacts a cow had with other group members in 2 different functional areas, the feeding area and resting area, in both farms (Figure 1), where the feeding area also includes space where the cows can walk and drink.The time spent in the 2 areas needs to be accounted for, as there might be an individual variation of time budgets.Therefore, a contact rate was defined, which represents the instantaneous number of individuals within proximity of a cow at any time during the day.Positioning data were used to find individuals within proximity of a cow, as detailed below.
A distance-radius threshold of 2.5 m defined a contact between dyads of cows (Rocha et al., 2020).The total duration of contacts t contact,i,k for each cow i and day k was calculated separately for the 2 functional areas, feeding and resting.The duration of contacts for each cow and day was obtained by summing contact durations with all other cows present in each group.The time spent in each area t area,i,k was also calculated.The fitted response variable in our analyses was the contact rate defined as t contact,i,k /t area,i,k .A cow that, for example, spends half of the time in the resting area with one conspecific and the other half of the time with another will have a contact rate of 1.Another cow that spends half of the time in the resting area with 2 conspecifics and the rest of the time alone will also have a contact rate of 1, reflecting the expected number of conspecifics within proximity at any point in time she is in the resting area.
The total duration of contacts between 2 individuals was required to be at least 10 min per day to be included in the analysis (Rocha et al., 2020).This threshold was applied to eliminate brief interactions due to cows just passing by each other.

Cow Characteristics
Data Collection.For farm A, individual attribute data such as parity, calving date, and tag-ID were provided by the farm and information about breed, insemination records, pregnancy diagnoses, and clawtrimming records was extracted from the Swedish official milk recording scheme.Quarter foremilk samples for analysis of SCC were collected on October 8 and October 22 from all lactating cows during afternoon milking.After disinfection of the teat ends with ethanol (70%), the first 3 milk streams were discarded.Then samples were collected in sterile 13-mL tubes.The SCC was measured by flow cytometry (SomaScope Smart, Delta Instruments B.V.).For farm B, lists with individual attribute data on parity, calving date, insemination date, pregnancy diagnoses, and tag-ID were provided from the farm.Summary of data collected of cows included in the analysis at each farm and group for each characteristic is presented in Table 1.
Data Processing.The parity of the cows in farm A varied between 1 to 6 and 1 to 7 in G1 and G2, respectively, and between 1 to 8 in farm B. The cows were categorized into 3 groups (parity 1, parity 2, and parity 3+).The average DIM during the study period was calculated and each cow was assigned to 1 of 3 lactation stages; early (7-49 DIM), mid (50-179 DIM), or late (≥180 DIM) lactation.Cows with breed proportion of the dominant breed >75% were defined as purebred, otherwise they were defined as crossbreds.
The pregnancy status of a cow was defined with the last insemination date and a later confirmed pregnancy found in the pregnancy status records.Cows confirmed pregnant were assumed to be pregnant one day after the successful insemination and then categorized as pregnant; otherwise, they were categorized as open.

Hansson et al.: INDIVIDUAL TRAITS AFFECTING COW INTERACTIONS
Insemination records were used to estimate when cows were in estrus during the study period.The optimal time to inseminate a cow is 12 h postestrus (Dransfield et al., 1998), and estrus behavior may be expressed for 2 to 24 h (Forde et al., 2011).A cow was therefore defined to be in estrus on the insemination day and the day before.The estrus cycle in dairy cows is between 18 to 24 d (Forde et al., 2011).For cows inseminated before or after the study period, the estrus was estimated from the average length of a cow's estrus cycle (21 d).
For cows inseminated after the study period, the estrus was estimated to be 21 and 22 d before insemination or 42 and 43 d before insemination (2 estrus cycles).For cows inseminated before the study period, the estrus Cows were inseminated during the study period.Estrus is estimated as equal to the insemination date. 2 Cows were inseminated after the study period.Estrus is estimated to 21 d before the insemination date. 3 Cows were inseminated before the study period.Estrus is estimated to 21 d after the insemination date. 4 Cows were inseminated after the study period.Estrus is estimated to 42 d before the insemination date. 5 Cows were inseminated before the study period.Estrus is estimated to 42 d after the insemination date. 6 Remark for minor lesions.
was estimated to be 21 and 22 d after insemination or 42 and 43 d after insemination.A cow was recorded to be in estrus if the estimated date was within the study period and after the calving date.Most dairy cows resume normal ovarian activity within 15 to 45 d postpartum (Forde et al., 2011).Therefore, we assumed that a cow started to ovulate at the earliest 32 d after calving (Opsomer et al., 1998).If a cow was pregnant, it was categorized as not in estrus.The cows were categorized into 3 groups with respect to estrus (estrus, not in estrus, and no information).One cow in G1 and 13 cows in G2 did not have any insemination records and categorized as no information.
The current health status of cows influences their behavior and 2 of the most important health problems in adult dairy cattle are mastitis and claw disorders.Therefore, we decided to include the available data on these 2 conditions in our analyses.Claw and udder health records were only recorded at farm A.
Lameness due to claw lesions is often a long-lasting condition and regular claw trimmings were only conducted every 6 to 8 wk on a subset of cows.Therefore, we decided to use the latest 2 claw-trimming records before and after the study period to get claw-trimming records for all cows under study [August 12, 2020 (1 cow in G1, 12 cows in G2), September 28, 2020 (27 cows in G1, 22 cows in G2), November 24, 2020 (26 cows in G1, 30 cows in G2), and January 5, 2021 (28 cows in G1, 14 cows in G2)].Remarks were based on either minor or major lesions of claw disorders: digital dermatitis, heel horn erosion, sole hemorrhage, white line abscess, double sole, white line separation, interdigital hyperplasia, verrucose dermatitis.For the analysis, all animals with at least one record of a claw disorder (minor or major) were considered to be "with claw health remark."One cow in G1 and 2 cows in G2 did not have any claw-trimming records and these were categorized as no information.
The quarter sample with the highest SCC for each cow was selected from each sampling event.The geometric mean of the 2 consecutive samples were calculated and a Box-Cox transformation of the SCC was performed.The transformed SCC was adjusted to parity and breed in accordance with Nyman et al. (2014Nyman et al. ( , 2016) ) and back transformed to adjusted SCC.All cows were classified into 3 risk categories: low (≤130,000 SCC/mL), mid (130,000-300,000 SCC/mL), and high (>300,000 SCC/mL) according to udder health classes used in the Swedish official milk recording scheme (Funke, 1989;Brolund, 1990).Four cows were only sampled in the second sampling (October 22, 2020), and this value was used instead of the geometric mean.Somatic cell count is usually elevated in the colostrum period in newly calved cows.Two cows were newly calved and in their colostrum period at the first sampling date, and their SCC records for this date were removed.
One cow in farm B did not have any individual attribute information and was therefore removed from the analysis.In farm A, G1 contained between 96 and 100 lactating cows during the study period, G2 between 87 and 94, and farm B had between 206 and 211 lactating cows.All groups were dynamic, with cows leaving and entering the groups depending on dry-off dates and calving dates, in addition to culling.Seven cows spent the first 7 d of the study in G1, and on October 23, they were moved to G2.During the study period, the number of unique cows in G1, G2, and farm B was 108, 98, and 216, respectively.Only cows present during the entire study period in one of the groups (G1, G2, or farm B) were included in the analysis.In total, 163 cows were present during the whole study period in farm A (83 in G1 and 80 in G2) and 201 cows in farm B.

Statistical Analysis
R statistical software version 4.0.3(R Core Team, 2020) was used for the statistical analyses.For each of the 2 areas, feeding and resting, a linear mixed model was fitted using the lmer function in the lme4 package (Bates et al., 2015).The response variable was contact rate, and date, parity, lactation stage, breed, estrus, pregnancy status, claw health, and udder health were included as explanatory variables, and cow ID as random effect to account for repeated measurements (days within study period).In G2, there were only 2 cases of estrus, and the variable was removed from the model in this group.In farm B, the variables claw health and udder health were not available and therefore not included in the model.For models producing skewed distributions of residuals, Box-Cox transformation was applied on the response variable using the boxcox function in the MASS package (Venables and Ripley 2002).The Box-Cox transformation parameter lambda used for the feeding area was 0.6, 0.4, and 0.6 for G1, G2, and farm B, respectively.The lambda was equal to 1.4, 1.3, and 0.2 for G1, G2, and farm B, respectively, for the resting area.The repeatability was calculated as the proportion of variation between individuals (i.e., the variance of individual random effects) with respect to the total variance (i.e., the sum of the variance of individual random effects and the residual variance).The skewness of the distributions of the response variable was calculated with the skewness function in the moments package (Komsta and Novomestky, 2015) in R. The Anova function in the car package (Fox and Weisberg, 2019) was used to compute P-values.

Model Validation and Sensitivity Analysis
Contact rate is dependent between individuals as it is a measure that involves pairs of cows in contact with each other.Consequently, the assumption of independence between individuals in the fitted linear mixed model is violated and significance levels in hypothesis testing may be affected.This was examined with a permutation test.The permutations were made between cows and between dates within cows.Hence, the explanatory variables for a record were coupled with a randomly sampled response variable from another record while retaining the structure of observations within cows.The original F-test statistic was compared against the F-test statistics obtained after fitting the linear mixed model to 10,000 permuted data sets.This permutation test is referred to as node-level permutation in Farine (2017).These node-level permutations produce random associations between the response variable and the explanatory variables, but at the same time keeps the dependency structure between observations.The ANOVA P-values from the 10,000 linear mixed models, fitted to the permuted data sets, should be uniformly distributed if deviations from the assumption of independence can be ignored.Consequently, the proportion of fitted models producing P-values below 5% should be around 0.05.This was the case and there was no need to adjust the significance level for deviations from the assumption of independence.
To further understand the 2 variables underlying the calculations of contact rates, t contact,i,k (total duration of contacts) and t area,i,k (time spent in each area), they were analyzed separately and the results are displayed in Supplemental Material S2 (https: / / pub .epsilon.slu.se/29185/ ; Hansson et al., 2022).
The residual variance was checked for consistency using the hglm package (Rönnegård et al., 2010) in R. The variance of the residuals was found to decrease with the time spent in an area, indicating that the number of contacts a cow had when only spending a shorter time in an area was more stochastic.However, the P-values of the estimates in the hglm output were similar to those from the linear mixed model fitted using the lmer function.Consequently, it was concluded that there was no need to adjust the P-values from lmer for variance heterogeneity.
Variance inflation factors were computed to test for multicollinearity between explanatory variables, using the vif function in the car package (Fox and Weisberg, 2019) in R. The variance inflation factors were close to 1 for all explanatory variables, indicating no multicollinearity problems between the models' variables and that the fixed factors essentially represented different effects.
An exhaustive sensitivity analysis for the distance and time thresholds used to define a social contact was out of the scope of this study; however, for farm A both distance thresholds of 1.5 m and 3.0 m were tested, and a time threshold of 20 and 30 min was also tested (Supplemental Material S3; https: / / pub .epsilon.slu.se/29185/ ; Hansson et al., 2022).

Feeding Area
The contact rate in the feeding area ranged between 1 and 2 for most cows in all groups and farms (Figure 2).Hence, the instantaneous number of individuals within proximity of a cow at any time during the day ranged between 1 and 2 individuals.The distribution of contact rates in the feeding area had a positive skewness in all 3 groups (G1: skewness = 0.22, G2: skewness = 0.51, farm B: skewness = 0.29).The estimated repeatability was 35, 36, and 30% in G1, G2, and farm B, respectively.The contact rates differed between days in both farms and groups (P < 0.001, Table 2).
Lactation stage had an effect on all groups and farms in the feeding area (G1 P = 0.013, G2 P = 0.029, farm B P < 0.001).Estimated effect sizes are given in Table 3.In G1 and farm B, cows in mid and late lactation had more contacts in the feeding area than the cows in early lactation.In G2, late lactation cows had fewer contacts than the cows in mid-lactation.
There was an effect of parity in G1 (P < 0.001) and farm B (P = 0.009) in the feeding area, but not in G2.Older cows in G1 had fewer contacts than younger cows.In farm B, on the contrary, Cows in parity 3+ had more contacts than cows in parity 1, although the estimated difference was not as large as in G1.
Breed had an effect in the feeding area in G2 (P = 0.008) but not in G1 (P > 0.05).Red Dairy Cattle had a lower contact rate than crossbreds and Holstein cows in G2.Pregnancy status did not have an effect in any of the groups, and udder health and claw health did not have an effect in either G1 or G2.Estrus, however, did have an effect in G1 (P = 0.002) but not in farm B (P = 0.069).Cows in estrus in G1 had contact with fewer individuals in the feeding area and the results in farm B pointed in the same direction.

Resting Area
The contact rates in the resting area ranged between 1 and 3 for most cows in all groups and farms (Figure 3).The distribution of the contact rates in the resting area had a negative skewness in farm A (G1: skewness = −0.32,G2: skewness = −0.25)and a positive skew-ness in farm B (skewness = 0.55).The repeatability was 47, 46, and 47% in G1, G2, and farm B, respectively.The contact rates were also different between days in both farms and groups (P < 0.001, Table 2).
There was no effect of lactation stage on the response variable in any groups or farms in the resting area (P > 0.05).Parity had an effect on the contact rates in farm B (P < 0.001) but not in farm A (P > 0.05).Estimated effect sizes are given in Table 4. Cows in parity 3+ had a higher contact rate than younger cows in farm B. Breed had no effect in any group in the resting area (P > 0.05).Pregnancy status had an effect in G1 (P < 0.001) but not in G2 or farm B. Pregnant cows had a lower contact rate than open cows in G1.There was an effect of estrus in G1 (P = 0.002) as well, but not in farm B (P > 0.05).Similar to the results in the feeding area, cows in estrus had a lower contact rate than cows not in estrus.Udder health had an effect on the contact rates in G1 (P = 0.017) but not in G2 (P > 0.05) and claw health had an effect in G2 (P = 0.008) but not in G1 in the resting area (P > 0.05).Cows with udder health categorized into the mid-risk group had lower contact rates than cows in the low-risk group in G1, and cows with remarks on claw health had a lower contact rate than cows with no remarks in G2.

DISCUSSION
We used an RTLS at 2 commercial dairy farms to identify which individual characteristics of a dairy cow were associated with the contact rate it had with other cows in the feeding and resting area.We found that lactation stage, parity, breed, and estrus with some variation affected the contact rates in the feeding area, whereas pregnancy status and udder and claw health did not seem to have any affect.In the resting area we found that the number of contacts were affected by parity, pregnancy status, estrus, as well as udder and claw health although it varied between groups, whereas lactation stage and breed did not.
There was an individual variation in contact rate among cows and a variation in contact rates between days, both around the feeding table and the resting areas in both farms.This was expected as the groups were dynamic with cows continuously entering and leaving the groups.Unstable and dynamic groups can result in more dynamic and temporal social bonds (Boyland et al., 2016).The health status and the circadian rhythm of the individual cows can also alter between days (Veissier et al., 2017) and may affect the number of contacts between individuals.Additionally, the daily management routines on the farms and the interference of the farm staff can differ from day to day and affect the possibilities to maintain social networks.

Association of Cow Characteristics with Contact Rate
Lactation Stage.Our results showed that cows in later lactation in G1 and farm B had a higher contact rate in the feeding area than cows in early lactation.Cows in later lactation on farm A (i.e., G1) also spent less time in the feeding area than early lactation cows (Supplemental Material S2, Supplemental Table S5; https: / / pub .epsilon.slu.se/29185/ ; Hansson et al., 2022), similar to the findings by Løvendahl and Munksgaard (2016), which may be related to the energy requirements in the different stages of the lactation.The lactation stage was related to time within the lactating group and cows in late lactation could thus have had the opportunity to create stronger social bonds with more individuals compared with early lactation cows.On the contrary, late lactation cows in G2 had a lower contact rate than cows in mid-lactation.However, we remind the readers that G2 consisted predominantly of cows in late lactation, and G1 contained mainly cows in early and mid-lactation.There were no early lactation cows present in G2, which could explain the contradictory results.Additionally, because cows were usually moved from G1 to G2 at approximately 170 DIM, many cows in G2 were relatively new to the group and might not have had as much time to create social bonds.The previous experience of conspecifics and familiarity between individuals has been identified as essential for social relationships (Gygax et al., 2010;Foris et al., 2021), and our findings suggest that the lactation stage and the time spent in the group seem to be important factors for the number of contacts cows have.

Parity.
In G1 and farm B, parity significantly affected the contact rate in the feeding area.Older cows had fewer contacts than younger cows in G1, whereas in farm B, older cows had more contacts than younger cows.However, the estimated effect for parity in farm B was smaller in comparison to the effect in G1.High parity cows have been shown to spend less time feeding (Azizi et al., 2010), and our results also showed that older cows spend a shorter time in the feeding area than younger cows (Supplemental Material S2, Supplemental Table S5; https: / / pub .epsilon.slu.se/29185/ ; Hansson et al., 2022).Higher parity cows are older and more experienced and can have a high dominance position in the herd (Wierenga, 1990).A cow with a higher social rank can most likely choose positions in the barn more freely than subordinates (Wierenga, 1990;Churakov et al., 2021).Therefore, if a dominant cow goes to the feeding area to eat, it will probably keep the same position at the feeding table, eat what it needs and then leave.A subordinate cow may be pushed away from its spot at the feeding table and may need to change position several times, getting a high number of contacts.Hence, our results suggest that parity has an effect on the number of contacts a cow has, which might be related to dominance and social rank.At the same time, Chopra et al. (2020) did not find any connections between parity and proximity interactions.
Parity was only significant in the resting area in farm B, where the older cows had more contacts than younger cows.These results could be related to where the cows chose to lie down in the barn.In the study of Churakov et al. (2021), conducted in the same 2 herds as the present study, older cows preferred to lie down in cubicles close to the milking area, and cows in the first lactation occupied cubicles in a less busy area of the barn.Older cows use the more frequently used cubicles (Churakov et al., 2021) and will automatically have more contact with other individuals in the resting area, similar to the study by Boyland et al. (2016), where cows in similar parity formed preferential bonds.
Breed.For breed, we found that Red Dairy Cattle had fewer contacts than crossbreds and Holstein cows in the feeding area in G2.Boyland et al. (2016) found that cows have a preferential assortment to individuals with similar breeds, which might be related to body size and energy requirements.The explanation for our results is unclear but indicates that there could be some difference in the social behavior between breeds and might also, for example, be related to temperament or personality (Sewalem et al., 2010;Hedlund and Løvlie, 2015), which would be interesting to investigate further.
Estrus.Cows in estrus are more restless and show sexual behaviors such as mounting or standing to be mounted and chin-resting on the rump of another cow.They are also more engaged in other social interactions, such as allogrooming and agonistic behavior (Kerbrat and Disenhaus, 2004).Estrus had a significant effect on the contact rate in G1, in both the feeding and resting area, where cows in estrus had fewer contacts than cows not in estrus.We might have expected that cows in estrus would have contact with more individuals because they usually are more active and solicit other cows to mount (Kerbrat and Disenhaus, 2004).However, this contact would probably be short when a cow in estrus was trying to mount a cow that was not in estrus and does not want to be mounted.Because we used a threshold of 10 min for the accumulated duration of contacts between 2 individuals during a day, many of these brief contacts would have been eliminated.Cows in estrus also usually stay close to one or more other individuals within so-called sexually active groups (Sveberg et al., 2013) and would, therefore, only have longer contact with a limited number of individu- Different superscript letters represent significantly different values (P < 0.05) between the levels for each factor.als.We did not observe significant results for estrus in farm B; one reason for this could be that we used indirect measures such as insemination dates and did not know if the cows actually were in estrus or which stage of the estrus they were in.
Udder Health.Udder health showed significant effects in the resting area in G1.Cows within the midrisk group had fewer contacts than the low-risk group.These results could be related to sickness behavior and a tendency for the cows to stay away from other individuals.High SCC is a sign of inflammation in the udder.It is documented that cows with clinical mastitis show signs of sickness behavior, such as changes in feeding behavior, activity, and lying time (Siivonen et al., 2011;Medrano-Galarza et al., 2012;Fogsgaard et al., 2015).Decreased feed intake, feeding rate, and lying time were even seen in cows with rather mild naturally occurring clinical mastitis (Medrano-Galarza et al., 2012;Fogsgaard et al., 2015).Sepúlveda-Varas et al. ( 2016) saw a decline in competitive replacements at the electronic feeding bins for cows diagnosed with clinical mastitis.In this study, we investigated the association of behavior and SCC, as an indicator of subclinical mastitis.Our study did not reveal any differences in the time spent in the resting and feeding area between cows of the 3 udder health classes (Supplemental Material S2, Supplemental Tables S5  and S6; https: / / pub .epsilon.slu.se/29185/ ; Hansson et al., 2022), and we did not find significant results for udder health in G2.
Claw Health.Claw health showed significant effects in the resting area in G2.Cows with claw remarks had contact with fewer individuals than cows with no remarks.Lameness can cause alterations in cow behavior and influence lying time, general activity, feeding behavior, and milking order (Weigele et al., 2018).Weigele et al. (2018) recorded fewer visits to the concentrate feeders by lame cows than nonlame cows, which could be interpreted as a strategy to avoid aggressive encounters or to avoid moving at all due to pain.Other studies found no correlation between agonistic behaviors and lameness (Walker et al., 2008;Chopra et al., 2020).Our study did not reveal any differences in the time spent in the resting and feeding area between cows with and without claw health remarks (Supplemental Material S2, Supplemental Tables S5 and S6; https: / / pub .epsilon.slu.se/29185/ ; Hansson et al., 2022), and we did not find significant results for claw health in G1.For claw health, we used indirect measures such as claw-trimming records from several dates and did not know if the cows were lame at the time of the study, which could explain the contradictory results.

Study Design and Limitations
Social Interactions.In our study, we cannot know for sure if proximity was connected to true social interaction or simply to an individual being more wide-ranging and therefore encountering more other individuals (Albery et al., 2021).Therefore, conclusions on social interactions should be drawn with caution.Proximity could also be due to nonsocial events such as the positioning of the other group members at the feeding table or in cubicles.This is one of the major challenges with using automated positioning data to identify proximity interactions (Chopra et al., 2020).
Defining Contacts.An appropriate distance threshold for a proximity interaction in cubicles would be 2.5 m to account for the maximum distance between the tags when 2 cows are lying in adjacent cubicles (Rocha et al., 2020).Choosing a distance threshold for proximity interactions in the feeding area and walking alley is slightly more complicated because an individual cow's ability to actively choose whom to be close with or to avoid will be affected by the stocking density in the herd and the layout of the barn (Chopra et al., 2020).The study of Chopra et al. (2020) defined proximity interactions between cows when the individuals were 3 m apart, and social interaction between 2 cows standing nose to nose would represent a distance-radius threshold of 1.25 m, according to Rocha et al. (2020).However, a social interaction between 2 cows where one cow is standing behind another cow or closely following another cow would approximately represent a cow's distance.Positioning data collected from collar-based tracking devices do not describe the entire space occupied by individuals' bodies.Therefore, conclusions drawn regarding the social network or potential disease transmission may be incorrect when body parts not wearing tags are excluded from the network or misidentified as noise (Farthing et al., 2020).A short maximum distance would be motivated to distinguish between genuine social associations and nonsocial proximity events.However, reducing false negatives is essential as the absence of a few associations can significantly alter the network's global structure (Farine and Whitehead, 2015), which would motivate as large maximum distance as possible.Hence, there is a trade-off between capturing genuine associations and capturing all important edges in the network structure.Our investigations in Supplemental Material S3 (https: / / pub .epsilon.slu.se/29185/ ; Hansson et al., 2022) showed no qualitative change when altering the distance threshold to 1.5 or 3.0 m.Gibbons et al. (2010) showed that a cow observed less than 1 m to 2 neighbors could be a suitable indicator of sociability but that it was in a context where the cows had little possibility to keep larger distances, which was not the case in our current study.
We also tested different thresholds for the accumulated duration of contacts between 2 individuals.We found that a 30 min threshold in the feeding area resulted in higher P-values for lactation stage and estrus in G1, which suggests further investigation into the most suitable threshold.Different social interactions may also differ in duration.Grooming bouts can vary a lot in duration, from 2 to 814 s (Val-Laillet et al., 2009) and in stable groups of cattle, agonistic behaviors are few and subtle and can be hard to distinguish (Bouissou et al., 2001).Choosing a threshold that is too high might lead to the exclusion of interactions of social character.
Housing Conditions.The layout of the building and the stocking density are factors that must be considered when studying the social structure among dairy cows in freestall systems (Collings et al., 2011;Lobeck-Luchterhand et al., 2015).These factors may affect the individual's ability to choose whom to be in proximity with or avoid actively (Chopra et al., 2020).There were more cubicles available in relation to the number of cows in G2 and farm B than G1.Having fewer cubicles to choose from probably limits the voluntary proximity interactions in the resting area.The barn layout of the 2 farms within this study was also quite different.The feeding tables were located along the sides of the barn in farm A and in the middle of the barn in farm B. The feed space per cow was a little bit less in farm B than in farm A, which may have limited the potential for individuals to actively avoid other cows.In farm A, the cows were divided into 2 groups, whereas in farm B, all cows were housed in one big group.These differences between farms may affect how the cows move around the barn and might explain why the results sometimes differed.Other aspects that might also have an affect are the differences in milking system, management practices of the farm, bedding material, feeding regimen, and geographical location.
Housing conditions also affect the accuracy of RTLS data.Ren et al. (2021) showed that the accuracy of the RTLS varied between the 2 areas on farm A, where group G1 and G2 are kept, with more missing data along one of the feeding tables.However, these are rather short events of missing data and we expect that our applied data interpolation should be sufficient to capture all contacts of substantial importance between pairs of cows.

CONCLUSIONS
This study aimed to associate characteristics of a cow to the number of contacts it has with other group members by the feeding table and in the resting area in the barn, to increase our understanding of the social behavior of dairy cows.Our findings suggest that cows in late lactation have more contacts in the feeding area than cows in early lactation and higher parity cows have fewer contacts in the feeding area than cows in the first lactation, which might be related to familiarity and social rank.Our results also revealed that higher parity cows seem to have more interactions in the resting area.Furthermore, cows with impaired claw health or udder health had fewer contacts with other cows in the resting area, compared with healthy cows.Further analyses and additional data collection to distinguish between positive and negative interactions are needed to increase our understanding of different management scenarios and effects on animal welfare.

Figure 1 .
Figure1.Schematic map of the 2 freestall barns used in the study, where y and x represent the direction of the y-and x-axes.(A) Farm A holds 2 milking groups, G1 and G2, where the cubicles are located in the middle of the barn and the feeding tables along the sides.The area shown in beige is out of reach for the cows in the milking group, except for transport between the pen area and the milking parlor.(B) Farm B contains one big milking group, where the feeding table is located in the middle of the barn and the cubicles along the sides.The area shown in beige is out of reach for the cows in the milking group except for the automatic milking system (AMS).

Figure 2 .
Figure 2. Distribution of the contact rates in the feeding area for all 3 groups: (A) for farm A milking group 1 (G1), (B) for farm A milking group 2 (G2), and (C) for farm B.
Hansson et al.: INDIVIDUAL TRAITS AFFECTING COW INTERACTIONSTable3.Summary of the estimated regression coefficients and significance of the individual characteristics on the contact rate in the feeding area for each farm (farm A divided into milking groups G1 and G2) Different superscript letters represent significantly different values (P < 0.05) between the levels for each factor. 1 Results are shown for G1 and G2 in farm A and farm B in a Box-Cox transformed scale.The residual SD of the estimates were 0.20, 0.19, and 0.24 in G1, G2, and farm B, respectively.

Figure 3 .
Figure 3. Distribution of the contact rates in the resting area for all 3 groups: (A) for farm A milking group 1 (G1), (B) for farm A milking group 2 (G2), and (C) for farm B.
Hansson et al.: INDIVIDUAL TRAITS AFFECTING COW INTERACTIONS

Table 1 .
Hansson et al.:INDIVIDUAL TRAITS AFFECTING COW INTERACTIONS Summary of data collected for cows included in the analysis at each farm and group (farm A divided into milking groups G1 and G2) for each characteristic Hansson et al.: INDIVIDUAL TRAITS AFFECTING COW INTERACTIONS

Table 2 .
P-values from the ANOVA test for the relation between the contact rate (Box-Cox transformed) and the individual characteristics in the feeding and resting areas for the studied farms (farm A divided into milking groups G1 and G2)

Table 4 .
Hansson et al.:INDIVIDUAL TRAITS AFFECTING COW INTERACTIONS Summary of the estimated regression coefficients and significance of the individual characteristics on the contact rate in the resting area on each farm (farm A divided into milking groups G1 and G2) 1 Hansson et al.: INDIVIDUAL TRAITS AFFECTING COW INTERACTIONS