wlr.Stat: Weighted Logrank Test Statistic

Description Usage Arguments Details Value Examples

View source: R/wlr.Stat.r

Description

Weighted logrank adopted from survMisc package

Usage

1
wlr.Stat(survival, cnsr, trt, stra = NULL, fparam)

Arguments

survival

time-to-event variable

cnsr

censoring variable: 1=censoring, 0=event

trt

treatment varaible. Accepted values are either "experimental" or "control"

stra

stratification variable for stratified weighted logrank test. Default is NULL.

fparam

a list input to request additional FH test and time of delayed separation in the simplified APPLE method

fparam$stdset

if not NULL, the standard set of tests are added

fparam$rho

a vector of rho to be used in Fleming-Harrington FH(rho, gamma)

fparam$gamma

a vector of gamma to be used in Fleming-Harrington FH(rho, gamma). The length of gamma needs to be the same as rho

fparam$wlr

test name of which the p-Value will be stored in the variable pval. Accepted values are "1", "n", "sqrtN", "S1", "S2", "APPLE", or "FH(rho,gamma)" where rho and gamma is one of the pair specified by user in the fparam

fparam$APPLE

If not left NULL, it is the time of separation used in the simplified piecewise exponential method.

Details

The one-sided p-Values from the following tests can be obtained based on input from fparam$stdset and fparam$APPLE

1

log-rank (part of standard set)

n

Gehan-Breslow generalized Wilcoxon (part of standard set)

sqrtN

Tarone-Ware (part of standard set)

S1

Peto-Peto's modified survival estimate (part of standard set)

S2

modified Peto-Peto (by Andersen) (part of standard set)

APPLE

Simplified APPLE method with user specified late separation time

FH(rho,gamma)

Fleming-Harrington with user specified pairs of rho and gamma

Value

The function return a list with the follow components

pval

One-sided p-Value from user specified test

pval_[XXX]

One-sided test from various weighted tests

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# weighted logrank on the simulated data
library(survMisc)
medC = 6 
hr <- c(1, 0.6)
intervals <- 3 
gamma <- c(2.5, 5,  7.5,  10) ## a ramp-up enrollment
R     <- c(2  , 2,  2  ,  6 ) ## enrollment period: total of 12 months
eta <- -log(0.99) ## 1% monthly dropout rate
sim1 <- nphsim(nsim=2,lambdaC=log(2)/medC,lambdaE=log(2)/medC*hr, ssC=300,ssE=300,
               intervals=intervals,gamma=gamma, R=R,eta=eta)
test1 <- simtest(x=sim1, anaD=c(250,300), method=wlr.Stat,fparam=list(rho=c(0,0,1), 
                 gamma=c(0,1,1), wlr='FH(0,1)', APPLE=3))
test1$result[]

# direct function call (without cutoff)
wlr.Stat(surv=sim1$simd$survival, cnsr=sim1$simd$cnsr, trt=sim1$simd$treatment,
         fparam=list(rho=c(0,0,1), gamma=c(0,1,1), wlr='FH(0,1)', APPLE=3))

keaven/nphsim documentation built on May 24, 2020, 9:34 p.m.