lmk.Stat: Landmark analysis

Description Usage Arguments Details Value Examples

View source: R/lmk.Stat.r

Description

Landmark (survival curve comparison at fixed point in time) analysis based on Klein 2007 (statistics in Medicine)

Usage

1
lmk.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 "experiment" or "control"

stra

stratification variable. Default is NULL (currently not implemented)

fparam

a list input

fparam$lmk

time at which the landmark analysis is done

fparam$lmktype

test name of which the p-Value will be stored in the variable pval. Accepted values are "naive", "log", "loglog", "arcsin", "logit"

Details

The p-Values from the following transformations of survival are included:

naive

No transformation

log

log(S)

loglog

log(-log(S))

arcsin

arcsin(sqrt(S))

logit

log(S/(1-S))

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 transformations

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# Lankmark analysis 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=1,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=lmk.Stat,fparam=list(lmk=9, lmktype='loglog'))
test1$result[]

# direct function call (without cutoff)
lmk.Stat(surv=sim1$simd$survival, cnsr=sim1$simd$cnsr, trt=sim1$simd$treatment, 
         fparam=list(lmk=9, lmktype='loglog'))

keaven/nphsim documentation built on July 2, 2018, 1:10 a.m.