In an observational study with a time-to-event outcome, the standard analytical approach is the Cox proportional hazards regression model. As an alternative to the standard Cox model, in this article we present a method that uses inverse probability (IP) weights to estimate the effect of a baseline exposure on a time-to-event outcome. IP weighting can be used to adjust for multiple measured confounders of a baseline exposure in order to estimate marginal effects, which compare the distribution of outcomes when the entire population is exposed versus when the entire population is unexposed. For example, IP-weighted Cox models allow for estimation of the marginal hazard ratio and marginal survival curves. IP weights can also be employed to adjust for selection bias due to loss to follow-up. This approach is illustrated using an example that estimates the effect of injection drug use on time until AIDS or death among HIV-infected women.