The methodology of estimating real world time on treatment (rwToT) for anti-PD-1/PD-L1 based regimens administered for oncology treatment using different data types has been established in earlier studies.
Primary object for this package is to wrap all the rwToT study scripts and model into R package. This rwToT package uses the established study to meet the needs from both internal and external stakeholders. This package can be used repeatedly to estimate rwToT on a real-time basis with various data sets. The end goal is to help stakeholders have access to easily executable automated package with rich reference documentation and better user experience.
You can install the current version of rwToT package from source file or clone from bitbucket source folder. We plan to include the package in Merck package repository, Artifactory for easy distribution:
install.packages(rwToT)
install.packages(path_to_file, repos = NULL, type="source")
This is a basic example which shows how one would run rwToT estimation using sample Flatiron dataset:
library(rwToT)
library(survival)
library(dplyr)
## basic example code
rwToT_result <- rwToT::get_analysis(df_cohort = rwToT_test_file_B,
cohort_name = "Cohort B",
database_cutoff_date = "2021-01-31")
Here is what sample output results look like:
## analysis table
knitr::kable(rwToT_result$output_table)
| Description | Cohort B | | :----------------------------------------- | :----------------------------- | | No. patient | 3287 | | N discontinued (%) | 2467 (75.1%) | | N censored (%) | 820 (24.9%) | | Median (range) database follow-up months | 27.8 (0.1 - 75.9) | | Median (range) patient follow-up months | 6.1 (-0.9 - 56.6) | | Observed Median rwToT (range) | 3 (1 day - 56.6) | | KM Median rwToT (95% CI) | 4.2 (3.9 - 4.9) | | Restricted mean rwToT @ 09 months (95% CI) | 4.8 (4.6 - 4.9) | | Restricted mean rwToT @ 12 months (95% CI) | 5.7 (5.5 - 5.8) | | Restricted mean rwToT @ 18 months (95% CI) | 7.1 (6.8 - 7.3) | | Restricted mean rwToT @ 24 months (95% CI) | 8.1 (7.8 - 8.4) [Weibull] | | Restricted mean rwToT @ 30 months (95% CI) | 8.9 (8.6 - 9.2) [Weibull] | | Restricted mean rwToT @ 36 months (95% CI) | 9.5 (9.2 - 9.9) [Weibull] | | Restricted mean rwToT @ 48 months (95% CI) | 10.5 (10.1 - 10.8) [Weibull] | | 6 months on treatment rate in % (95% CI) | N=1171, 43.2% (41.4% - 45%) | | 12 months on treatment rate in % (95% CI) | N=617, 27.5% (25.8% - 29.1%) | | 18 months on treatment rate in % (95% CI) | N=367, 20.3% (18.8% - 21.9%) | | 24 months on treatment rate in % (95% CI) | N=219, 15.1% (13.6% - 16.6%) | | 27 months on treatment rate in % (95% CI) | N=148, 12.1% (10.7% - 13.6%) | | 30 months on treatment rate in % (95% CI) | N=112, 10.6% (9.2% - 12.2%) | | 33 months on treatment rate in % (95% CI) | N=89, 9.7% (8.4% - 11.3%) | | 36 months on treatment rate in % (95% CI) | N=65, 9.1% (7.7% - 10.6%) | | Database cutoff | 2021-01-31 |
## parametric curve
knitr::kable(head(rwToT_result$parametric_km))
| time | est | lcl | ucl | | ---: | --------: | --------: | --------: | | 0 | 1.0000000 | 1.0000000 | 1.0000000 | | 1 | 0.7280404 | 0.7154391 | 0.7402246 | | 2 | 0.6266568 | 0.6133551 | 0.6398342 | | 3 | 0.5565120 | 0.5428977 | 0.5701065 | | 4 | 0.5024985 | 0.4885049 | 0.5161424 | | 5 | 0.4586578 | 0.4446759 | 0.4723459 |
Separate functions are available in the package to compute restricted mean and treatment rate that are used in the main function:
Here since we are using survival AML data, we are computing survival rate (proportion surviving) for those patient who were in treatment for 18 weeks. Life time table showing survival rate for AML dataset can be found here.
fit_km <- survfit(with(aml, Surv(time,status)) ~ 1)
rwToT::get_treatment_rate(fit_km ,18)
[1] “N=14, 64.6% (47.5% - 87.8%)”
## Get restricted mean at 36 months
rmean_36mon <- rwToT::get_restricted_mean(rwToT_test_file_A %>%
#converting DD days to months
mutate(DD = (DD/365) * 12), t = 36)
rmean_36mon$mean
[1] “11 (10.2 - 11.9) [Weibull]”
knitr::kable(head(rmean_36mon$parametric_km))
| time | est | lcl | ucl | | ---: | --------: | --------: | --------: | | 0 | 1.0000000 | 1.0000000 | 1.0000000 | | 1 | 0.9021455 | 0.8786941 | 0.9220481 | | 2 | 0.8211002 | 0.7893273 | 0.8497002 | | 3 | 0.7496365 | 0.7130565 | 0.7830694 | | 4 | 0.6857219 | 0.6476129 | 0.7220033 | | 5 | 0.6281453 | 0.5887264 | 0.6665914 |
Restricted mean survival time measures the area under the Kaplan–Meier
survival curve up to a prespecified, clinically important time point
t
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.