win.stat {WINS}R Documentation

Function to Calculate the Win Statistics

Description

Calculate the win statistics for a mixture type of outcomes including time-to-event outcome, continuous outcome and binary outcome.

Usage

win.stat(data, ep_type, Z_t_trt = NULL, Z_t_con = NULL, iptw.weight = NULL,
arm.name = c(1,2),priority = c(1,2), alpha = 0.05, digit = 5, tau = 0,
np_direction = "larger", win.strategy = NULL,pvalue = c("one-sided","two-sided"),
stratum.weight = c("unstratified","MH-type","wt.stratum1","wt.stratum2","equal"),
method = c("unadjusted","ipcw","covipcw","iptw"),
summary.print = TRUE, ...)

Arguments

data

The analysis dataset which contains the following variables:

arm:

A vector for the treatment groups. Alternative names for "arm" include "trt", "treat" and "treatment".

id:

A vector for the patient id.

stratum:

A vector for the stratum.

Delta_j:

A vector for the event status of the j-th endpoint if the endpoint is a time-to-event outcome (1=event, 0=censored).

Y_j:

A vector for the outcome of the j-th endpoint, for time-to-event outcome, Y_j is a vector for the observed time.

Start_time:

A vector for the time when each of the individuals is first accrued to study.

ep_type

A vector for the outcome type for each endpoint. If scalar, the function will treat all the endpoints as the same type. The types of outcome include:

"tte":

Time-to-event outcome, with the default win strategy: the treatment group wins if min(T_trt, C_trt, C_con + tau) > T_con + tau.

"continuous":

Continuous outcome, with the default win strategy: the treatment group wins if Y_trt > Y_con + tau.

"binary":

Binary outcome coded as 0/1, with the default win strategy: 1 is the winner over 0.

Z_t_trt

A matrix of the covariate history in the treatment group, each row is a (p+2) vector: the first two columns are subject id, time, the other p columns are the covariates (vector of length p). The baseline covariates are provided as the observed covariates corresponding to time 0.

Z_t_con

A matrix of the covariate history in the control group, each row is a (p+2) vector: the first two columns are subject id, time, the other p columns are the covariates (vector of length p). The baseline covariates are provided as the observed covariates corresponding to time 0.

iptw.weight

The weight assigned to each individual if method = "iptw".

arm.name

A vector for the labels of the two experimental arms, default to be c(1,2). The first label is for the treatment group, and the second label is for the control group.

priority

Importance order (from the most to the least important). For example, given three endpoints with the importance order as Endpoint 3, Endpoint 2, and Endpoint 1, input priority = c(3,2,1).

alpha

The significance level, default to be 0.05.

digit

The number of digits for the output, default to be 5.

tau

A vector of numerical value for the magnitude of difference to determine win/loss/tie for each endpoint. Tau is applicable for TTE endpoints and continuous endpoints; tau is fixed as 0 for binary endpoints. Default is 0 for all endpoints.

np_direction

A vector of character for the direction to define a better result for each endpoint.

"larger":

The treatment group wins if min(T_trt, C_trt, C_con + tau) > T_con + tau, for time-to-event outcomes; "the larger value wins" for continuous outcome, value 1 wins over the value 0 for binary outcome.

"smaller":

The treatment group wins if min(T_trt, C_trt, C_con - tau) < T_con - tau, for time-to-event outcomes; "the smaller value wins" for continuous outcome, value 0 wins over the value 1 for binary outcome.

win.strategy

The strategy to determine the win status. Default as NULL. If NULL, the default win strategy funtion "win.strategy.default" is called, see win.strategy.default for more details. Users can also define their own "win.strategy" function.

pvalue

The p-value type: "one-sided" or "two-sided".

stratum.weight

The weighting method for each stratum. Default is "unstratified" for unstratified analysis. A stratified analysis is performed if other weight option is specified. Other possible choices for this argument are listed below.

"MH-type":

weight the wins with the reciprocal of the stratum size following the Mantel-Haenszel type stratified analysis as described in Dong et al. (2018).

"wt.stratum1":

weight the win statistics with weight equal to the number of subjects in each stratum divided by the total number of subjects.

"wt.stratum2":

weight the win statistics with weight equal to the number of subjects with events (of any TTE endpoint) in each stratum divided by the total number of subjects with events (of any TTE endpoint).

"equal":

set equal weights for all stratum.

method

The method to adjust the kernal functions. Possible choices are listed below.

"unadjusted":

Without using the IPCW approach to dealing with the censoring.

"ipcw":

IPCW adjustment for censoring with the Kaplan-Meier estimator.

"covipcw":

IPCW adjustment for censoring with the time dependent Cox model.

"iptw":

Inverse probability of treatment weighting (IPTW) method.

Other methods may be added in future versions.

summary.print

If TRUE, print out a summary of the estimation and inference result for the win statistics; If FALSE, return a list that summarizes the results. Default as TRUE.

...

Argument passed from user defined functions "win.strategy" if there is any. For instructions on this "win.strategy" function, see win.strategy.default for more details.

Details

The arguments of user defined "win.strategy" function must at least include the argument "trt_con" and "priority". "priority" is defined the same as stated in the main function "win.stat". The intermediate analysis dataset "trt_con" for the patient pairs (i.e., unmatched pairs, see Pocock et al., 2012) contains the following variables. Each row represents a pair.

stratum:

A vector for the stratum number of the unmatched pairs.

pid_trt:

A vector for the subject id of the individuals from the treatment group within each unmatched pair.

pid_con:

A vector for the subject id of the individuals from the control group within each unmatched pair.

Delta_j_trt:

A vector for the event status of the j-th endpoint (1=event, 0=censored) for the individuals from the treatment group in each unmatched pair. If the outcome type for the endpoint is continuous/binary, then the event status is 1 for all.

Delta_j_con:

A vector for the event status of the j-th endpoint (1=event, 0=censored) for the individuals from the control group in each unmatched pair. If the outcome type for the endpoint is continuous/binary, then the event status is 1 for all.

Y_j_trt:

A vector for the outcome of the j-th endpoint for the individuals from the treatment group in each unmatched pair. For a time-to-event outcome, it would be a vector of observed time-to-event observations.

Y_j_con:

A vector for the outcome of the j-th endpoint for the individuals from the control group in each unmatched pair. For a time-to-event outcome, it would be a vector of observed time-to-event observations.

Value

Win_prop

The win proportion of the treatment and the control group.

Win_statistic

The win statistics including:

Win_Ratio:

A list for the ratio of the win proportion between the treatment and the control groups.

Net_Benefit:

A list for the difference of the win proportion between the treatment and the control groups.

Win_Odds:

A list for the win odds between the treatment and the control groups.

z_statistic

The z-scores including:

zstat_WR:

z-score for win ratio.

zstat_NB:

z-score for net benefit.

zstat_WO:

z-score for win odds.

pvalue

The p-value for the test statistics including:

pvalue_WR:

p-value for win ratio.

pvalue_NB:

p-value for net benefit.

pvalue_WO:

p-value for win odds.

summary_ep

The win count and win proportion of the treatment and the control group for each endpoint

References

Examples


#### An example with time-to-event outcome.
head(data_tte)
head(Z_t_trt)

### CovIPCW adjustment for dependent censoring
res_tte_covipcw <- win.stat(data = data_tte, ep_type = "tte", arm.name = c("A","B"), tau = 0.1,
Z_t_trt = Z_t_trt, Z_t_con = Z_t_con, priority = c(1:3), alpha = 0.05, digit = 3,
method = "covipcw", stratum.weight = "unstratified", pvalue = "two-sided")

#### An example with continuous outcome.
head(data_continuous)

res_continuous <- win.stat(data = data_continuous, ep_type = "continuous", arm.name = c("A","B"),
tau = 0, priority = c(1:3), alpha=0.05, digit = 3, stratum.weight = "unstratified",
pvalue = "two-sided")

#### An example with binary outcome.
head(data_binary)

res_binary <- win.stat(data = data_binary, ep_type = "binary", arm.name = c("A","B"),
priority = c(1:3), alpha=0.05, digit = 3, stratum.weight = "unstratified",
pvalue = "two-sided")


[Package WINS version 1.4.2 Index]