Title: | While-Alive Loss Rate for Recurrent Event in the Presence of Death |
---|---|
Description: | Contains inferential and graphical routines for multi-group analysis of while-alive loss (or event) rate for possibly recurrent nonfatal event in the presence of death. |
Authors: | Lu Mao |
Maintainer: | Lu Mao <[email protected]> |
License: | GPL (>= 2) |
Version: | 1.0 |
Built: | 2025-02-10 03:13:03 UTC |
Source: | https://github.com/cran/WA |
The Heart Failure: A Controlled Trial Investigating Outcomes of Exercise Training (HF-ACTION) study was conducted between 2003–2007 to investigate whether adding exercise training to the usual care of heart failure patients improves their cardiovascular outcomes (O'Conner et al., 2009). This dataset is for a high-risk subgroup consisting of 741 nonischemic patients with baseline cardiopulmonary test duration less than or equal to 12 minutes and analyze recurrent hospitalizations as well as overall survival.
hfaction_cpx12
hfaction_cpx12
A data frame with 2,132 rows and 4 variables:
Unique patient ID.
Event time (years).
Event type; 1 = hospitalization, 2 = death, 0 = censoring.
1 = exercise training, 0 = usual care.
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.
Estimate and make inference on the while-alive loss (or event) rate
across groups under a user-specified loss function
LRfit(id, time, status, trt, Dweight = 0, wH = NULL, wD = NULL)
LRfit(id, time, status, trt, Dweight = 0, wH = NULL, wD = NULL)
id |
A vector of id variable. |
time |
A vector of follow-up times. |
status |
A vector of event type variable; 1 = recurrent event, 2 = death, and 0 = censoring. |
trt |
A vector of categorical (binary or multiclass) variable for treatment group. |
Dweight |
A non-negative weight for death relative to the recurrent event; Default is 0. |
wH |
A function of |
wD |
A function of |
An object of class LRfit
. See LRfit.object
for details.
LRfit.object
,
summary.LRfit
, plot.LRfit
.
# load the HF-ACTION trial data head(hfaction_cpx12) # fit the data dat<-hfaction_cpx12 obj<-LRfit(dat$id,dat$time,dat$status,dat$trt) # print the event numbers by group obj # summarize the inference results for tau=3.5 years # with joint test with RMST summary(obj,tau=3.5,joint.test=TRUE) # plot the estimated survival-completed cumulative loss # by group, with 95% confidence intervals plot(obj,conf=TRUE,xlab="Time (years)",xlim=c(0, 3.5),ylim=c(0,3), ylab="Survival-completed cumulative frequency")
# load the HF-ACTION trial data head(hfaction_cpx12) # fit the data dat<-hfaction_cpx12 obj<-LRfit(dat$id,dat$time,dat$status,dat$trt) # print the event numbers by group obj # summarize the inference results for tau=3.5 years # with joint test with RMST summary(obj,tau=3.5,joint.test=TRUE) # plot the estimated survival-completed cumulative loss # by group, with 95% confidence intervals plot(obj,conf=TRUE,xlab="Time (years)",xlim=c(0, 3.5),ylim=c(0,3), ylab="Survival-completed cumulative frequency")
This class of objects is returned by the LRfit
functions.
Objects of this class have methods for the functions print
,
summary
, and plot
.
All numerical results of an object obj
are contained in obj$content
, which
is organized in a two-dimensional array with each column containing the results
for one group. Below are the row variables.
t |
A vector of follow-up times |
llr |
A vector of log-loss rate estimates at |
se_llr |
A vector of standard error estimates for the log-loss rates
in |
lmuR |
A vector of log-raw cumulative loss estimates at |
se_lmuR |
A vector of standard error estimates for the log-raw
cumulative losses in |
lmuD |
A vector of log-RMST estimates at |
se_lmuD |
A vector of standard error estimates for the log-RMST in |
St |
A vector of overall survival probabilities at |
... |
LRfit
, summary.LRfit
, plot.LRfit
.
Plot the estimated survival-completed cumulative loss (while-alive loss rate times the length of follow-up) as a function of the time horizon.
## S3 method for class 'LRfit' plot( x, group = NULL, conf = FALSE, main = NULL, xlim = NULL, ylim = NULL, xlab = "Follow-up time", ylab = "Survival-completed cumulative loss", group.col = NULL, conf.lty = 3, lwd = 2, legend = TRUE, ... )
## S3 method for class 'LRfit' plot( x, group = NULL, conf = FALSE, main = NULL, xlim = NULL, ylim = NULL, xlab = "Follow-up time", ylab = "Survival-completed cumulative loss", group.col = NULL, conf.lty = 3, lwd = 2, legend = TRUE, ... )
x |
An object returned by |
group |
Specifies the group to be plotted. |
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. |
group.col |
A vector of colors for the group-specific curves; must be commensurate with the number of groups. |
conf.lty |
Line type for the confidence limits if |
lwd |
Line width. |
legend |
If TRUE, a crude legend for the group-specific curves will appear on the bottom right corner of the graph. |
... |
Other arguments that can be passed to the underlying |
No return value, called for side effects.
# load the HF-ACTION trial data head(hfaction_cpx12) # fit the data dat<-hfaction_cpx12 obj<-LRfit(dat$id,dat$time,dat$status,dat$trt) # print the event numbers by group obj # summarize the inference results for tau=3.5 years # with joint test with RMST summary(obj,tau=3.5,joint.test=TRUE) # plot the estimated survival-completed cumulative loss # by group, with 95% confidence intervals plot(obj,conf=TRUE,xlab="Time (years)",xlim=c(0, 3.5),ylim=c(0,3), ylab="Survival-completed cumulative frequency")
# load the HF-ACTION trial data head(hfaction_cpx12) # fit the data dat<-hfaction_cpx12 obj<-LRfit(dat$id,dat$time,dat$status,dat$trt) # print the event numbers by group obj # summarize the inference results for tau=3.5 years # with joint test with RMST summary(obj,tau=3.5,joint.test=TRUE) # plot the estimated survival-completed cumulative loss # by group, with 95% confidence intervals plot(obj,conf=TRUE,xlab="Time (years)",xlim=c(0, 3.5),ylim=c(0,3), ylab="Survival-completed cumulative frequency")
Print the results for the restricted mean times in favor of treatment.
## S3 method for class 'LRfit' print(x, ...)
## S3 method for class 'LRfit' 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 while-alive loss rate
## S3 method for class 'summary.LRfit' print(x, ...)
## S3 method for class 'summary.LRfit' print(x, ...)
x |
An object returned by |
... |
Further arguments passed to or from other methods |
No return value, called for side effects.
Summarize the inferential results for group-specific while-alive loss rates and the loss rate ratios at a user-specified length of follow-up.
## S3 method for class 'LRfit' summary(object, tau = NULL, ref = NULL, joint.test = FALSE, ...)
## S3 method for class 'LRfit' summary(object, tau = NULL, ref = NULL, joint.test = FALSE, ...)
object |
An object returned by |
tau |
A positive real number for the follow-up time; Default is the maximum event time in the data. |
ref |
The label of the group to be set as the reference; Default is the first level by numerical or alphabetical order |
joint.test |
If TRUE, joint analysis with the restricted mean survival time (RMST) will be performed; Default is FALSE. |
... |
Additional arguments affecting the summary produced. |
An object of class summary.LRfit
with components
LRtab |
A |
Rtab |
A |
Dtab |
A |
LRpval |
|
LRDpval |
|
... |
#See examples for LRfit().
#See examples for LRfit().