Title: | Flexible and Coherent Test/Estimation Procedure Based on Restricted Mean Survival Times |
---|---|
Description: | Estimates the restricted mean survival time (RMST) with the time window [0, tau], where tau is adaptively selected from the procedure, proposed by Horiguchi et al. (2018) <doi:10.1002/sim.7661>. It also estimates the RMST with the time window [tau1, tau2], where tau1 is adaptively selected from the procedure, proposed by Horiguchi et al. (2023) <doi:10.1002/sim.9662>. |
Authors: | Miki Horiguchi [aut, cre]
|
Maintainer: | Miki Horiguchi <[email protected]> |
License: | GPL-2 |
Version: | 1.1.0 |
Built: | 2025-02-15 02:38:24 UTC |
Source: | https://github.com/cran/survRM2adapt |
Estimates the restricted mean survival time (RMST) with a time window [0, tau], where tau is selected during the procedure from among the time points provided by the user. It also estimates the RMST with a time window [tau1, tau2], where tau1 is selected during the procedure, same as above.
Miki Horiguchi, Lu Tian, Hajime Uno
Maintainer: Miki Horiguchi <[email protected]>
Horiguchi M, Cronin A, Takeuchi M, Uno H. A flexible and coherent test/estimation procedure based on restricted mean survival times for censored time-to-event data in randomized clinical trials. Statistics in Medicine 2018. DOI:10.1002/sim.7661.
Horiguchi M, Tian L, Uno H. On assessing survival benefit of immunotherapy using long-term restricted mean survival time. Statistics in Medicine 2023. DOI:10.1002/sim.9662.
survival survRM2
#--- Adaptive RMST test/estimation method by rmst2adapt() ---# data = rmst2adapt.sample.data() nmethod = 100 #This is only for example use. #Recommended to specify at least 100000 (default) or larger. a = rmst2adapt(indata=data, tau_star=seq(6,12,2), method="perturbation", nmethod=nmethod, test="2_side", seed=123) print(a) #--- Adaptive long-term RMST test/estimation method by ltrmst2adapt() ---# data = cm214_pfs b = ltrmst2adapt(indata=data, tau1=c(0,1,2,3), tau2=10, test="2_side", seed=123) print(b)
#--- Adaptive RMST test/estimation method by rmst2adapt() ---# data = rmst2adapt.sample.data() nmethod = 100 #This is only for example use. #Recommended to specify at least 100000 (default) or larger. a = rmst2adapt(indata=data, tau_star=seq(6,12,2), method="perturbation", nmethod=nmethod, test="2_side", seed=123) print(a) #--- Adaptive long-term RMST test/estimation method by ltrmst2adapt() ---# data = cm214_pfs b = ltrmst2adapt(indata=data, tau1=c(0,1,2,3), tau2=10, test="2_side", seed=123) print(b)
The progression-free survival data reconstructed from the publication of the CheckMate214 study.
data(cm214_pfs)
data(cm214_pfs)
A dataset containing 3 columns:
the time-to-event variable (the time unit is month)
the event indicator (1=event, 0=censor)
the treatment indicator (1=treatment, 0=control)
This is a reconstructed patient-level data from the results reported by Motzer et al.(2018) <doi:10.1056/NEJMoa1712126>. The data consists of 847 patients with previously untreated clear-cell advanced renal-cell carcinoma; 425 for the nivolumab plus ipilimumab group (treatment) and 422 for the sunitinib group (control).
Motzer RJ, Tannir NM, McDermott DF, et al. Nivolumab plus ipilimumab versus sunitinib in advanced renal-cell carcinoma. New England Journal of Medicine. 2018;378(14):1277-1290. <doi:10.1056/NEJMoa1712126> Guyot P, Ades AE, Ouwens MJ, Welton NJ. Enhanced secondary analysis of survival data: reconstructing the data from published Kaplan-Meier survival curves. BMC Med Res Methodol. 2012;12(1):9. <doi:10.1186/1471-2288-12-9>
This function performs the method proposed by Horiguchi, Tian, and Uno. (2023) <doi:10.1002/sim.9662>. Specifically, it estimates the restricted mean survival time (RMST) within a prespecified time window (from tau1 to tau2) to quantify the long-term treatment benefit. Instead of choosing one specific time point as the lower end of the time window (tau1), the procedure allows users to prespecify a set of time points. The procedure picks one time point among the set of tau1 values that gives the most significant difference in the long-term RMST between the two groups. It then performs testing for equality of the long-term RMSTs between the two groups and estimates the difference in RMST within the adaptively selected time window [tau1, tau2] between the two groups. Multiplicity as a result of specifying several values for tau1 is taken into account in this procedure.
ltrmst2adapt(indata, tau1, tau2, iteration=50000, seed=NULL, test="2_side", conf.int=0.95)
ltrmst2adapt(indata, tau1, tau2, iteration=50000, seed=NULL, test="2_side", conf.int=0.95)
indata |
A data matrix (data frame). The 1st column is the time-to-event variable, the 2nd column is the event indicator (1=event, 0=censor), and the 3rd column is the treatment indicator (1=treatment, 0=control). No missing values are allowed in this data matrix. |
tau1 |
An integer value or a vector indicating a set of tau1 values for the lower end of the time window. |
tau2 |
An integer value indicating the upper end of the time window. When tau2 = NULL, the default value is used. See Details for the definition of the default value for tau2. |
iteration |
A number of iterations for the resampling (the multivariate normal distribution-based perturbation method). It is recommended to specify at least 50000 (default) or larger. |
seed |
An integer value used for random number generation in the resampling procedure. Default is |
test |
Specify |
conf.int |
Specify a confidence coefficient for calculating confidence bands for the differences in long-term RMST. Default is |
The definition of the default value for tau2. Let x1 and x0 be the maximum observed time in Group 1 and Group 0, respectively. Case 1: If the last observations in Group 1 and Group 0 are "event," then tau = max(x1, x0). Case 2-1: If the last observation in Group 1 is "event," the last observation in Group 0 is "censor," and x1 <= x0, tau2 = max(x1, x0) = x0. Case 2-2: If the last observation in Group 0 is "event," the last observation in Group 1 is "censor," and x1 > x0, tau2 = max(x1, x0) = x1. Case 3-1: If the last observation in Group 1 is "event," the last observation in Group 0 is "censor," and x1 > x0, tau2 = min(x1, x0) = x0. Case 3-2: If the last observation in Group 0 is "event," the last observation in Group 1 is "censor," and x1 <= x0, tau2 = min(x1, x0) = x1. Case 4: If the last observations in Group 1 and Group 0 are "censor," then tau = min(x1, x0).
an object of class ltrmst2adapt.
iteration |
The number of iterations for resampling from a multivariate normal distribution with a mean 0 and a variance-covariance matrix. |
test |
The type of test used in the analyses |
arm1 |
The RMST [tau1, tau2] estimation for arm1 |
arm0 |
The RMST [tau1, tau2] estimation for arm0 |
diff10 |
The difference in RMST [tau1, tau2] between the two groups (arm1 minus arm0) |
diff10_selected |
The difference in RMST within the selected time window [tau1, tau2] between the two groups (arm1 minus arm0) with the normal confidence interval considering the randomness of selecting one time window. The p-value for the RMST difference test within the selected time window [tau1, tau2] is also provided. |
Miki Horiguchi, Lu Tian, Hajime Uno
Horiguchi M, Tian L, Uno H. On assessing survival benefit of immunotherapy using long-term restricted mean survival time. Statistics in Medicine 2023. DOI:10.1002/sim.9662.
#--- sample data ---# data = cm214_pfs b = ltrmst2adapt(indata=data, tau1=c(0,1,2,3), tau2=10, test="2_side", seed=123) print(b)
#--- sample data ---# data = cm214_pfs b = ltrmst2adapt(indata=data, tau1=c(0,1,2,3), tau2=10, test="2_side", seed=123) print(b)
S3 method for class 'ltrmst2adapt'
## S3 method for class 'ltrmst2adapt' print(x, digits = 3, ...)
## S3 method for class 'ltrmst2adapt' print(x, digits = 3, ...)
x |
Object to be printed |
digits |
Integer indicating the number of decimal places |
... |
Further arguments ignored in this function |
returns summary output for class 'ltrmst2adapt'
S3 method for class 'rmst2adapt'
## S3 method for class 'rmst2adapt' print(x, digits = 3, ...)
## S3 method for class 'rmst2adapt' print(x, digits = 3, ...)
x |
Object to be printed |
digits |
Integer indicating the number of decimal places |
... |
Further arguments ignored in this function |
returns summary output for class 'rmst2adapt'
This function performs the procedure proposed by Horiguchi et al. (2018) <doi:10.1002/sim.7661>. The method specifies a set of truncation time points, taus, for calculating restricted mean survival times (RMST), performs testing for equality of the RMSTs between the two groups, and estimates the difference in RMST between the two groups at the specified tau's. The multiplicity as a result of specifying several taus is taken into account in this procedure.
rmst2adapt(indata, tau_star, method="perturbation", nmethod=100000, seed=NULL, test="2_side", conf.int=0.95)
rmst2adapt(indata, tau_star, method="perturbation", nmethod=100000, seed=NULL, test="2_side", conf.int=0.95)
indata |
A data matrix (data frame). The 1st column is the time-to-event variable, the 2nd column is the event indicator (1=event, 0=censor), and the 3rd column is the treatment indicator (1=treatment, 0=control). No missing values are allowed in this data matrix. |
tau_star |
A vector indicating a set of tau's. All elements in |
method |
A type of the resampling method. It supports |
nmethod |
A number of iterations for resampling. It is recommended to specify at least 100000 (default) or larger. |
seed |
An integer value used for random number generation in the resampling procedures. Default is |
test |
Specify |
conf.int |
Specify a confidence coefficient for calculating confidence bands for the differences in RMST. Default is |
an object of class rmst2adapt.
method |
The resampling method used in the analyses |
nmethod |
The number of iterations for the resampling |
test |
The type of test used in the analyses |
candidate_taus |
The set of taus used in the analyses |
observed_z |
The observed test statistic Z_star |
p_value |
The p-value of testing for equality of the RMSTs between the two groups |
conf_band |
The difference in RMST between the two groups at the specified taus |
selected_tau |
The value of tau selected to summarize the treatment effect |
Miki Horiguchi, Hajime Uno
Horiguchi M, Cronin A, Takeuchi M, Uno H. A flexible and coherent test/estimation procedure based on restricted mean survival times for censored time-to-event data in randomized clinical trials. Statistics in Medicine 2018. doi:10.1002/sim.7661.
#--- sample data ---# data = rmst2adapt.sample.data() nmethod = 100 #This is only for example use. #Recommended to specify at least 100000 (default) or larger. a = rmst2adapt(indata=data, tau_star=seq(6,12,2), method="perturbation", nmethod=nmethod, test="2_side", seed=123) print(a)
#--- sample data ---# data = rmst2adapt.sample.data() nmethod = 100 #This is only for example use. #Recommended to specify at least 100000 (default) or larger. a = rmst2adapt(indata=data, tau_star=seq(6,12,2), method="perturbation", nmethod=nmethod, test="2_side", seed=123) print(a)
This is a function to retrieve 312 randomized patients from the pbc data in survival package.
rmst2adapt.sample.data(t.unit="year")
rmst2adapt.sample.data(t.unit="year")
t.unit |
Specify the time unit. It supports "year" (default), "month", and "day". |
The function creates a sample dataset to illustrate the usage of the function rmst2adapt()
in this package.
The original pbc data in survival
package consists of 418 patients data.
This function loads the pbc data, select the 312 patients who were randomized.
The status variable is edited, so that 1 indicates death and 0 indicates alive.
returns a data frame
pbc
in survival package
D=rmst2adapt.sample.data() head(D)
D=rmst2adapt.sample.data() head(D)