Type: | Package |
Title: | Estimating the Probability of Being in Response and Related Outcomes |
Version: | 0.1-0 |
Author: | Xiaodong Luo [aut], Bo Huang [aut], Lu Tian [aut, cre](<https://orcid.org/0000-0002-5893-0169>) |
Maintainer: | Lu Tian <lutian@stanford.edu> |
Description: | Make statistical inference on the probability of being in response, the duration of response, and the cumulative response rate up to a given time point. The method can be applied to analyze phase II randomized clinical trials with the endpoints being time to treatment response and time to progression or death. |
License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
Imports: | survival, stats, cmprsk |
Encoding: | UTF-8 |
LazyData: | true |
VignetteBuilder: | knitr |
Suggests: | knitr, rmarkdown |
Repository: | CRAN |
RoxygenNote: | 7.1.0 |
NeedsCompilation: | no |
Packaged: | 2020-09-09 17:34:41 UTC; lutia |
Date/Publication: | 2020-09-17 09:10:12 UTC |
Estimate cumulative response rates (CRR) and test their equality between two groups
Description
Estimate cumulative response rates (CRR) and test their equality between two groups
Usage
CRR(
t2PROGRESSION,
STATUS_PROGRESSION,
t2RESPONSE,
STATUS_RESPONSE,
TRT,
time = NULL,
alpha = 0.95
)
Arguments
t2PROGRESSION |
time to progression/death or censoring |
STATUS_PROGRESSION |
binary indicator for progression status: 1 for progression/death; 0 for censoring |
t2RESPONSE |
time to response or censoring |
STATUS_RESPONSE |
binary indicator for response status: 1 for response; 0 for censoring |
TRT |
binary indicator for treatment assignment: 1 for treatment arm and 0 for control arm |
time |
user-selected time points at which the cumulative response rate is to be estimated; the default value is "NULL" and the cumulative response rate will be estimated at all observed time points |
alpha |
coverage level of the point-wise confidence interval for the cumulative response rate; the default value is 0.95 |
Value
A list with following elements
result0: a data matrix containing "time", "CRR estimates (group 0)", "standard error of CRR estimates (group 0)", "confidence interval of CRR (group 0)"
result1: a data matrix containing "time", "CRR estimates (group 1)", "standard error of CRR estimates (group 1)", "confidence interval of CRR (group 1)"
pvalue: the p-value from two group comparison
References
Gray, RJ. (1988) A class of K-sample tests for comparing the cumulative incidence of a competing risk, ANNALS OF STATISTICS, 16:1141-1154.
Aalen, O. (1978) Nonparametric estimation of partial transition probabilities in multiple decrement models, ANNALS OF STATISTICS, 6:534-545.
Examples
library(cmprsk)
n=100
set.seed(10)
# Generate the data
trt=rbinom(n, 1, 0.5)
error=rnorm(n)
tr=exp(rnorm(n)+error-trt*0.5+0.5)
tp=exp(rnorm(n)+error+trt*0.25)
tr[tp<tr]=Inf
tc=runif(n, 3, 8.5)
t2response=pmin(tr, tc)
delta_response=1*(tr<tc)
t2progression=pmin(tp, tc)
delta_progression=1*(tp<tc)
# Estimate the PBIR in two groups
fit=CRR(t2PROGRESSION=t2progression,
STATUS_PROGRESSION=delta_progression,
t2RESPONSE=t2response,
STATUS_RESPONSE=delta_response,
TRT=trt)
fit
# Plot the estimated PBIR by group
tt1=c(0, fit$result1$time)
CRR1=c(0, fit$result1$CRR)
B1=length(tt1)
tt1=rep(tt1, rep(2, B1))[-1]
CRR1=rep(CRR1, rep(2, B1))[-(2*B1)]
tt0=c(0, fit$result0$time)
CRR0=c(0, fit$result0$CRR)
B0=length(tt0)
tt0=rep(tt0, rep(2, B0))[-1]
CRR0=rep(CRR0, rep(2, B0))[-(2*B0)]
plot(range(c(fit$result1$time, fit$result0$time)),
range(c(fit$result1$CRR, fit$result0$CRR)),
xlab="time", ylab="CRR",
main="black: group 0; red: group 1", type="n")
lines(tt0, CRR0, col=1)
lines(tt1, CRR1, col=2)
Estimate the PBIR curve over a time window
Description
Estimate the PBIR curve over a time window
Usage
PBIR1(
t2PROGRESSION,
STATUS_PROGRESSION,
t2RESPONSE,
STATUS_RESPONSE,
time = NULL,
alpha = 0.95
)
Arguments
t2PROGRESSION |
time to progression/death or censoring |
STATUS_PROGRESSION |
binary indicator for progression status: 1 for progression/death; 0 for censoring |
t2RESPONSE |
time to response or censoring |
STATUS_RESPONSE |
binary indicator for response status: 1 for response; 0 for censoring |
time |
user-selected time points at which the PBIR is estimated; the default value is "NULL" and the PBIR will be estimated at all observed time points |
alpha |
coverage level of the point-wise confidence interval for PBIR curve; the default value is 0.95 |
Value
a data matrix containing "time", "PBIR estimates", "standard errors of PBIR estimates", "confidence intervals of the PBIR"
References
Huang, B., Tian, L., Talukder, E., Rothenberg, M., Kim, DY., and Wei, LJ. (2018) Evaluating Treatment Effect Based on Duration of Response for a Comparative Oncology Study. JAMA Oncol, doi: 10.1001/jamaoncol.2018.0275
Huang, B., Tian, L., McCaw, Z., Luo, Talukder, E., X., Rothenberg, M., Xie, W., Choueiri, T., Kim, DY., & Wei, LJ. (2020). Analysis of Response Data for Assessing Treatment Effects in Comparative Clinical Studies. Ann Intern Med, doi: 10.7326/M20-0104.
Examples
library(survival)
n=100
set.seed(10)
# Generate the data
trt=rbinom(n, 1, 0.5)
error=rnorm(n)
tr=exp(rnorm(n)+error-trt*0.5+0.5)
tp=exp(rnorm(n)+error+trt*0.25)
tr[tp<tr]=Inf
tc=runif(n, 3, 8.5)
t2response=pmin(tr, tc)
delta_response=1*(tr<tc)
t2progression=pmin(tp, tc)
delta_progression=1*(tp<tc)
# Estimate the PBIR in two groups
fit1=PBIR1(t2PROGRESSION=t2progression[trt==1],
STATUS_PROGRESSION=delta_progression[trt==1],
t2RESPONSE=t2response[trt==1],
STATUS_RESPONSE=delta_response[trt==1])
fit0=PBIR1(t2PROGRESSION=t2progression[trt==0],
STATUS_PROGRESSION=delta_progression[trt==0],
t2RESPONSE=t2response[trt==0],
STATUS_RESPONSE=delta_response[trt==0])
# Plot the estimated PBIR by group
tt1=c(0, fit1$time)
PBIR1=c(0, fit1$PBIR)
B1=length(tt1)
tt1=rep(tt1, rep(2, B1))[-1]
PBIR1=rep(PBIR1, rep(2, B1))[-(2*B1)]
tt0=c(0, fit0$time)
PBIR0=c(0, fit0$PBIR)
B0=length(tt0)
tt0=rep(tt0, rep(2, B0))[-1]
PBIR0=rep(PBIR0, rep(2, B0))[-(2*B0)]
plot(range(c(fit1$time, fit0$time)), range(c(fit1$PBIR, fit0$PBIR)),
xlab="time", ylab="PBIR",
main="black: group 0; red: group 1", type="n")
lines(tt0, PBIR0, col=1)
lines(tt1, PBIR1, col=2)
Estimate and compare PBIR curves from two groups over a time window
Description
Estimate and compare PBIR curves from two groups over a time window
Usage
PBIR2(
t2PROGRESSION,
STATUS_PROGRESSION,
t2RESPONSE,
STATUS_RESPONSE,
TRT,
time = NULL,
alpha = 0.95
)
Arguments
t2PROGRESSION |
time to progression/death or censoring |
STATUS_PROGRESSION |
binary indicator for progression status: 1 for progression/death; 0 for censoring |
t2RESPONSE |
time to response or censoring |
STATUS_RESPONSE |
binary indicator for response status: 1 for response; 0 for censoring |
TRT |
treatment indicator: 1 for treatment arm; 0 for control arm |
time |
user-selected time points at which PBIRs are to be compared; the default value is "NULL" and PBIRs at all observed time points are compared |
alpha |
coverage level of the point-wise confidence interval for the difference in the PBIR, the default value is 0.95 |
Value
a data matrix containing "time", "estimated differences in PBIR (treatment-control)", "standard errors of estimated PBIR differences", "confidence intervals of the PBIR difference"
References
Huang, B., Tian, L., Talukder, E., Rothenberg, M., Kim, DY., and Wei, LJ. (2018) Evaluating Treatment Effect Based on Duration of Response for a Comparative Oncology Study. JAMA Oncol, doi: 10.1001/jamaoncol.2018.0275
Huang, B., Tian, L., McCaw, Z., Luo, Talukder, E., X., Rothenberg, M., Xie, W., Choueiri, T., Kim, DY., & Wei, LJ. (2020). Analysis of Response Data for Assessing Treatment Effects in Comparative Clinical Studies. Ann Intern Med, doi: 10.7326/M20-0104.
Examples
library(survival)
n=100
set.seed(10)
# Generate the data
TRT=trt=rbinom(n, 1, 0.5)
error=rnorm(n)
tr=exp(rnorm(n)+error-trt*0.5+0.5)
tp=exp(rnorm(n)+error+trt*0.25)
tr[tp<tr]=Inf
tc=runif(n, 3, 8.5)
t2response=pmin(tr, tc)
delta_response=1*(tr<tc)
t2progression=pmin(tp, tc)
delta_progression=1*(tp<tc)
# Estimate the difference in PBIR
# the analysis is truncated at time 8, which is slightly smaller than the largest follow-up time
fit=PBIR2(t2PROGRESSION=t2progression,
STATUS_PROGRESSION=delta_progression,
t2RESPONSE=t2response,
STATUS_RESPONSE=delta_response,
TRT=trt)
# Plot the estimated differnece in PBIR
tt=fit$time
diff=fit$diff
low=fit$ci.low
up=fit$ci.up
tt=c(0, tt)
diff=c(0, diff)
low=c(0, low)
up=c(0, up)
B=length(tt)
tt=rep(tt, rep(2, B))[-1]
diff=rep(diff, rep(2, B))[-(2*B)]
low=rep(low, rep(2, B))[-(2*B)]
up=rep(up, rep(2, B))[-(2*B)]
plot(range(c(fit$time, 0)), range(c(low, up)),
xlab="time", ylab="difference in PBIR",
lwd=2, type="n")
lines(tt, diff, lwd=2, col=3)
lines(tt, low, col=2)
lines(tt, up, col=2)
lines(range(fit$time), rep(0, 2), col=4, lty=4)
Estimate mean duration of response
Description
Estimate mean duration of response
Usage
mduration(
t2PROGRESSION,
STATUS_PROGRESSION,
t2RESPONSE,
STATUS_RESPONSE,
time.max = -1
)
Arguments
t2PROGRESSION |
time to progression/death or censoring |
STATUS_PROGRESSION |
binary indicator for progression/death status: 1 for progression/death; 0 for censoring |
t2RESPONSE |
time to response or censoring |
STATUS_RESPONSE |
binary indicator for response status: 1 for response; 0 for censoring |
time.max |
maximum time point, up to which the mean DOR is to be estimated; the default value corresponds to the maximum time window in which the mean DOR is estimable |
Details
The mean duration of response restricted within a time window is also the area under the PBIR curve over the same time window. The estimated mean duration can be viewed as a global summary of the PBIR curve. One may compare the mean duration of response between two groups, which is also a global comparison between two PBIR curves.
Value
A list with following elements
meandor.est: the restricted mean DOR estimate
meandor.se: the standard error of the esimated DOR
time.truncation: the truncation time point used in DOR.
References
Huang, B., Tian, L., Talukder, E., Rothenberg, M., Kim, DY., and Wei, LJ. (2018) Evaluating Treatment Effect Based on Duration of Response for a Comparative Oncology Study. JAMA Oncol, doi: 10.1001/jamaoncol.2018.0275
Huang, B., Tian, L., McCaw, Z., Luo, Talukder, E., X., Rothenberg, M., Xie, W., Choueiri, T., Kim, DY., & Wei, LJ. (2020). Analysis of Response Data for Assessing Treatment Effects in Comparative Clinical Studies. Ann Intern Med, doi: 10.7326/M20-0104.
Examples
library(survival)
n=100
set.seed(10)
# Generate the data
error=rnorm(n)
tr=exp(rnorm(n)+error+0.5)
tp=exp(rnorm(n)+error)
tr[tp<tr]=Inf
tc=runif(n, 3, 8.5)
t2response=pmin(tr, tc)
delta_response=1*(tr<tc)
t2progression=pmin(tp, tc)
delta_progression=1*(tp<tc)
# Estimate the mean duration of response (point estimator and its standard error)
fit=mduration(t2PROGRESSION=t2progression,
STATUS_PROGRESSION=delta_progression,
t2RESPONSE=t2response,
STATUS_RESPONSE=delta_response,
time.max=8)
fit