Nice output from Cox regression object
coxphOut.Rd
Nicely formatted output from a Cox regression object, either coxph
or
coxphf
.
Value
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
coef
- Z-Score
Wald test statistic
- P-value
p-value for
Z-Score
- HR
hazard ratio
- Lower CI Limit
Defaults to
2.5 \%
- Upper CI Limit
Defaults to
97.5 \%
Details
For objects of class coxphf
, the calculation of the number of events
used in the fit is slightly different.
Examples
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)
#> n events coef se Z-Score P-value HR 2.5 % 97.5 %
#> x 7 5 0.8 0.82 0.98 0.33 2.23 0.45 11.18
# Not stratified
mod2 <- coxph(Surv(time, status) ~ x + sex, test1)
coxphOut(mod2, coefnames = c("x", "gender"))
#> n events coef se Z-Score P-value HR 2.5 % 97.5 %
#> x 7 5 0.78 0.80 0.98 0.33 2.18 0.46 10.43
#> gender 7 5 0.93 1.41 0.66 0.51 2.54 0.16 40.19