%0 Journal Article %T Marginal structural models to estimate the effects of time %A Alisa Stephens-Shields %A Jiwei He %A Marshall Joffe %J Statistical Methods in Medical Research %@ 1477-0334 %D 2019 %R 10.1177/0962280217732598 %X Marginal structural models are a class of causal models useful for characterizing the effect of treatment in the presence of time-varying confounding. They are more widely used than structural nested models, partly because these models are easier to understand and to implement. We extend marginal structural models to situations with clustered observations with unit- and cluster-level treatment and introduce an appropriate inferential method. We consider how to formulate models with cluster-level and unit-level treatments. For unit-level treatments, we consider cases with and without interference. We also consider the use of unit-specific inverse probability weights and certain working correlation structures to improve the efficiency of estimators in some situations. We apply our method to different scenarios including 2 or 3 units per cluster and a mixture of larger clusters. Simulation examples and data from the treatment arm of a glaucoma clinical trial were used to illustrate our method %K Potential outcomes %K marginal structural models %K clustered observations %K optimal estimating equation %K ophthalmology %U https://journals.sagepub.com/doi/full/10.1177/0962280217732598