Analysis of longitudinal studies is often complicated through differences amongst individuals in the number and spacing of observations. Laird and Ware (1982, Biometrics 38, 963-974) proposed a linear random-effects model to deal with this problem. We propose a generalisation of this model to accommodate multiple random effects, and show how Gibbs sampling can be used to estimate it. We illustrate the methodology with an analysis of long-term response to hepatitis B vaccination, and demonstrate that the methodology can be easily and effectively extended to deal with censoring in the dependent variable.