  Stepped wedge cluster randomized controlled trials are typically analyzed
using models that assume the full effect of the treatment is achieved
instantaneously. We provide an analytical framework for scenarios in which the
treatment effect varies as a function of exposure time (time since the start of
treatment) and define the "effect curve" as the magnitude of the treatment
effect on the linear predictor scale as a function of exposure time. The
"time-averaged treatment effect", (TATE) and "long-term treatment effect" (LTE)
are summaries of this curve. We analytically derive the expectation of the
estimator resulting from a model that assumes an immediate treatment effect and
show that it can be expressed as a weighted sum of the time-specific treatment
effects corresponding to the observed exposure times. Surprisingly, although
the weights sum to one, some of the weights can be negative. This implies that
the estimator may be severely misleading and can even converge to a value of
the opposite sign of the true TATE or LTE. We describe several models that can
be used to simultaneously estimate the entire effect curve, the TATE, and the
LTE, some of which make assumptions about the shape of the effect curve. We
evaluate these models in a simulation study to examine the operating
characteristics of the resulting estimators and apply them to two real
datasets.
