Fitting a Weibull Curve to a Kaplan-Meier Survival Curve
✓ Published0🌍 Public
TTommyCoin80
Last edited Aug 10, 2017
Created on Jul 12, 2017
A D3 v4 animation demonstrates least squares regression fitting of a Weibull curve to a Kaplan-Meier survival curve. The chart displays survival probability over time in months, with the Kaplan-Meier step points in red and the fitted Weibull regression line in blue. The code uses `d3.scaleLinear` for axes, `d3.line` for the fitted curve, and `transition.attrTween` to animate the regression line as it adjusts to the data points. The visualization runs in SVG with linear easing over three seconds, showing how the Weibull parameters are optimized to approximate the empirical survival function.
AI-generated descriptionA D3 animation of how least squares regression Webiull fitting works on a Kaplan-Meier survival curve.