Survival curves analysis of covariance
Logrank test to compare survival curves adjusting for covariates
calogrank(ftime, fstatus, grp, cvt, strat=NULL)
ftime
: failure timesfstatus
: status indicatorgrp
: group indicatorcvt
: continuous covariates used for adjusted analysisstrat
: stratification variablecalogrank is the covariate adjusted version of k-sample survdiff. The function in its current form only does basic error checking.
## Not run: library(survival) data(pbc) pbc1 <- pbc pbc1$trt[pbc1$trt == -9] <- NA pbc1$copper[pbc1$copper == -9] <- NA # only death (2) is considered; transplant(1) is censored calogrank(pbc1$time, pbc1$status==2, pbc1$trt, pbc1[,c("copper")]) calogrank(pbc1$time, pbc1$status==2, pbc1$trt, pbc1[,c("protime", "copper")]) ## End(Not run)
Heller G. and Venkatraman E.S. (2004) A nonparametric test to compare survival distributions with covariate adjustment. JRSS-B 66, 719-733.
Useful links