Dialysis has been used in the treatment of patients with end-stage renal disease since the 1960s. Recently, several large observational studies have been conducted to assess whether early initiation of dialysis prolongs survival, as compared with late initiation. However, these studies have used analytic approaches which are likely to suffer from either lead-time bias or immortal-time bias. In this paper, the authors demonstrate that recently developed methods in the causal inference literature can be used to avoid both types of bias and accurately estimate the ideal time for dialysis initiation from observational data. This is illustrated using data from a nationwide population-based cohort of patients with chronic kidney disease in Sweden (1996-2003).