Compare groups
Test treatment differences using death and possibly recurrent nonfatal events, with optional stratification.
Analyze death and nonfatal events together, with their clinical importance built into the method.
A hospitalization does not automatically outweigh a longer life.
# 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)# Load the regression dataset
library(WR)
dat <- non_ischemic
Z <- as.matrix(dat[, c("trt_ab", "age")])
# Adjust for age
fit <- pwreg(
ID = dat$ID,
time = dat$time,
status = dat$status,
Z = Z
)
print(fit)This example compares exercise training with usual care in the included high-risk HF-ACTION subset, stratified by age. See the full analysis ↗
Test treatment differences using death and possibly recurrent nonfatal events, with optional stratification.
Fit proportional win-fractions regression models, including stratified models, and examine standardized score processes.
Calculate sample size for the standard win ratio test using outcome assumptions, accrual, follow-up, and target power.
WRrec() can use recurrent nonfatal events. Standard pwreg() uses the first nonfatal event. Choose the analysis to match the scientific question.
Install WR from CRAN, then try the included HF-ACTION data.
install.packages("WR")
library(WR)Use one row per event or censoring record, with a patient identifier and event time.
Read the assumptions, understand the data structure, and find the right functions for your study.