--- title: "Two-sample win ratio tests of possibly recurrent event and death" author: "Lu Mao (lmao@biostat.wisc.edu)" output: rmarkdown::html_vignette vignette: > %\VignetteIndexEntry{Two-sample win ratio tests of recurrent event and death} %\VignetteEngine{knitr::rmarkdown} \usepackage[utf8]{inputenc} --- ```{r, include = FALSE} knitr::opts_chunk$set( collapse = TRUE, comment = "#>" ) ``` ## INTRODUCTION This vignette demonstrates the use of the `WR` package for two-sample win ratio tests of recurrent event and death (Mao et al., 2022). ### Data Let $D$ denote the survival time and write $N_D(t)=I(D\leq t)$. Likewise, let $T_1t, T_1^{(1-a)}t, N_H^{(a)}(t)t, N_H^{(a)}(t)=N_H^{(1-a)}(t)=\mbox{ some } k, T_k^{(1-a)}s, T^{(1)}_{1}>t_1, T^{(1)}_{2}>t_2, \ldots)> {P}(D^{(0)}>s, T^{(0)}_{1}>t_1, T^{(0)}_{2}>t_2, \ldots), \end{equation} for all $0\leq t_1\leq t_2\leq\cdots\leq s\leq\tau$. Expression (2) means that the treatment stochastically delays all events, fatal and nonfatal, jointly as compared to the control. Hence, when (2) is true, the LWR test rejects $H_0$ with probability tending to 1 as the sample size increases to infinity. ## BASIC SYNTAX The basic function to perform the win ratio tests is `WRrec()`. To use the function, the input data must be in the "long" format. Specifically, we need an `ID` variable containing the unique patient identifiers, a `time` variable containing the event times, a `status` variable labeling the event type (`status=2` for recurrent non-fatal event, `=1` for death, and `=0` for censoring), and, finally, a binary `trt` variable with 1 indicating the treatment and 0 indicating the control. To perform an unstratified LWR test, use ```{r,eval=F} obj<-WRrec(ID,time,status,trt) ``` For a stratified test, supply a vector of stratifying (categorical) variable through an additional `strata=` argument. To get test results from FWR and NWR as well, add the option `naive=TRUE`. Printing the object `obj` gives us the $p$-values of the tests as well as some descriptive statistics. ## AN EXAMPLE WITH THE HF-ACTION TRIAL ### Data description To illustrate the win ratio tests, consider the Heart Failure: A Controlled Trial Investigating Outcomes of Exercise Training (HF-ACTION) trial. A randomized controlled trial, HF-ACTION was conducted on a cohort of over two thousand heart failure patients recruited between 2003--2007 across the USA, Canada, and France (O'Connor et al., 2009). The study aimed to assess the effect of adding aerobic exercise training to usual care on the patient's composite endpoint of all-cause death and all-cause hospitalization. The primary analysis of the whole study population showed a moderate and non-significant reduction in the risk of time to the first composite event (hazard ratio 0.93; $p$-value 0.13). Here we focus on a subgroup of non-ischemic patients with reduced cardio-pulmonary exercise (CPX) test duration (i.e., $\leq 9$ minutes before reporting of discomfort). There are scientific and empirical evidence suggesting that this particular sub-population may benefit more from exercise training interventions than does the average heart failure patient. The associated dataset `hfaction_cpx9` is contained in the `WR` package and can be loaded by ```{r setup} library(WR) head(hfaction_cpx9) ``` The dataset is already in a format suitable for `WRrec()` (`status`= 2 for hospitalization and = 1 for death). The `time` variable is in units of months and `trt=0` for usual care (control) and `1` for exercise training. The `age60` variable is an indicator of patient age being greater than or equal to 60 years and can potentially serve as a stratifying variable. ### Win ratio tests on recurrent event and death To perform the win ratio tests between exercise training and usual care stratified by age, use the code ```{r} ## simplify the dataset name dat<-hfaction_cpx9 ## comparing exercise training to usual care by LWR, FWR, and NWR obj<-WRrec(ID=dat$patid,time=dat$time,status=dat$status, trt=dat$trt_ab,strata=dat$age60,naive=TRUE) ## print the results obj ``` We can see from the output above that 57 (25.8\%) out of 221 patients died in usual care, with an average of $571/221=2.6$ hospitalizations per patient; and that 36 (17.6\%) out of 205 patients died in exercise training with an average of $451/205=2.2$ hospitalizations per patient. Clearly, those undergoing exercise training are doing much better in terms of both overall survival and recurrent hospitalization. Following the descriptive statistics are the analysis results by the LWR, FWR, and NWR. Although estimates of overall win and loss probabilities, as well as the win ratio, are provided, their magnitudes are generally dependent on the censoring distribution and should thus be interpreted with caution. On the other hand, the $p$-values are from valid tests of the null and alternative hypotheses discussed in the earlier section. We can see that all three tests yield $p$-values less than the conventional threshold 0.05, suggesting that exercise training significantly reduces mortality and recurrent hospitalization. ### Comparison with standard win ratio To compare with the SWR, we first create a dataset where only the first hospitalization is retained. ```{r} ###################################### ## Remove recurrent hospitalization ## ###################################### ## sort dataset by patid and time o<-order(dat$patid,dat$time) dat<-dat[o,] ## retain only the first hospitalization datHF<-dat[!duplicated(dat[c("patid","status")]),] head(datHF) ``` Then we perform the SWR test by applying the same procedure for the LWR to the reduced dataset (which in this case is equivalent to the SWR). ```{r} ## Perform the standard win ratio test objSWR<-WRrec(ID=datHF$patid,time=datHF$time,status=datHF$status, trt=datHF$trt_ab,strata=datHF$age60) ## print the results objSWR ``` We can see that the test result is only borderline significant, possibly due to less efficient use of the recurrent-event data. ## References * Dong, G., Qiu, J., Wang, D., & Vandemeulebroecke, M. (2018). The stratified win ratio. *Journal of Biopharmaceutical Statistics*, 28, 778--796. * Mao, L., Kim, K., & Li, Y. (2022). On recurrent-event win ratio. *Statistical Methods in Medical Research*, under review. * 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". *Journal of the American Medical Association*, 301, 1439--1450. * Pocock, S., Ariti, C., Collier, T., and Wang, D. (2012). The win ratio: a new approach to the analysis of composite endpoints in clinical trials based on clinical priorities. *European Heart Journal*, 33, 176--182.