  This paper considers the design of observational longitudinal studies with a
continuous response and a binary time-invariant exposure, where, typically, the
exposure is unbalanced, the mean response in the two groups differs at baseline
and the measurement times might not be the same for all participants. We
consider group differences that are constant and those that increase linearly
with time. We study power, number of study participants (N) and number of
repeated measures (r), and provide formulas for each quantity when the other
two are fixed, for compound symmetry, damped exponential and random intercepts
and slopes covariances. When both N and r can be chosen by the investigator, we
study the optimal combination for maximizing power subject to a cost constraint
and minimizing cost for fixed power. Intuitive parameterizations are used for
all quantities. All calculations are implemented in freely available software.
