Randomized controlled trials of interventions to improve adherence to antiretroviral medications are not always feasible. Marginal structural models (MSM) are a statistical methodology that aims to replicate the findings of randomized controlled trials using observational data. Under the assumption of no unmeasured confounders, 3 MSM estimators are available to estimate the causal effect of an intervention. Two of these estimators, G-computation and inverse probability of treatment weighted (IPTW), can be implemented using standard software. G-computation relies on fitting a multivariable regression of adherence on the intervention and confounders. Thus, it is related to the standard multivariable regression approach to estimating causal effects. In contrast, IPTW relies on fitting a multivariable logistic regression of the intervention on confounders. This article reviews the implementation of these methods, the assumptions underlying them, and interpretation of results. Findings are illustrated with a theoretic data example in which MSM are used to estimate the effect of a behavioral intervention on adherence to antiretroviral therapy.