Description Usage Arguments Value Examples
This function calculates the covariance matrix of two weighted log-rank tests at the same analysis time. The two weight functions are specified by stabilized Fleming-Harrington class with parameters (rho, gamma, tau, s.tau), where tau and s.tau are thresholds for survival time and survival rates, respectively. Either tau or s.tau can be specified. tau = Inf or s.tau = 0 reduces to the Fleming-Harrington test (rho, gamma). User-defined weight functions f.ws1 and f.ws2 can be used as well. For example, f.ws1 = function(s)s^rho*(1-s)^gamma is equivalent to Fleming-Harrington (rho, gamma) test with parameters specified for rho and gamma.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
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 |
rho1 |
Parameter for Fleming-Harrington (rho1, gamma1) weighted log-rank test. |
gamma1 |
Parameter for Fleming-Harrington (rho1, gamma1) weighted log-rank test. For log-rank test, set rho1 = gamma1 = 0. |
tau1 |
Cut point for stabilized FH test, sFH(rho1, gamma1, tau1); with weight function defined as w1(t) = s_tilda1^rho1*(1-s_tilda1)^gamma1, where s_tilda1 = max(s(t), s.tau1) or max(s(t), s(tau1)) if s.tau1 = NULL tau1 = Inf reduces to regular Fleming-Harrington test(rho1, gamma1) |
s.tau1 |
Survival rate cut S(tau1) at t = tau1; default 0.5, ie. cut at median. s.tau1 = 0 reduces to regular Fleming-Harrington test(rho1, gamma1) |
rho2 |
Parameter for Fleming-Harrington (rho2, gamma2) weighted log-rank test. |
gamma2 |
Parameter for Fleming-Harrington (rho2, gamma2) weighted log-rank test. For log-rank test, set rho2 = gamma2 = 0. |
tau2 |
Cut point for stabilized FH test, sFH(rho2, gamma2, tau2); with weight function defined as w2(t) = s_tilda2^rho2*(1-s_tilda2)^gamma2, where s_tilda2 = max(s(t), s.tau2) or max(s(t), s(tau2)) if s.tau2 = NULL tau2 = Inf reduces to regular Fleming-Harrington test(rho2, gamma2) |
s.tau2 |
Survival rate cut S(tau2) at t = tau2; default 0.5, ie. cut at median. s.tau2 = 0 reduces to regular Fleming-Harrington test(rho2, gamma2) |
f.ws1 |
Self-defined weight function of survival rate. For example, f.ws1 = function(s)1/max(s, 0.25) When f.ws1 or f.ws2 is specified, the weight function takes them as priority. |
f.ws2 |
Self-defined weight function of survival rate. For example, f.ws2 = function(s)1/max(s, 0.25) When f.ws1 or f.ws2 is specified, the weight function takes them as priority. |
An object with dataframes below.
dataframe with variables: time, event, group, strata1, strata2, strata3.
dataframe with 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.til1: s.tilda1 defined as, s.til = max(s, s.tau1);
s.til2: s.tilda2 defined as, s.til = max(s, s.tau2);
w1: Weight function w1(t) at each of unique event times;
w2: Weight function w2(t) at each of unique event times;
V11: Variance statistic at each of unique event times for w1;
V12: Covariance statistic at each of unique event times for w1 and w2;
V22: Variance statistic at each of unique event times for w2;
strata1 Strata 1 value
strata1 Strata 2 value
strata1 Strata 3 value
Correlation between two weigthed log-rank score statistics U1 and U2, equivalent to the correlation between two normalized weigthed log-rank statistics Z1 and Z2, where Zi = Ui/sqrt(var(Ui))
Covariance between two weighted log-rank score statistics, U1 and U2.
1 2 | wlr.cov(time=rexp(100), event=sample(c(0,1), 100, replace = TRUE), group=c(rep(0, 50), rep(1, 50)), rho1=0, gamma1=0, tau1 = NULL, s.tau1=0.5,rho2=0, gamma2=1, tau2 = NULL, s.tau2=0.5,f.ws1=NULL, f.ws2=NULL)
wlr.cov(time=rexp(100), event=sample(c(0,1), 100, replace = TRUE), group=c(rep(0, 50), rep(1, 50)), rho1=0, gamma1=0, tau1 = NULL, s.tau1=0.5,rho2=0, gamma2=1, tau2 = NULL, s.tau2=0.5,f.ws1=NULL, f.ws2=NULL,strata1=sample(c(1,2), 100, replace = TRUE),strata2=sample(c(1,2), 100, replace = TRUE),strata3=sample(c(1,2), 100, replace = TRUE))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.