contal | R Documentation |
Apply contal o quigley method
contal(time = NULL, status = NULL, marker = NULL)
time |
time variable |
status |
status variable |
marker |
marker variable |
## Klein Moeschberg example pag 274
data(kidtran, package = "KMsurv")
kidtran <- within(kidtran, {
gender <- factor(gender, levels = c(1,2), labels = c('male', 'female'))
race <- factor(race, levels = c(1,2), labels = c('white', 'black'))
})
k_spl <- split(kidtran, f = list(kidtran$race, kidtran$gender))
k_spl <- k_spl[c(2,1,4,3)]
expanded <- lapply(k_spl, function(x){
contal(time = x$time,
status = x$delta,
marker = x$age)
})
expanded[1]
## expanded_survmisc <- lapply(k_spl, function(x){
## df = data.frame(time = x$time,
## status = x$delta,
## marker = x$ag)
## cox <- survival::coxph(Surv(time = time, event = status) ~ marker,
## data = df)
## survMisc::cutp(cox)
## })
compact <- do.call(rbind, lapply(expanded, function(x) x$optimal))
compact
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.