powered by
Calculating the Fleming-Harrington weighted log-rank tests
FH_test(survival, delta, trt, rho, gamma, test = c("Futility"))
A list 3 different components
Observed number of weighted events (with a multiplication of corresponding weights) in the treatment arm.
Expected number of weighted events (with a multiplication of corresponding weights) in the treatment arm.
Weighted log-rank test statistic.
Weighted log-rank test statistic pvalue
Time to event or censoring.
Event indicators.
Treatment assignment indicator with 1 denoting the treated group, and 0 denoting the placebo group.
First power parameter for the Fleming-Harrington weight which weighs on the early departures: \(S(t^-)^\rho(1-S(t^-))^\gamma\).
Second power parameter for the Fleming-Harrington weight which weighs on the late departures: \(S(t^-)^\rho(1-S(t^-))^\gamma\).
a character denotes the test type, include "Superiority","Futility","Two-sided"
n <- 500 event <- runif(n,1, 5) osc<-1*(event<=4) os <- pmin(event,4) trt<-c(rep(0,n/2),rep(1,n/2)) FH_test(os,osc,trt,rho=1,gamma=0)
Run the code above in your browser using DataLab