fits Cox models for each risk and group, treating other type of events as censoring.

fitCox(time, risk, group, cens = NULL, conf.int = 0.95)

Arguments

time

vector with times of the first event or follow-up, must be numeric.

risk

vector with type of event, can be numeric or factor/character.

group

vector with group variable, can be numeric or factor/character.

cens

value of 'risk' indicating censored observation (if NULL, the first value of 'risk' vector will be taken).

conf.int

conf.int level of two-sided confidence interval (default = 0.95).

Value

a list of length n, where n is number of risks. Each element of a list is a result of summary.coxph function from package survival, where there is only one type of event possible (other are treating as censored).

See also

coxph summary.coxph

Examples

fitCox(time = LUAD$time, risk = LUAD$event, group = LUAD$gender, cens = "alive", conf.int = 0.95)
#> $death #> Call: #> coxph(formula = Surv(time, localrisk) ~ localGroup) #> #> n= 503, number of events= 102 #> (19 observations deleted due to missingness) #> #> coef exp(coef) se(coef) z Pr(>|z|) #> localGroupmale -0.06014 0.94163 0.19976 -0.301 0.763 #> #> exp(coef) exp(-coef) lower .95 upper .95 #> localGroupmale 0.9416 1.062 0.6366 1.393 #> #> Concordance= 0.482 (se = 0.031 ) #> Rsquare= 0 (max possible= 0.853 ) #> Likelihood ratio test= 0.09 on 1 df, p=0.7631 #> Wald test = 0.09 on 1 df, p=0.7634 #> Score (logrank) test = 0.09 on 1 df, p=0.7633 #> #> #> $new_tumor #> Call: #> coxph(formula = Surv(time, localrisk) ~ localGroup) #> #> n= 503, number of events= 31 #> (19 observations deleted due to missingness) #> #> coef exp(coef) se(coef) z Pr(>|z|) #> localGroupmale -0.00577 0.99425 0.36170 -0.016 0.987 #> #> exp(coef) exp(-coef) lower .95 upper .95 #> localGroupmale 0.9942 1.006 0.4893 2.02 #> #> Concordance= 0.471 (se = 0.051 ) #> Rsquare= 0 (max possible= 0.462 ) #> Likelihood ratio test= 0 on 1 df, p=0.9873 #> Wald test = 0 on 1 df, p=0.9873 #> Score (logrank) test = 0 on 1 df, p=0.9873 #> #>