coxphSeries {Publish} | R Documentation |
Run a series of Cox regression models
Description
Run a series of Cox regression analyses for a list of predictor variables and summarize the results in a table. The Cox models can be adjusted for a fixed set of covariates
This function runs on coxph
from the survival package.
Usage
coxphSeries(formula, data, vars, ...)
Arguments
formula |
The fixed part of the regression formula. For
univariate analyses this is simply |
data |
A |
vars |
A list of variable names, the changing part of the regression formula. |
... |
passed to publish.coxph |
Value
matrix with results
Author(s)
Thomas Alexander Gerds
Examples
library(survival)
data(pbc)
## collect hazard ratios from three univariate Cox regression analyses
pbc$edema <- factor(pbc$edema,levels=c("0","0.5","1"),labels=c("0","0.5","1"))
uni.hr <- coxphSeries(Surv(time,status==2)~1,vars=c("edema","bili","protime"),data=pbc)
uni.hr
## control the logistic regression analyses for age and gender
## but collect only information on the variables in `vars'.
controlled.hr <- coxphSeries(Surv(time,status==2)~age+sex,vars=c("edema","bili","protime"),data=pbc)
controlled.hr