Description Usage Arguments Details Value Examples
Tests if there is a difference between two survival curves using logrank test. One sided p-value, Z statistics, HR from cox model and standard error of the HR are generated.
1 |
cnsr |
censoring variable: 1=censoring, 0=event |
trt |
treatment varaible. Accepted values are either "experiment" or "control" |
stra |
stratification variable. Default is |
survival |
time-to-event variable |
test.lr is used when method='LR'
The function return a list with the follow components
One-sided p-Value from the logrank test
z statistics from the logrank test
Hazard ratio from the cox proportional hazard model
Standard error of the hazard ratio
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | # logrank test on the simulated data
library(survival)
medC = 6
hr <- 0.7
intervals <- NULL
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=300, method='LR')
test1$result[]
# direct function call (without cutoff)
test.lr(surv=sim1$simd$survival, cnsr=sim1$simd$cnsr, trt=sim1$simd$treatment)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.