coxphSeries | R Documentation |
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.
coxphSeries(formula, data, vars, ...)
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 |
matrix with results
Thomas Alexander Gerds
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.