The Kaplan Meier produced by plot.flexsurvreg do not account for case weights. While this issue can be easily worked around, the plots can be misleading as all cases are associated to unit weights, and weighted KM are expected by users.
As all flexsurvreg objects include case weights in $data$m$`(weights)` this can be added easily to the type == "survival" and type == "cumhaz" options in plot.flexsurvreg. The muhaz function used in type == "hazard" does not have a built-in functionality accounting for case weights, and is not modified in this pull request.
The Kaplan Meier produced by
plot.flexsurvreg
do not account for case weights. While this issue can be easily worked around, the plots can be misleading as all cases are associated to unit weights, and weighted KM are expected by users.As all
flexsurvreg
objects include case weights in$data$m$`(weights)`
this can be added easily to thetype == "survival"
andtype == "cumhaz"
options inplot.flexsurvreg
. Themuhaz
function used intype == "hazard"
does not have a built-in functionality accounting for case weights, and is not modified in this pull request.