*! Version 1.0.3 Sept 26 2022

help winratio

Title

winratio -- calculates the unmatched Win Ratio for prioritised outcomes.

Syntax

winratio idvar trtvar ,
outcomes(list) [
strata(varname)
stweight(weighting method)
pformat(%fmt)
wrformat(%fmt)
saving(filename [, replace])
]

idvar is a unique identifier variable and may be string or numeric.

trtvar must be a binary 0 1 numeric variable, where 0 and 1 indicate the control and intervention groups respectively.

outcomes(list) is a required option which will be repeated for each outcome in the hierarchy (starting with highest through to lowest priority);
list consists of a set of 3 items which provide information about
(i) the outcome variable(s), (ii) the type of outcome and (iii) either the follow-up time variable(s) if the outcome is a time-to-event or a repeated event,
or the direction of comparison (<[#] or >[#]) if the outcome is continuous, ordinal or binary. See options and examples below for more details.

if and by are not allowed.

Description

winratio The win ratio was introduced in 2012 by Pocock et al [1] as a novel approach to the analysis of composite endpoints in randomised clinical trials.
The approach motivated by the Finkelstein–Schoenfeld test [2] takes into account the order of importance of the component events and also allows the components to be different types of outcomes
e.g. time-to-event (failure or success), quantitative outcomes such as quality of life scores and vital signs, repeated events, and more.

Options

outcomes(list) is a required option which will be repeated for each outcome in the hierarchy, starting with the first outcome through to the last outcome;
list consists of 3 items which provide information about each outcome as follows:

The first item in each specifies the outcome variable(s). For binary, ordinal, and continous outcomes this will be the variable name.
In the case of a time-to-event outcome this will be a binary (0/1) variable indicating whether or not the event occurred.
In the case of a repeated event outcome this will be the stub of the names of a set of binary (0/1) variables indicating the repeat events
e.g. hosp if hosp1, hosp2, hosp3 are three binary variables indicating repeat hospitalisations.

The second item in each set will indicate the type of outcome.
This will be c for continuous, ordinal categorical or binary outcomes, tf for time-to-event failure outcomes, ts for
time-to-event success outcomes, and r# for repeat events where # is the maximum number of variables to consider in the analysis of the repeat events.

The third item in each set depends on the type of outcome.
For continuous, ordinal or binary outcomes this will be >[#] or <[#] to indicate the direction of the comparison i.e. whether higher or lower values are better, and where # is the margin of success required for a win;
when # is not specified the default margin is 0.
For time-to-event outcomes this will be the name of the variable containing the follow-up (censoring or event) time.
For repeat events this will be the stub of the names of a set of variables containing follow-up times.

strata(varname) allows computation of the stratified win ratio. varname must be a numeric categorical variable.

stweight(method) allows specification of the weighting method to be used for the stratified win ratio.
method can be unweighted (the default if no weighting option is specified along with strata: test statistics and
variance estimators are simply summed across strata) iv for inverse-variance weights and mh for Mantel-Haenszel (MH) weights (each strata weighted according to the number of patients in the strata).

saving(filename [, replace]) saves a dataset containing the number of wins, losses and ties at each level of the hierarchy and for each strata.

pformat(%fmt) controls the numeric display format for p-values; for example, for a p-value with a leading
0 and 4 decimal places %05.4f.

wrformat(%fmt) controls the numeric display format for the estimated win ratio and confidence intervals.

Examples

The following examples use the dataset win_ratio_example.dta which is provided along with the program files.

Example 1:
Consider a trial with two prioritised outcomes, (i) death and (ii) heart failure hospitalisation, where death is considered to be more important that heart failure hospitalisation.
Death is a time-to-event (failure) outcome with a binary (0/1) variable dth indicating whether the patient died or not and the variable fudth containing the event time or censoring time.
Heart failure hospitalisation is a repeated event with a maximum of 4 repeat events observed.
hf1, hf2, hf3, hf4 are four binary (0/1) variables indicating the event. fuhf1, fuhf2, fuhf3, fuhf4 are four variables containing the event time or censoring time.
For example, if a patient did not experience any hospitalisations for heart failure and was censored at 300 days then hf1-hf4 would each be 0 and fuhf1-fuhf4 would each be 300.
If a patient experienced a heart failure hospitalisation at day 90 and was then censored at day 250 without any further heart failure hospitalisations,
then hf1 would be 1 and fuhf1 would be 90, hf2-hf4 would each contain 0 and fuhf2-fuhf4 would each be 250.
The variable patid is a unique patient identifier and trt is a binary variable indicating the active treatment group.

The command syntax for this analysis would then be:

use win_ratio_example.dta

winratio patid trt , outcomes(dth tf fudth) outcomes(hf r4 fuhf)

Example 2:
Suppose we now add another outcome, quality of life (qol), as the third prioritised outcome in the hierarchy. qol is a continuous variable and higher values are better. The command syntax would then be:

winratio patid trt , outcomes(dth tf fudth) outcomes(hf r4 fuhf) outcomes(qol c >)

Example 3:
Suppose we now require the quality of life score to be more than 0.1 points higher to declare a winner. The command syntax would then be:

winratio patid trt , outcomes(dth tf fudth) outcomes(hf r4 fuhf) outcomes(qol c >0.1)

Notice that there is no gap between > and 0.1. We could also specify >=0.1 for at least 0.1 points higher.

Example 4:
Suppose we now want to repeat the analysis in Example 1 but we also want to stratify by the variable blvar using Mantel-Haenszel weights. The command syntax would then be:

winratio patid trt , outcomes(dth tf fudth) outcomes(hf r4 fuhf) strata(blvar) stweight(mh)

Example 5: Note that binary variables and ordered categorical/discrete variables are dealt with in the same way as continuous variables. For example, suppose we use the (0/1) binary variable qol_bin where 1 indicates a better quality of life the
command syntax would then be:

winratio patid trt , outcomes(dth tf fudth) outcomes(hf r4 fuhf) outcomes(qol_bin c >)

Saved results

winratio stores the following in r():

Scalars

r(p) p-value

r(se_logwr) standard error of log win ratio. The standard error of the win ratio is calculated using the method described at the end of the Supplement of Pocock 2012

r(wr) win ratio

r(logwr) log win ratio

If the strata option is used then the following results are also stored:

r(p#) p-value in strata #

r(se#) standard error of log win ratio in strata #

r(wr#) win ratio in strata #

r(logwr#) log win ratio in strata #

References

1. Pocock SJ, Ariti CA, Collier TJ, Wang D. The win ratio: a new approach to the analysis of composite endpoints in clinical trials based on clinical priorities. Eur Heart J 2012;33:176–182.

2. Finkelstein DM, Schoenfeld DA. Combining mortality and longitudinal measures in clinical trials. Stat Med 1999;18:1341–1354.

Authors

Tim Collier, Medical Statistics Department, London School of Hygiene and Tropical Medicine, tim.collier@lshtm.ac.uk

John Gregson, Medical Statistics Department, London School of Hygiene and Tropical Medicine, john.gregson@lshtm.ac.uk