toHR: Function to transform a fit object from cox regression into...

View source: R/toHR.R

toHRR Documentation

Function to transform a fit object from cox regression into an HR table

Usage

toHR(fit, digits = 2)

Arguments

fit

an object of class coxph representing the fit. See coxph.object for details.

digits

integer indicating the number of decimal places (round) or significant digits (signif) to be used. Negative values are allowed (see Details).

Examples

test1 <- list(time=c(4,3,1,1,2,2,3),
              status=c(1,1,1,0,1,1,0),
              x=c(0,2,1,1,1,0,0),
              sex=c(0,0,0,0,1,1,1))
# Fit a stratified model
coxph.ex = coxph(Surv(time, status) ~ x + strata(sex), test1)

toHR(coxph.ex, digits = 2)



douve/UEMR documentation built on Aug. 28, 2023, 2:30 p.m.