Closed mikesweeting closed 8 months ago
Yes that would be reasonable. Calculating weighted quantiles though seems like a nontrivial problem with no standard implementation, judging from (https://aakinshin.net/posts/weighted-quantiles/) !
This is now implemented in https://github.com/chjackson/flexsurv/commit/8dd7d86a1802bf3cdc714d6da6268862e81a0497 . It works by replicating the observed event times, in proportions defined by an integer approximation to the weights, to obtain a longer vector of event times, and then taking the quantiles. It's rough but good enough for the purpose I think.
If using weights with flexsurvspline and leaving location of the knots unspecified (i.e. using k=. instead) then the knot locations are chosen based on the unweighted log uncensored survival times. Maybe a minor issue but feels like they knot locations should also take account of the weights.