We review the concept of time-dependent confounding by using the example in paper “Comparative effectiveness of individual angiotensin receptor blockers on risk of mortality in patients with chronic heart failure” by Desai et al. and illustrate how to adjust for it by using inverse probability of treatment weighting through a simulated example. We discuss a few subtle issues that arise in specification of the model for treatment required to fit marginal structural models (MSMs) and in specification of the structural model for the outcome. We discuss the differences between the effects estimated in MSMs and intention-to-treat effects estimated in randomized trials, followed by an outline of some limitations of MSMs. Copyright © 2012 John Wiley & Sons, Ltd.