Flexible Estimation And Testing Methods For Survival Data With Application In Epidemiology And Precision Medicine