In epidemiology, the regression discontinuity design has received increasing attention recently and might be an alternative to randomized controlled trials (RCTs) to evaluate treatment effects. In regression discontinuity, treatment is assigned above a certain threshold of an assignment variable for which the treatment effect is adjusted in the analysis. We performed simulations and a validation study in which we used treatment effect estimates from an RCT as the reference for a prospectively performed regression discontinuity study. We estimated the treatment effect using linear regression adjusting for the assignment variable both as linear terms and restricted cubic spline and using local linear regression models. In the first validation study, the estimated treatment effect from a cardiovascular RCT was -4.0 mmHg blood pressure (95% confidence interval: -5.4, -2.6) at 2 years after inclusion. The estimated effect in regression discontinuity was -5.9 mmHg (95% confidence interval: -10.8, -1.0) with restricted cubic spline adjustment. Regression discontinuity showed different, local effects when analyzed with local linear regression. In the second RCT, regression discontinuity treatment effect estimates on total cholesterol level at 3 months after inclusion were similar to RCT estimates, but at least six times less precise. In conclusion, regression discontinuity may provide similar estimates of treatment effects to RCT estimates, but requires the assumption of a global treatment effect over the range of the assignment variable. In addition to a risk of bias due to wrong assumptions, researchers need to weigh better recruitment against the substantial loss in precision when considering a study with regression discontinuity versus RCT design.