coxphSeries: Run a series of Cox regression models

Description Usage Arguments Value Author(s) Examples

View source: R/coxphSeries.R

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

1

Arguments

formula

The fixed part of the regression formula. For univariate analyses this is simply Surv(time,status)~1 where Surv(time,status) is the outcome variable. When the aim is to control the effect of vars in each element of the series by a fixed set of variables it is Surv(time,status)~x1+x2 where again Surv(time,status) is the outcome and x1 and x2 are confounders.

data

A data.frame in which the formula gets evaluated.

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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

Publish documentation built on Jan. 8, 2021, 5:37 p.m.