I ran univariate cox regression model using following code.
res <- coxph(Surv(DFS, DFS.Event) ~ Grade, data = Grade)
summary(res)
It output as follows:
Call:
coxph(formula = Surv(DFS, DFS.Event) ~ Grade, data = Grade)
n= 172, number of events= 38
(12 observations deleted due to missingness)
coef exp(coef) se(coef) z Pr(>|z|)
GradeGrade2 1.153 3.167 1.026 1.123 0.261
GradeGrade3 1.006 2.736 1.028 0.979 0.327
exp(coef) exp(-coef) lower .95 upper .95
GradeGrade2 3.167 0.3158 0.4237 23.67
GradeGrade3 2.736 0.3655 0.3651 20.50
Concordance= 0.539 (se = 0.04 )
Likelihood ratio test= 1.82 on 2 df, p=0.4
Wald test = 1.34 on 2 df, p=0.5
Score (logrank) test = 1.45 on 2 df, p=0.5
I want to convert the output into a dataframe. My expected output is:
Variable coef exp(coef) se(coef) z p lower 0.95 upper 0.95
GradeGrade2 1.153 3.167 1.026 1.123 0.261 0.4237 23.67
GradeGrade3 1.006 2.736 1.028 0.979 0.327 0.3651 20.5
broompackage'stidymethod should do the trick.