Description Usage Arguments Details Value Author(s) References See Also Examples

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)

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

`y1` |
a numeric vector of event times denoting the minimum of event times |

`y2` |
a numeric vector of event times denoting the minimum of event time |

`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). |

weighted win statistics

`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 |

`tl` |
A vector of total numbers of losses in group 1 for each of the two outcomes. Note that |

`xp` |
The ratios between |

`cwindex` |
The win contribution index defined as the ratio between |

`clindex` |
The loss contribution index defined as the ratio between |

`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 |

Xiaodong Luo

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.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | ```
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)
``` |

```
Total number of subjects: 300
Number of subjects in group 1: 150
Number of subjects in group 0: 150
Win total in group 1: 16723.96
Loss total in group 1: 7822.68
Win total in group 1 from most to least important: 15125.96 1598
Loss total in group 1 from most to least important: 7025.68 797
Win contribution indexes in group 1: 0.62 0.07
Loss contribution indexes in group 1: 0.29 0.03
The win difference statistic: Test Stat 8901.2735
sd 0.3937
z 4.3516
p-value 0
95% CI (8845.6548,8956.8922)
The win ratio statistic: Test Stat 2.1379
sd 4.5291
z 2.9057
p-value 0.0037
95% CI (1.6822,2.717)
The win product statistic: Test Stat 4.3167
sd 10.4214
z 2.4307
p-value 0.0151
95% CI (3.2848,5.6728)
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.