tte {EventPredInCure} | R Documentation |
Calculating log-rank test p-value, median time from each arm, hazard ratio between two arms, number of subjects and events in time-to-event outcomes.
Description
Calculate log-rank test p-value, median time from each arm, HR between arms, number of subjects and events
Usage
tte(os, osc, grp, type, test = "Futility")
Arguments
os |
Time to event variable |
osc |
Time to event censoring variable |
grp |
Treatment assignment indicator with 1 denoting the treated group, and 0 denoting the placebo group. |
type |
either "all" or "logrank" or "hr" |
test |
a character denotes the test type, include "Superiority","Futility","Two-sided" |
Details
The control arm
Value
If type='all', return a list that includes the log-rank p-value, median time from each arm, hazard ratio between arms, and 95% confidence interval of hazard ratio, number of subjects and events; and events If type='logrank', return a list that includes the log-rank p-value, number of subjects and events; If type='hr', return a list that includes hazard ratio between arms, and 95% confidence interval of hazard ratio
Examples
n <- 500
event <- runif(n,1, 5)
osc<-1*(event<=4)
os <- pmin(event,4)
trt<-c(rep(0,n/2),rep(1,n/2))
tte(os,osc,trt,type='all')