  A stepped wedge design is a unidirectional crossover design where clusters
are randomized to distinct treatment sequences. While model-based analysis of
stepped wedge designs -- via linear mixed models or generalized estimating
equations -- is standard practice to evaluate treatment effects accounting for
clustering and adjusting for baseline covariates, their properties under
misspecification have not been systematically explored. In this article, we
study when a potentially misspecified multilevel model can offer consistent
estimation for treatment effect estimands that are functions of calendar time
and/or exposure time. We define nonparametric treatment effect estimands using
potential outcomes, and adapt model-based methods via g-computation to achieve
estimand-aligned inference. We prove a central result that, as long as the
working model includes a correctly specified treatment effect structure, the
g-computation is guaranteed to be consistent even if all remaining model
components are arbitrarily misspecified. Furthermore, valid inference is
obtained via the sandwich variance estimator. The theoretical results are
illustrated via several simulation experiments and re-analysis of a completed
stepped wedge trial.
