displayCoxPH {reporttools} | R Documentation |
Function to display a coxph() object
Description
Generate a LaTeX table of a coxph
object. To be used in a Sweave document.
Usage
displayCoxPH(mod, cap = "", lab = "mod", dig.coef = 2, dig.p = 1)
Arguments
mod |
|
cap |
The function provides an automatic caption displaying the number of observations and events in |
lab |
The LaTeX label for the generated table. |
dig.coef |
The number of significant digits for the estimated coefficients and the hazard ratios. |
dig.p |
The number of significant digits for |
Value
Returns a LaTeX table containing columns with the estimated coefficients, hazard ratios, 95 percent confidence intervals for the hazard ratios and
the p
-values.
Author(s)
Kaspar Rufibach (maintainer), kaspar.rufibach@gmail.com,
http://www.kasparrufibach.ch
Examples
## Not run:
# use example from coxph() in library 'survival'
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 coxph() model
mod1 <- coxph(Surv(time, status) ~ x + sex, data = test1)
# generate table to insert in Sweave file
m1 <- displayCoxPH(mod1)
## End(Not run)
[Package reporttools version 1.1.3 Index]