Description Usage Arguments Value Author(s) Examples
Generate a LaTeX table of a coxph
object. To be used in a Sweave document.
1 | displayCoxPH(mod, cap = "", lab = "mod", dig.coef = 2, dig.p = 1)
|
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 p-values. |
Returns a LaTeX table containing columns with the estimated coefficients, hazard ratios, 95 percent confidence intervals for the hazard ratios and the p-values.
Kaspar Rufibach (maintainer), kaspar.rufibach@gmail.com,
http://www.kasparrufibach.ch
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.