Clinical priorities
guide the comparison.

Analyze death and nonfatal events together, with their clinical importance built into the method.

The principle

Compare survival first

A hospitalization does not automatically outweigh a longer life.

Illustrative prioritized comparison Patient A has hospitalizations at months 3 and 6 and is alive at month 12. Patient B has a hospitalization at month 5 and dies at month 8. A wins on survival, regardless of the additional hospitalization. 04812Follow-up (months) AB Alive at 12 monthsDeath
Hospitalization End of follow-up
A wins on survivalNo further comparison is needed.
Illustrative pair, not study data. When survival does not decide the comparison, the nonfatal outcome is considered under the chosen win rule.
In practice
HF-ACTION · recurrent events
# Load the included trial subset
library(WR)
dat <- hfaction_cpx9

# Stratify by age
fit <- WRrec(
  ID = dat$patid,
  time = dat$time,
  status = dat$status,
  trt = dat$trt_ab,
  strata = dat$age60
)
print(fit)
The default is the last-event-assisted win ratio.

This example compares exercise training with usual care in the included high-risk HF-ACTION subset, stratified by age. See the full analysis ↗

Choose your analysis

Compare groups

Test treatment differences using death and possibly recurrent nonfatal events, with optional stratification.

WRrec()
Two-sample vignette

Adjust for covariates

Fit proportional win-fractions regression models, including stratified models, and examine standardized score processes.

pwreg() · score.proc()
Regression vignette

Plan a study

Calculate sample size for the standard win ratio test using outcome assumptions, accrual, follow-up, and target power.

WRSS()
Sample size vignette
A useful distinction

WRrec() can use recurrent nonfatal events. Standard pwreg() uses the first nonfatal event. Choose the analysis to match the scientific question.

Get started

Install WR

Install WR from CRAN, then try the included HF-ACTION data.

install.packages("WR")
library(WR)
CRAN release 1.0R ≥ 3.5.0GPL ≥ 2
Data structure

Prepare data in long format

Use one row per event or censoring record, with a patient identifier and event time.

0
Censoring
1
Death
2
Nonfatal event
Follow the full worked example ↗
Go deeper

Documentation and papers

Read the assumptions, understand the data structure, and find the right functions for your study.

Using WR in your research?

Run citation("WR") for your installed version, and cite the methodological work relevant to your analysis.

Citation details