In the evaluation of pharmacologic therapies, the controlled clinical trial is the preferred design. When clinical trial results are not available, the alternative designs are observational epidemiologic studies. A traditional concern about the validity of findings from epidemiologic studies is the possibility of bias from uncontrolled confounding. In studies of pharmacologic therapies, confounding by indication may arise when a drug treatment serves as a marker for a clinical characteristic or medical condition that triggers the use of the treatment and that, at the same time, increases the risk of the outcome under study. Confounding by indication is not conceptually different from confounding by other factors, and the approaches to detect and control for confounding--matching, stratification, restriction, and multivariate adjustment--are the same. Even after adjustment for known risk factors, residual confounding may occur because of measurement error or unmeasured or unknown risk factors. Although residual confounding is difficult to exclude in observational studies, there are limits to what this "unknown" confounding can explain. The degree of confounding depends on the prevalence of the putative confounding factor, the level of its association with the disease, and the level of its association with the exposure. For example, a confounding factor with a prevalence of 20% would have to increase the relative odds of both outcome and exposure by factors of 4 to 5 before the relative risk of 1.57 would be reduced to 1.00. Observational studies have provided important scientific evidence about the risks associated with several risk factors, including drug therapies, and they are often the only option for assessing safety. Understanding the methods to detect and control for confounding makes it possible to assess the plausibility of claims that confounding is an alternative explanation for the findings of particular studies.