Objective To compare the effectiveness of dynamic anemia management strategies by applying the parametric g‐formula to electronic health records. Data Source/Study Setting Patients with end‐stage renal disease from the US Renal Data System who had congestive heart failure or ischemic heart disease and were undergoing hemodialysis in outpatient dialysis facilities between 2006 and 2010. Study Design We explicitly emulated a target trial of three erythropoietin dosing strategies (aimed at achieving a low, middle, or high hematocrit) and estimated the observational analog of the per‐protocol effect. Results Of 156,945 eligible patients, 41,970 died during the 18‐month follow‐up. Compared to the low‐hematocrit strategy, the estimated risk of death was 4.6 (95% CI 4.4–4.9) percentage points higher under the high‐hematocrit strategy and 1.8 (95% CI 1.7–1.9) percentage points higher under the mid‐hematocrit strategy. The corresponding risk differences for a composite outcome of death and myocardial infarction were similar. Conclusion An explicit emulation of a target trial using electronic health records, combined with the parametric g‐formula, allowed comparison of real‐world dynamic strategies that have not been compared in randomized trials.