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

Calculate the win loss statistics of Pocock et al. (2012) and the corresponding variances, which are based on a U-statistic method of Luo et al. (2015)

1 | ```
winratio(y1,y2,d1,d2,z)
``` |

`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 denoting otherwise. |

`d2` |
a numeric vector of event indicators with 1 denoting the terminal event is observed and 0 denoting otherwise.Note that Luo et al. (2015) use a single indicator |

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

win loss statistics

`n1` |
Number of subjects in group 1 |

`n0` |
Number of subjects in group 0 |

`n` |
Total number of subjects in both groups |

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

`vr` |
estimated variance of win ratio |

`tr` |
standardized log(wr) |

`pr` |
2-sided p-value of tr |

`wd` |
win difference |

`vd` |
estimated variance of win difference |

`td` |
standardized wd |

`pd` |
2-sided p-value of td |

`wp` |
win product |

`vp` |
estimated variance of 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.

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 | ```
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)
wtest<-winratio(y1,y2,d1,d2,z)
summary(wtest)
``` |

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.