A common objective of longitudinal clinical trials is to compare rates of change in a continuous response variable between two groups. The power realized for such a study is a function of both the number of people recruited and the planned number of measurements for each participant. By varying these two quantities in opposite directions, power can be kept at the desired level. We consider the problem of how best to choose the sample size and frequency of measurement, with a view to minimizing either the total number of measurements or the cost of a study. Some general guidelines are first developed for the situation in which all participants have complete observations. In practice, however, longitudinal studies often suffer from dropout, where a participant leaves the study permanently so that no further observations are possible. We therefore consider the impact of unanticipated dropout on power and also ways of allowing for dropout at the design stage. Based on our results, we propose some general design guidelines for longitudinal trials comparing rates of change when dropout is present.