Longitudinal random effects models for genetic analysis of binary data with application to mastitis in dairy cattle

A Bayesian analysis of longitudinal mastitis records obtained in the course of lactation was undertaken. Data were 3341 test-day binary records from 329 first lactation Holstein cows scored for mastitis at 14 and 30 days of lactation and every 30 days thereafter. First, the conditional probability of a sequence for a given cow was the product of the probabilities at each test-day. The probability of infection at time t for a cow was a normal integral, with its argument being a function of "fixed" and "random" effects and of time. Models for the latent normal variable included effects of: (1) year-month of test + a five-parameter linear regression function ("fixed", within age-season of calving) + genetic value of the cow + environmental effect peculiar to all records of the same cow + residual. (2) As in (1), but with five parameter random genetic regressions for each cow. (3) A hierarchical structure, where each of three parameters of the regression function for each cow followed a mixed effects linear model. Model 1 posterior mean of heritability was 0.05. Model 2 heritabilities were: 0.27, 0.05, 0.03 and 0.07 at days 14, 60, 120 and 305, respectively. Model 3 heritabilities were 0.57, 0.16, 0.06 and 0.18 at days 14, 60, 120 and 305, respectively. Bayes factors were: 0.011 (Model 1/Model 2), 0.017 (Model 1/Model 3) and 1.535 (Model 2/Model 3). The probability of mastitis for an "average" cow, using Model 2, was: 0.06, 0.05, 0.06 and 0.07 at days 14, 60, 120 and 305, respectively. Relaxing the conditional independence assumption via an autoregressive process (Model 2) improved the results slightly.


INTRODUCTION
Longitudinal binary response data arise frequently in many fields of applications ( [2,4]). Generally, longitudinal data consist of repeated observations taken over time in a group of individuals. In animal breeding, repeated observations over time on the same animal arise often. Although continuous repeated measurements over time (e.g., test day milk yield) have received a lot of emphasis in the last decade ( [8,12,13]), little attention has been devoted towards longitudinal binary responses. Most research done with binary data has focused on cross-sectional data, where only a single response is screened in each animal ( [7,9,10,15]). However, a single response is frequently a summary of performance over a period of time. For example, in mastitis studies, a cow is considered infected in lactation if at least one episode of infection has taken place during lactation, disregarding the number of episodes of infection or the timing of the episodes. Furthermore, environmental conditions fluctuate in the course of lactation. A longitudinal analysis of such data gives flexibility by permitting a better modeling of the environmental conditions affecting each episode of infection, and perhaps by allowing a better representation of the covariance structure within and between animals. Also, a longitudinal analysis of binary response data allows developing novel selection criteria other than a single predicted breeding value for liability to disease.
In this study, an approach to the analysis of longitudinal binary responses taken over time is developed in a Bayesian framework. The procedure was applied to longitudinal mastitis records (absence-presence) taken in the course of lactation using three different models for the probability of infection at any time t assuming conditional independence. A fourth model allowed for serial correlation between residuals in the underlying scale, thus relaxing the conditional independence assumption.

Data
The data recorded between July 1982 and June 1989, were provided by the Ohio Agricultural Research and Development Center at Wooster, Ohio, USA. After edits (inconsistent date of control, cows with less than three records), 142 records were eliminated. The final data set consisted of 3341 test-day binary records from 329 first-lactation Holstein cows scored for clinical mastitis at 14 and 30 days of lactation and every 30 d thereafter. Around 88% of the cows had complete lactation and only 4% had 5 test-day records or less. The incidence rate of mastitis (at least one infection in the lactation) was 17.8%. A general description of the original data set can be found in [14]. A summary description is presented in Table I. About 82% the cows did not have mastitis in their first lactation.

Cross-sectional binary response
Before describing the longitudinal setting, we describe a basic latent variable model for a cross-sectional binary response. Assume the observed binary response y i related to a continuous underlying variable l i satisfying: where l i ∼ N(µ i , σ 2 ), and T is a threshold value. This is the basic threshold model of quantitative genetics ( [5,9,16]). The probability of observing (1) (success) is: where Φ is the cumulative standard normal distribution function. It is clear from (2) that it is not possible to infer µ i , T and σ 2 , separately. Hence, some restrictions are placed on two of the three model parameters. A common choice is to set T = 0, and σ 2 = 1, leading to: Furthermore, µ i can be linearly related to a set of systematic and random effects as: where x i and z i are known incidence row vectors, and β and u are unknown location vectors corresponding to systematic and random effects, respectively. Implementation of this model in a Bayesian analysis using data augmentation became feasible after Albert and Chib [2] and Sorensen et al. [15]. All pertinent regional posterior distributions can be obtained using Markov Chain Monte Carlo procedures.

Longitudinal binary response
Now let y i = (y it 1 , y it 2 , . . . , y it ni ) be a n i x1 vector of responses for animal, (i = 1, 2, . . . , q) observed at times t 1 , t 2 , . . . , t n i test days. As in the case of cross-sectional analysis, the binary response observed at a time t j related to a normally distributed underlying variable satisfying (1): where µ ij is now some function of time. In this study, three functional forms were used to model µ ij , as follows:

Ali-Schaeffer model: M1
Here, the Ali and Schaeffer function [1] was fitted as a fixed linear regression within age-season of calving classes. The conditional expected value of liability for a cow, scored at time j in year month of test m calving in age-season r, was assumed to follow the model: The prior distributions were: a and σ 2 p are the additive genetic and permanent environmental components of variances and A is the additive relationship matrix. Bounds were set to large values to avoid truncation of parameter space. The joint prior had the form:

Random regression model using the Ali-Schaeffer function: M2
This model is similar to the previous one, but the genetic value was modeled via five-random regression parameters, leading to: The same prior distribution was used for parameters defined earlier. The prior distribution of the genetic regressions was: where G 0 is a 5 × 5 matrix of genetic (co)variances between the random regression parameters. The prior for G 0 was uniform, but with bounds for each non-redundant element (variances and covariances).

The Wilmink hierarchical model: M3
A three-stage hierarchical model was implemented using the Wilmink function to relate the mean of the underlying variable to time: where YM m and p i are as defined before, t ij are days in milk on test-day j for cow i and γ i = (γ 0i , γ 1i , γ 2i ) a 3 × 1 vector of the Wilmink's parameters for animal i. At the second stage of the hierarchy, a mixed linear model was imposed to the parameters of the Wilmink function, as follows: where γ is a vector containing all parameters for all cows, β includes effects of age-season of calving as parameters, u is a vector of additive genetic values associated with all the Wilmink function parameters, and e is a second-stage residual term.
To complete the hierarchy, the following prior distributions were assigned to the model parameters: where K 0 and 0 are 3 × 3 matrices of genetic and residual (co)variances between the parameters of the Wilmink function, respectively. For both matrices, flat and bounded priors were adopted.

Heterogeneity of the residual variance
Based on model comparison results, the random regression model using the Ali-Schaeffer function (M2) was used to investigate the effect of allowing for dependence of liabilities within a cow in the course of lactation (M4). A first order autoregressive process (AR(1)) was assumed. In this model, a serial residual correlation pattern within-cows was adopted. The resulting residual (co)variance matrix, R 0 , has known diagonal elements (equal to 1) and the covariance (correlation) between liability at test-days i and j is given by: where ρ ∈ [−1, 1], so: The prior distribution of ρ was uniform in [−1, 1].

Implementation
A data augmentation algorithm was implemented. For each of the three models M1, M2 and M3, the parameter vector was augmented with 3341 latent variables and with 171 genetic values of known ancestors in each of the three models. The conditional posterior distributions are in known form for all parameters, so Gibbs sampling is straightforward. The needed conditional distributions are normal for systematic, genetic and permanent effects (b, β, u, p), truncated normal for the 3341 latent variables, scaled inverted chi-square for the genetic variance in the first model (σ 2 u ) and for the permanent effect variance in the three models (σ 2 p ), and inverted Wishart for the 5 × 5 genetic (co)variance matrix in M2 (G 0 ) and the 3 × 3 genetic and residual (co)variance in M3 For the autoregressive random regression model (M4), all conditional posterior distributions, except for ρ, are in closed form. The sampling of liabilities is more involved because of the non-zero correlation between test-days that induces to truncated multivariate normal distribution. In order to sample from the multi-dimensional posterior density, p(l i |y i , β, u, p, R 0 ), a method of computation consisting of successive sampling from a set of truncated univariate normal distributions was adopted. The univariate distributions involved in this sampling scheme have the form: where l ij is the element j of the vector of liabilities for cow i and l −ij = (l i1 , l i2 , . . . , l i(j−1) ) are the liabilities for cow i except l ij . Inverse cumulative distribution sampling [6] was used to draw samples from the conditional posterior distribution of the latent variable. This technique is more efficient than a rejection-sampling scheme.
As noted before, the diagonal elements of the residual (co)variance matrix, R 0 , are set equal to one and hence, the only element of this matrix to sample in the autoregressive model is ρ. Its conditional distribution is not in a closed form, so a Metropolis-Hastings algorithm was used.

Comparison of Models
The Bayes factor, as defined by Newton and Raftery [11], was used to assess the plausibility of the models postulated. The marginal density of the data under each one of the models was estimated from the harmonic means of likelihood values evaluated at the posterior draws, that is: where y is the vector of observed binary responses and θ (j) is the Gibbs sampling sample j of parameters under model M i . The estimated Bayes factor between models M i and M j is:

Genetic parameters and model selection criteria
For M2, the genetic covariance for liability to mastitis between two times, t i and t j was defined to be: where G 0 is the 5×5 genetic (co)variances for the random regression parameters and . This definition sets the strong assumption that genetic expression along lactation is completely driven by time, since G 0 is not time-dependent.
For M3, the genetic covariance for liability to mastitis between two times was: where K 0 is a 3 × 3 genetic (co)variances matrix between the Wilmink function parameters and: Heritabilities of liabitity to mastitis using the three models were defined as: For the model with the autoregressive structure, heritability is computed as for M2.
Longitudinal data allows developing new selection criteria other than a single predicted additive genetic value for a cow. Potential selection criteria from these models include, for example, the probability of no mastitis during lactation, the probability of at most a certain number of episodes, and the expected number of days a cow has mastitis. In this study, the following arbitrary criteria were used: (a) Expected number of days with mastitis (MD): (b) Probability of mastitis during lactation: (c) Probability of no mastitis during lactation: (d) Expected fraction of days without mastitis (NMD): (e) Probability of no mastitis at 30, 150 and 300 days: Some of the selection criteria are a function of the others. However, for demonstration purposes and to illustrate the flexibility of the models, all these quantities were inferred from their posterior means.
Computations were by Gibbs sampling and Metropolis-Hastings algorithms, with a burn-in period of 20 000 samples. Analysis was based on 50 000 additional samples, drawn without thinning.

RESULTS AND DISCUSSION
The posterior mean for heritability of liability to mastitis was 0.05 using the first model, where the breeding value was assumed constant along lactation. Even though the data set used in this analysis was too small to draw a definite conclusion on genetic parameters, this estimate was similar to the values found by [14]. Under Models 2, 3 and 4, heritability is a function of time. Figure 1 shows the variation of heritability throughout lactation using Models 2, 3 and 4. For Model 2, heritability was high at the beginning of lactation (0.27 at day 14), dropped quickly to reach values close to 0.05 in the middle of lactation, and then increased by the end of lactation. A similar pattern was observed using the random regression model for continuous test-day data (milk yield). A possible explanation for such behavior was attributed in part to the heterogeneity of the residual variances, and by assuming a constant permanent environmental effect along lactation. Given the small amount of information in our data set, we did not test the effect of applying a random regression for the permanent effect. The same pattern was observed for heritability throughout lactation using Model 3. However, this time, the heritability at the beginning of lactation was much higher (0.57 at day 14) compared with Model 2. Also, the lowest values for heritability were in the middle of lactation. With Model 4, the heritability was lower at the beginning of lactation (0.21 at day 14) compared with M2, although it is still high for the trait under analysis, indicating the necessity of treating the permanent effect as a function of time. For all four models, the posterior standard deviation of heritability was high and ranged from 0.006 to 0.18. The posterior mean and standard deviation of the correlation parameter were 0.19 and 0.07, respectively. This estimate indicates a low correlation between two successive test-days. The correlation declines quickly as the interval between test-days increases; it drops to 0.04 and 0.007 when the interval between test-days is around 60 and 90 days, respectively.
The Bayes factor was 0.011 between Model 1 and Model 2, 0.017 between Model 1 and Model 3 and 1.537 between Model 2 and Model 3. These results show that the data favored models with a genetic component in the regression (Model 2 and 3). Although, the results were not conclusive, Model 2 received more support by the data than Model 3. Comparing Model 2 and 4, the Bayes factor was 1.10 in favor of the latter, indicating that the heterogeneity of residual variance has to be postulated by the statistical model.
New selection criteria, including the expected number of days with mastitis, the probability of no mastitis during lactation and the probability of at most a certain number of episodes with mastitis, were computed for the best and worst cows using Model 2. Table II presents the posterior mode and high posterior density interval at 95% for the five best and worst cows for the expected number of days with mastitis, respectively. For the five best cows, the expected number of days with mastitis ranged between 8 and 9 days. At a phenotypic level, these cows did not experience any episodes of mastitis during their lactation. However, for the five worst cows, the expected number of days with mastitis ranged from 151 days for a cow having six episodes of mastitis during lactation to 223 days for a cow having 10 episodes of mastitis. Table III presents the probability of no mastitis at 30, 150 and 300 days for the best and worst five cows. Such probability was higher than 0.92 for the best cows, and, in fact, they never got mastitis on the mentioned dates. For the worst cow, the probability was lower than 0.01.

CONCLUSION
This study demonstrates the feasibility and advantage of a longitudinal analysis of sequential binary responses. A random regression model proved to be superior than a model with constant genetic value over time based on the Bayes factor results. The proposed model allowed not only a better modeling of systematic effects associated with each episode of mastitis, but also defining new selection criteria other than a single predicted additive genetic value for a cow. Furthermore, longitudinal data analysis accounts for the number of episodes of mastitis along lactation as well as their timing. Relaxing the conditional independence assumption via an autoregressive process helped improve the results.
The methodology presented in this study is being applied to large data sets in Norway and Denmark.