coxphOut | R Documentation |
Nicely formatted output from a Cox regression object, either coxph
or
coxphf
.
coxphOut(object, coefnames = NULL, conf.level = 0.95, digits = 2)
object |
a model fit object returned from |
coefnames |
a vector of labels for the coefficient names returned by the
fit. |
conf.level |
confidence level for hazard ratio. Defaults to 95%. |
digits |
number of digits to round to |
For objects of class coxphf
, the calculation of the number of events
used in the fit is slightly different.
A matrix with a row for each coefficient, and a column for each of the following elements
n |
the number of observations used in the fit. |
events |
the number of events used in the fit. |
coef |
log hazard ratio |
se |
standard error of |
Z-Score |
Wald test statistic |
P-value |
p-value for |
HR |
hazard ratio |
Lower CI Limit |
Defaults to |
Upper CI Limit |
Defaults to |
Aline Talhouk, Derek Chiu
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))
# Stratified
mod1 <- coxph(Surv(time, status) ~ x + strata(sex), test1)
coxphOut(mod1)
# Not stratified
mod2 <- coxph(Surv(time, status) ~ x + sex, test1)
coxphOut(mod2, coefnames = c("x", "gender"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.