wlr.cp: Conditional Power When IA Negative And Benefit-Risk...

Description Usage Arguments Value Examples

View source: R/wlr.cp.R

Description

Conditional Power When IA Negative And Benefit-Risk Assessment Compared to Standard Logrank Test

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
wlr.cp(
  b = c(2.3, 2),
  b.lrf,
  mu1,
  cv1,
  mu,
  cv,
  mu1lr,
  cv1lr,
  mulr,
  cvlr,
  lrInFA = "Y"
)

Arguments

b

A vector of rejection boundary in Z for IA and FA

mu1

Mean(Z1): IA Z

cv1

Cov(Z1)

mu

Mean(Z1, Zf): IA Z and FA Z

cv

Cov(Z1, Zf)

mu1lr

Mean(Z1, Zlr_f): IA Z1 and logrank Z at FA

cv1lr

Cov(Z1, Zlr_f)

mulr

Mean(Z1, Zlr_f, Zf)

cvlr

Cov(Z1, Zlr_f, Zf)

lrInFA

FA includes logrank test component. "Y", "N"

blr

Rejection boundary at FA using logrank test at IA and FA

Value

(1) Conditional power when IA is negative; (2) Benefit: P(logrank neg at FA; but weighted logrank test negative, IA negative) (3) Risk: P(logrank pos if used at FA; but weighted logrank #' (3) Risk: #' (3) Risk: )#'

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
DCO = c(24, 36); 
h0 = function(t){log(2)/12}; S0= function(t){exp(-log(2)/12 * t)};
h1 = function(t){log(2)/12*0.70}; S1= function(t){exp(-log(2)/12 * 0.7 * t)}; 
primary.test = list(IA1=list(function(s){1}), FA=list(function(s){1}, function(s){s*(1-s)})); 
Lambda = function(t){(t/18)^1.5*as.numeric(t <= 18) + as.numeric(t > 18)};
G0 = function(t){0}; G1 = function(t){0}; 

pow = wlr.power.maxcombo(DCO = DCO, alpha=c(0.008, 0.01699),
r = 1, n = 450, h0 = h0, S0=S0, 
h1 = h1, S1 = S1, f.ws = primary.test, 
Lambda=Lambda, G0=G0, G1=G1,
mu.method = "H1", cov.method = "H1.LA")

b = pow$design$b
mu1 = pow$mu[1,!is.na(pow$mu[1,])]
cv1 = pow$Omega1[1,1]
mu = NULL
for(i in 1:nrow(pow$mu)){mu=c(mu,pow$mu[i,!is.na(pow$mu[i,])])}
cv = pow$Omega1

lr.test = list(IA1=list(function(s){1}), FA=list(function(s){1})); 

pow.lr = wlr.power.maxcombo(DCO = DCO, alpha=c(0.008, 0.01699),
r = 1, n = 450, h0 = h0, S0=S0, 
h1 = h1, S1 = S1, f.ws = lr.test, 
Lambda=Lambda, G0=G0, G1=G1,
mu.method = "H1", cov.method = "H1.LA")

b.lrf = lr.pow$design$b[2]
mu1lr = c(pow$mu[1,1],lr.pow$mu[2])   #Mean(Z1, Zlr_f)
cv1lr = lr.pow$Omega1                 #cov(Z1, Zlr_f)
mulr  = mu    #Mean(Z1, Zlr_f, Zf)
cvlr  = cv    #cov(Z1, Zlr_f, Zf). Note Zf already includes Zlr_f in this case
wlr.cp (b = b, b.lrf=b.lrf, mu1=mu1, cv1=cv1, mu=mu, cv=cv, 
        mu1lr=mu1lr, cv1lr=cv1lr, mulr=mulr, cvlr=cvlr)
                 

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