Title: | Restricted Mean Time in Favor of Treatment |
---|---|
Description: | Contains inferential and graphical routines for comparing two treatment arms in terms of the restricted mean time in favor of treatment. |
Authors: | Lu Mao |
Maintainer: | Lu Mao <[email protected]> |
License: | CC BY 4.0 |
Version: | 1.0 |
Built: | 2025-03-01 05:06:23 UTC |
Source: | https://github.com/lmaowisc/rmt |
Construct the bouquet plot based on the estimated stage-wise restricted mean win/loss times.
bouquet( x, Kmax = NULL, xlim = NULL, ylim = NULL, xlab = "Restricted mean win/loss time", ylab = "Follow-up time", group.label = TRUE, cex.group = 1, ... )
bouquet( x, Kmax = NULL, xlim = NULL, ylim = NULL, xlab = "Restricted mean win/loss time", ylab = "Follow-up time", group.label = TRUE, cex.group = 1, ... )
x |
An object returned by |
Kmax |
A positive integer; If specified, the stage-wise estimates over
|
xlim |
The x limits of the plot. |
ylim |
The y limits of the plot. |
xlab |
A label for the x axis, defaults to a description of x. |
ylab |
A label for the y axis, defaults to a description of x. |
group.label |
If |
cex.group |
Font size of the group labels if |
... |
Other arguments that can be passed to the underlying |
No return value, called for side effects.
rmtfit
, summary.rmtfit
,
plot.rmtfit
.
# load the colon cancer trial data library(rmt) head(colon_lev) # fit the data obj=rmtfit(ms(id,time,status)~rx,data=colon_lev) # bouquet plot bouquet(obj)
# load the colon cancer trial data library(rmt) head(colon_lev) # fit the data obj=rmtfit(ms(id,time,status)~rx,data=colon_lev) # bouquet plot bouquet(obj)
A landmark colon cancer trial on the efficacy of levamisole and fluorouracil was reported by Moertel et al. (1990). The trial recruited 929 patients with stage C disease and randomly assigned them to levamisole treatment alone, levamisole combined with fluorouracil, and the control. The dataset here is restricted to the comparison between the combined treatment and control groups, consisting of 304 and 314 patients, respectively.
colon_lev
colon_lev
A data frame with 915 rows and 6 variables:
Unique patient ID.
Event time (years).
Event type; 1 = cancer relapse, 2 = death.
"Lev+5FU" = combined treatment, "Control" = control.
Patient age (years) at randomization.
0 = female, 1 = male.
MOERTEL, C. G., FLEMING, T. R., MACDONALD, J. S., HALLER, D. G., LAURIE, J. A., GOODMAN, P. J., UNGERLEIDER, J. S., EMERSON, W. A., TORMEY, D. C., GLICK, J. H. et al. (1990). Levamisole and fluorouracil for adjuvant therapy of resected colon carcinoma. New Engl. J. Med. 322, 352–358.
Over two thousand heart failure patients across the USA, Canada, and France participated in the Heart Failure: A Controlled Trial Investigating Outcomes of Exercise Training (HF-ACTION) between 2003–2007 (O'Connor et al., 2009). The primary objective of the trial was to evaluate the effect of adding exercise training to the usual patient care on the composite endpoint of all-cause hospitalization and death. The dataset here contains a subgroup of 426 non-ischemic patients with baseline cardio-pulmonary exercise test less than or equal to nine minutes.
hfaction
hfaction
A data frame with 1,448 rows and 5 variables:
Unique patient ID.
Event time (years).
Event type; 1 = hospitalization, 2 = death.
1 = exercise training, 0 = usual care.
1 = 60 years or older, 0 = otherwise.
O'CONNOR, C. M., WHELLAN, D. J., LEE, K. L., KETEYIAN, S. J., COOPER, L. S., ELLIS, S. J., LEIFER, E. S., KRAUS, W. E., KITZMAN, D. W., BLUMENTHAL, J. A. et al. (2009). Efficacy and safety of exercise training in patients with chronic heart failure: Hf-action randomized controlled trial. J. Am. Med. Assoc. 301, 1439–1450.
Create a multistate event object
ms(id, time, status)
ms(id, time, status)
id |
A vector of id variable. |
time |
A vector of follow-up times. |
status |
A vector of event type, |
An object of class ms
used as an argument for rmtfit
.
Plot the estimated overall or stage-wise restricted mean times in favor of treatment as a function of follow-up time.
## S3 method for class 'rmtfit' plot( x, k = NULL, conf = FALSE, main = NULL, xlim = NULL, ylim = NULL, xlab = "Follow-up time", ylab = "Restricted mean time in favor", conf.col = "black", conf.lty = 3, ... )
## S3 method for class 'rmtfit' plot( x, k = NULL, conf = FALSE, main = NULL, xlim = NULL, ylim = NULL, xlab = "Follow-up time", ylab = "Restricted mean time in favor", conf.col = "black", conf.lty = 3, ... )
x |
An object returned by |
k |
If specified, |
conf |
If TRUE, 95% confidence limits for the target curve are overlaid. |
main |
A main title for the plot |
xlim |
The x limits of the plot. |
ylim |
The y limits of the plot. |
xlab |
A label for the x axis, defaults to a description of x. |
ylab |
A label for the y axis, defaults to a description of y. |
conf.col |
Color for the confidence limits if |
conf.lty |
Line type for the confidence limits if |
... |
Other arguments that can be passed to the underlying |
No return value, called for side effects.
rmtfit
, summary.rmtfit
, bouquet
.
# load the colon cancer trial data library(rmt) head(colon_lev) # fit the data obj=rmtfit(ms(id,time,status)~rx,data=colon_lev) # plot overal effect mu(tau) plot(obj) # set-up plot parameters oldpar <- par(mfrow = par("mfrow")) par(mfrow=c(1,2)) # Plot of component-wise RMT in favor of treatment over time plot(obj,k=2,conf=TRUE,col='red',conf.col='blue', xlab="Follow-up time (years)", ylab="RMT in favor of treatment (years)",main="Survival") plot(obj,k=1,conf=TRUE,col='red',conf.col='blue', xlab="Follow-up time (years)", ylab="RMT in favor of treatment (years)",main="Pre-relapse") par(oldpar)
# load the colon cancer trial data library(rmt) head(colon_lev) # fit the data obj=rmtfit(ms(id,time,status)~rx,data=colon_lev) # plot overal effect mu(tau) plot(obj) # set-up plot parameters oldpar <- par(mfrow = par("mfrow")) par(mfrow=c(1,2)) # Plot of component-wise RMT in favor of treatment over time plot(obj,k=2,conf=TRUE,col='red',conf.col='blue', xlab="Follow-up time (years)", ylab="RMT in favor of treatment (years)",main="Survival") plot(obj,k=1,conf=TRUE,col='red',conf.col='blue', xlab="Follow-up time (years)", ylab="RMT in favor of treatment (years)",main="Pre-relapse") par(oldpar)
Print the results for the restricted mean times in favor of treatment.
## S3 method for class 'rmtfit' print(x, ...)
## S3 method for class 'rmtfit' print(x, ...)
x |
An object returned by |
... |
Further arguments passed to or from other methods |
No return value, called for side effects.
Produces a printed summary of the results for the restricted mean times in favor of treatment
## S3 method for class 'summary.rmtfit' print(x, ...)
## S3 method for class 'summary.rmtfit' print(x, ...)
x |
An object returned by |
... |
Further arguments passed to or from other methods |
No return value, called for side effects.
Create a recurrent event object
rec(id, time, status)
rec(id, time, status)
id |
A vector of id variable. |
time |
A vector of follow-up times. |
status |
A vector of event type, 1 = recurrent event, 2 = death, and 0 = censoring; |
An object of class rec
used as an argument for rmtfit
.
Estimate and make inference on the overall and component-wise restricted mean times in favor of treatment.
rmtfit(...) ## Default S3 method: rmtfit(id, time, status, trt, type = "multistate", ...) ## S3 method for class 'formula' rmtfit(formula, data, ...)
rmtfit(...) ## Default S3 method: rmtfit(id, time, status, trt, type = "multistate", ...) ## S3 method for class 'formula' rmtfit(formula, data, ...)
... |
Further arguments. |
id |
A vector of id variable. |
time |
A vector of follow-up times. |
status |
For |
trt |
A vector of binary variable for treatment group. |
type |
|
formula |
A formula object. For multistate data, use |
data |
A data frame, which contains the variables names in the formula. |
An object of class rmtfit
. See rmtfit.object
for details.
rmtfit(default)
: Default
rmtfit(formula)
: Formula
rmtfit.object
,
summary.rmtfit
, plot.rmtfit
, bouquet
.
####################### # Multistate outcome # ####################### # load the colon cancer trial data library(rmt) head(colon_lev) # fit the data obj=rmtfit(ms(id,time,status)~rx,data=colon_lev) # print the event numbers by group obj # summarize the inference results for tau=7.5 years summary(obj,tau=7.5) ############################ # Recurrent event outcome # ############################ # load the HF-ACTION trial data library(rmt) head(hfaction) # fit the data obj=rmtfit(rec(patid,time,status)~trt_ab,data=hfaction) # print the event numbers by group obj # summarize the inference results for tau=3.5 years summary(obj,tau=3.5,Kmax=4) # aggregating results for recurrent-event # frequency >=4.
####################### # Multistate outcome # ####################### # load the colon cancer trial data library(rmt) head(colon_lev) # fit the data obj=rmtfit(ms(id,time,status)~rx,data=colon_lev) # print the event numbers by group obj # summarize the inference results for tau=7.5 years summary(obj,tau=7.5) ############################ # Recurrent event outcome # ############################ # load the HF-ACTION trial data library(rmt) head(hfaction) # fit the data obj=rmtfit(rec(patid,time,status)~trt_ab,data=hfaction) # print the event numbers by group obj # summarize the inference results for tau=3.5 years summary(obj,tau=3.5,Kmax=4) # aggregating results for recurrent-event # frequency >=4.
This class of objects is returned by the rmtfit
class of functions.
Objects of this class have methods for the functions print
,
summary
, plot
, and bouquet
.
t |
A vector of follow-up times |
mu |
A matrix with |
var |
A matrix with |
mu10 , mu01
|
Matrices with |
... |
rmtfit
, summary.rmtfit
, plot.rmtfit
, bouquet
.
Summarize the overall and stage-wise inferential results for the restricted mean times in favor of treatment at a user-specified length of follow-up.
## S3 method for class 'rmtfit' summary(object, tau = NULL, Kmax = NULL, ...)
## S3 method for class 'rmtfit' summary(object, tau = NULL, Kmax = NULL, ...)
object |
An object returned by |
tau |
A positive real number for the follow-up time; Default is the maximum event time in the data. |
Kmax |
A positive integer; If specified, the stage-wise estimates over
|
... |
Additional arguments affecting the summary produced. |
An object of class summary.rmtfit
with components
WL |
A |
tab |
A |
... |
#See examples for rmtfit().
#See examples for rmtfit().