wlr.asym: Asymptotic Distribution of Weighted Log-rank Statistic

Description Usage Arguments Value Examples

View source: R/wlr.asym.R

Description

This function calculates the asymptotic distribution (mean and variance) at a DCO.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
wlr.asym(
  DCO = 24,
  r = 1,
  n = 450,
  h0 = function(t) {     log(2)/12 },
  S0 = function(t) {     exp(-log(2)/12 * t) },
  h1 = function(t) {     log(2)/12 * 0.7 },
  S1 = function(t) {     exp(-log(2)/12 * 0.7 * t) },
  cuts = c(6),
  rho = 0,
  gamma = 0,
  tau = NULL,
  s.tau = 0,
  f.ws = NULL,
  Lambda = function(t) {     (t/18) * as.numeric(t <= 18) + as.numeric(t > 18) },
  G0 = function(t) {     0 },
  G1 = function(t) {     0 }
)

Arguments

r

Proportion of subjects in experimental arm. For 1:1 randomization, r = 1/2.

n

Total sample size for two arms.

h0

Hazard function of control arm, eg, h0(t) = log(2)/m0 for the exponential distribution with median m0.

S0

Survival function of control arm.

h1

Hazard function of experimental arm.

S1

Survival function of experimental arm.

cuts

Piece wise interval cut points of the curresponding survival functions. For delayed effect model with 6 months of delay, cuts = 6. Incorrect specification of cuts may lead to numerical integration issues.

f.ws

Self-defined weight function of survival rate, eg, f.ws = function(s)1/max(s, 0.25) When f.ws is specified, sFH parameter will be ignored.

Lambda

Cumulative distribution function of enrollment.

G0

Cumulative distribution function of drop-off for control arm, eg, G.ltfu=function(t)1-exp(-0.03/12*t) is the distribution function for 3 percent drop-off in 12 months of followup.

G1

Cumulative distribution function of drop-off for experimental arm, eg, G.ltfu=function(t)1-exp(-0.03/12*t) is the distribution function for 3 percent drop-off in 12 months of followup.

T

Analysis time, calculated from first subject in.

method

Non-centrality parameter options: "SIGWA", "Schoenfeld", "YL 2020", "LM 2019". Default "SIGWA". "YL 2020" is based on Yung and Liu (2020) and "LM 2019" is based on Luo et al (2019).

Value

A dataframe with variables including

Another dataframe including variables: method, mean, var, pow

Examples

 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#Example: Assume HR 0.65 after 6 months of delayed effect. Control arm follows
exponential distribution with median 12 months.

HR = 0.4; delay = 6; lam0 = log(2) / 12; 
h0 = function(t){lam0}; S0 = function(t){exp(-lam0 * t)}
h1.D6 = function(t){lam0*as.numeric(t < delay)+HR*lam0*as.numeric(t >= delay)}
c = exp(-delay*lam0*(1-HR)); 
S1.D6 = function(t){exp(-lam0*t)*as.numeric(t<delay) + c*exp(-HR*lam0*t)*as.numeric(t>=delay)}
f.logHR.D6 = function(t){log(as.numeric(t<6) + as.numeric(t>= 6)*HR)}
Lambda = function(t){(t/18)^1.5*as.numeric(t <= 18) + as.numeric(t > 18)}
G0.ltfu = G1.ltfu = function(t){0}

wlr.mu(DCO = 24, r = 1, n = 450, h0 = h0, S0=S0,
     h1 = h1.D6, S1=S1.D6, f.logHR = f.logHR.D6,
     rho = 0, gamma = 0, tau = NULL, s.tau = 0, f.ws = NULL,
     F.entry = Lambda)
wlr.asym(DCO = 24, r = 1, n = 450, h0 = h0, S0=S0,
     h1 = h1.D6, S1=S1.D6, 
     rho = 0, gamma = 0, tau = NULL, s.tau = 0, f.ws = NULL,
     Lambda = Lambda, cuts=c(6))
wlr.asym(DCO = 24, r = 1, n = 450, h0 = h0, S0=S0,
     h1 = h1.D6, S1=S1.D6, 
     rho = 0, gamma = 0, tau = NULL, s.tau = 0, f.ws = NULL,
     Lambda = Lambda, cuts=c(6))
wlr.asym(DCO = 24, r = 1, n = 450, h0 = h0, S0=S0,
     h1 = h1.D6, S1=S1.D6, 
     rho = 0, gamma = 0, tau = NULL, s.tau = 0, f.ws = NULL,
     Lambda = Lambda, cuts=c(6))
wlr.mu.schoenfeld(DCO = 24, r = 1, n = 450, h0 = h0, S0=S0,
     h1 = h1.D6, S1=S1.D6, f.logHR = f.logHR.D6,
     rho = 0, gamma = 0, tau = NULL, s.tau = 0, f.ws = NULL,
     F.entry = Lambda)
     
wlr.asym(DCO = 24, r = 1, n = 450, h0 = h0, S0=S0,
     h1 = h1.D6, S1=S1.D6, 
     rho = 0, gamma = 0, tau = NULL, s.tau = 0, f.ws = NULL,
     Lambda = Lambda, cuts=c(6))
wlr.asym(DCO = 24, r = 1, n = 450, h0 = h0, S0=S0,
     h1 = h1.D6, S1=S1.D6, 
     rho = 0, gamma = 0, tau = NULL, s.tau = 0, f.ws = NULL,
     Lambda = Lambda, cuts=c(6))
wlr.asym(DCO = 30, r = 1, n = 450, h0 = h0, S0=S0,
     h1 = h1.D6, S1=S1.D6, 
     rho = 0, gamma = 0, tau = NULL, s.tau = 0, f.ws = NULL,
     Lambda = Lambda, cuts=NULL)
     

phe9480/rgs documentation built on March 1, 2022, 12:26 a.m.