Description Usage Arguments Value Examples
The weight function includes Stabilized Fleming-Harrington class (rho, gamma, tau, s.tau), and any user-defined weight function. For the stabilized Fleming-Harrington class, to produce stabilized weighting function from pooled survival curve, specify either tau or s.tau, which are thresholds in survival time and survival rate, respectively. The weight function is based on the pooled survival curve within each strata by default.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
time |
Survival time |
event |
Event indicator; 1 = event, 0 = censor |
group |
Treatment group; 1 = experimental group, 0 = control |
strata1 |
Stratification variable 1 |
strata2 |
Stratification variable 2 |
strata3 |
Stratification variable 3 |
rho |
Parameter for Fleming-Harrington (rho, gamma) weighted log-rank test. |
gamma |
Parameter for Fleming-Harrington (rho, gamma) weighted log-rank test. For log-rank test, set rho = gamma = 0. |
tau |
Cut point for stabilized FH test, sFH(rho, gamma, tau); with weight function defined as w(t) = s_tilda^rho*(1-s_tilda)^gamma, where s_tilda = max(s(t), s.tau) or max(s(t), s(tau)) if s.tau = NULL tau = Inf reduces to regular Fleming-Harrington test(rho, gamma) |
s.tau |
Survival rate cut S(tau) at t = tau; default 0.5, ie. cut at median. s.tau = 0 reduces to regular Fleming-Harrington test(rho, gamma) |
f.ws |
Self-defined weight function of survival rate. For example, f.ws = function(s)1/max(s, 0.25) When f.ws is specified, the weight function takes it as priority. Note: The actual math formula for weighting function is based on the left of each event time t, i.e., w(t) = f.ws(s(t-)). For FH(rho, gamma) test, when gamma = 0, then the first event time has weight 1; when gamma > 0, the first event weight is 0. This can ensure consistency with FH(0,0) = logrank; and FH(1,0) = generalized Wilcoxon. |
side |
Type of test. one.sided or two.sided. default = two.sided |
An object with dataframes below.
dataframe including the following variables:
time: Survival time
event: Event indicator; 0 = censor; 1 = event
group: Group indicator; 0 = control; 1 = experimental treatment
dataframe of unique event times and intermediate statistics including the following variables:
u.eTime: Unique event times;
Y0: Risk set of control arm at each of unique event times;
Y1: Risk set of experimental arm at each of unique event times;
Y: Risk set of pooled data at each of unique event times;
dN0: Event set of control arm at each of unique event times;
dN1: Event set of experimental arm at each of unique event times;
dN: Event set of pooled data at each of unique event times;
s: Survival time of pooled data by KM method;
s.til: s.tilda defined as, s.til = max(s, s.tau);
w: Weight function w(t) at each of unique event times;
U: Score statistic at each of unique event times;
V: Variance statistic at each of unique event times;
z: Normalized z-statistic at each of unique event times; z = sum(U)/sqrt(sum(V));
dataframe of intermediate calculation per stratum
rho: Stabilized Fleming-Harrington test parameter
gamma: Stabilized Fleming-Harrington test parameter
tau: Stabilized Fleming-Harrington test parameter if provided
s.tau: Stabilized Fleming-Harrington test parameter if provided
test.side: two.sided or one.sided
chisq: Chi-square statistic, chisq = z^2
z: Z statistic
p: P value per stratum
strata1 Strata 1 value
strata1 Strata 2 value
strata1 Strata 3 value
dataframe including the following variables:
rho: Stabilized Fleming-Harrington test parameter
gamma: Stabilized Fleming-Harrington test parameter
tau: Stabilized Fleming-Harrington test parameter if provided
s.tau: Stabilized Fleming-Harrington test parameter if provided
test.side: two.sided or one.sided
chisq: Chi-square statistic, chisq = z^2
z: Z statistic
p: P value
1 2 3 4 5 6 7 8 9 10 11 | wlr(time=rexp(100), event=sample(c(0,1), 100, replace = TRUE), group=c(rep(0, 50), rep(1, 50)), rho=0, gamma=1, tau = NULL, s.tau=0, strata1=sample(c(1,2), 100, replace = TRUE),strata2=NULL, strata3=NULL)
wlr(time=rexp(100), event=sample(c(0,1), 100, replace = TRUE), group=c(rep(0, 50), rep(1, 50)), rho=0, gamma=1, tau = NULL, s.tau=0, strata1=sample(c(1,2), 100, replace = TRUE), strata2=sample(c(1,2), 100, replace = TRUE))
wlr(time=rexp(100), event=sample(c(0,1), 100, replace = TRUE), group=c(rep(0, 50), rep(1, 50)), rho=0, gamma=1, tau = NULL, s.tau=0, strata1=sample(c(1,2), 100, replace = TRUE), strata2=sample(c(1,2), 100, replace = TRUE), strata3=sample(c(1,2), 100, replace = TRUE))
wlr(time=rexp(100), event=sample(c(0,1), 100, replace = TRUE), group=c(rep(0, 50), rep(1, 50)), rho=0, gamma=1, tau = NULL, s.tau=0, strata1=sample(c(1,2), 100, replace = TRUE), strata2=sample(c(1,2), 100, replace = TRUE), strata3=sample(c(3,4), 100, replace = TRUE), f.ws=function(s){1/max(s^2, 0.25)})
wlr(time=c(5,7,10,12,12,15,20,20), event=c(1,0,0,1,1,0,1,1), group=c(0,1,0,1,0,1,0,1), rho=0, gamma=1, tau = 3, s.tau=NULL)
wlr(time=c(5,7,10,12,12,15,20,20), event=c(1,0,0,1,1,0,1,1), group=c(0,1,0,1,0,1,0,1), rho=0, gamma=1, tau = 20, s.tau=NULL)
wlr(time=c(5,7,10,12,12,15,20,20), event=c(1,0,0,1,1,0,1,1), group=c(0,1,0,1,0,1,0,1), rho=0, gamma=1, tau = Inf, s.tau=NULL)
wlr(time=c(12,7,10,5,12,15,20,20), event=c(1,0,0,1,1,0,1,1), group=c(1,1,0,0,0,1,0,1), rho=0, gamma=1, tau = 10, s.tau=NULL)
wlr(time=c(12,7,10,5,12,15,20,20), event=c(1,0,0,1,1,0,1,1), group=c(1,1,0,0,0,1,0,1), rho=0, gamma=1, tau = 10, s.tau=0.5, side="one.sided")
wlr(time=c(12,7,10,5,12,15,20,20), event=c(1,0,0,1,1,0,1,1), group=c(1,1,0,0,0,1,0,1), rho=0, gamma=0, tau = 10, s.tau=0.5, side="one.sided")
wlr(time=c(12,7,10,5,12,15,20,20), event=c(1,0,0,1,1,0,1,1), group=c(1,1,0,0,0,1,0,1), rho=0, gamma=0, tau = 10, s.tau=0, side="one.sided")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.