Learn R Programming

WWR (version 1.2.2)

wwratio: Weighted Win Loss Statistics

Description

Calculate weighted win loss statistics and their corresponding variances under the global NULL hypothesis based on Luo et al. (2017) paper, which is a generalization of the win ratio of Pocock et al. (2012) and the win difference of Luo et al. (2015)

Usage

wwratio(y1, y2, d1, d2, z, wty1 = 1, wty2 = 1)

Arguments

y1

a numeric vector of event times denoting the minimum of event times \(T_1\), \(T_2\) and censoring time \(C\), where the endpoint \(T_2\), corresponding to the terminal event, is considered of higher clinical importance than the endpoint \(T_1\), corresponding to the non-terminal event. Note that the terminal event may censor the non-terminal event, resulting in informative censoring.

y2

a numeric vector of event times denoting the minimum of event time \(T_2\) and censoring time \(C\). Clearly, y2 is not smaller than y1.

d1

a numeric vector of event indicators with 1 denoting the non-terminal event is observed and 0 else.

d2

a numeric vector of event indicators with 1 denoting the terminal event is observed and 0 else.

z

a numeric vector of group indicators with 1 denoting the treatment group and 0 the control group.

wty1

a numeric vector of weight indicators for the non-terminal event with values 1 to 4 corresponding to weights used in Luo et al. (2017).

wty2

a numeric vector of weight indicators for the terminal event with values 1 to 2 corresponding to weights used in Luo et al. (2017).

Value

n1

Number of subjects in group 1

n0

Number of subjects in group 0

n

Total number of subjects in both groups

wty1

Weight for non-terminal event

wty2

Weight for terminal event

totalw

Total number of wins in group 1

totall

Total number of losses in group 1

tw

A vector of total numbers of wins in group 1 for each of the two outcomes. Note that totalw=sum(tw), and the first element is for the terminal event and the second element is for the non-terminal event.

tl

A vector of total numbers of losses in group 1 for each of the two outcomes. Note that totall=sum(tl), and the first element is for the terminal event and the second element is for the non-terminal event.

xp

The ratios between tw and tl

cwindex

The win contribution index defined as the ratio between tw and totalw+totall

clindex

The loss contribution index defined as the ratio between tl and totalw+totall

wr

weighted win ratio

vr

estimated variance of weighted win ratio

tr

standardized log(wr)

pr

2-sided p-value of tr

wd

weighted win difference

vd

estimated variance of weighted win difference

td

standardized wd

pd

2-sided p-value of td

wp

weighted win product

vp

estimated variance of weighted win product

tp

standardized log(wp)

pp

2-sided p-value of tp

Details

weighted win statistics

References

Pocock S.J., Ariti C.A., Collier T. J. 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.

Luo X., Tian H., Mohanty S. and Tsai W.-Y. 2015. An alternative approach to confidence interval estimation for the win ratio statistic. Biometrics, 71, 139-145.

Luo X., Qiu J., Bai S. and Tian H. 2017. Weighted win loss approach for analyzing prioritized outcomes. Statistics in Medicine, doi: 10.1002/sim.7284.

See Also

wlogr2,winratio

Examples

Run this code
# NOT RUN {
n<-300
rho<-0.5
b2<-0.2
b1<-0.5
bc<-1.0
lambda10<-0.1;lambda20<-0.08;lambdac0<-0.09
lam1<-rep(0,n);lam2<-rep(0,n);lamc<-rep(0,n)
z<-rep(0,n)
z[1:(n/2)]<-1

lam1<-lambda10*exp(-b1*z)
lam2<-lambda20*exp(-b2*z)
lamc<-lambdac0*exp(-bc*z)
tem<-matrix(0,ncol=3,nrow=n)

y2y<-matrix(0,nrow=n,ncol=3)
y2y[,1]<-rnorm(n);y2y[,3]<-rnorm(n)
y2y[,2]<-rho*y2y[,1]+sqrt(1-rho^2)*y2y[,3]
tem[,1]<--log(1-pnorm(y2y[,1]))/lam1
tem[,2]<--log(1-pnorm(y2y[,2]))/lam2
tem[,3]<--log(1-runif(n))/lamc

y1<-apply(tem,1,min)
y2<-apply(tem[,2:3],1,min)
d1<-as.numeric(tem[,1]<=y1)
d2<-as.numeric(tem[,2]<=y2)

i<-1 ##i=1,2,3,4
j<-2 ##j=1,2

wtest<-wwratio(y1,y2,d1,d2,z,wty1=i,wty2=j)
summary(wtest)
# }

Run the code above in your browser using DataLab