Skip to contents

Takes a Cox PH model object and summarizes it into a ready to export, human-readable summary table.


# S3 method for coxph
  .test = c("LRT", "Wald"),
  .col.test = FALSE,
  .level = 0.95,
  .stat.pct.sign = TRUE,
  .digits = 1,
  .p.digits = 4



An object of class coxph.


One or more unquoted expressions separated by commas representing columns in the data.frame. May be specified using tidyselect helpers. If left empty, all terms are summarized.


A character. The name of the stats::drop1 test to use with the model. Supported tests include Wald's Test ('Wald') and Likelihood Ratio Test ('LRT').


A logical. Append a columns for the test and accompanying statistic used to derive the p-value.


A double. The confidence level required.


A logical. Paste a percent symbol after all reported frequencies.


An integer. The number of digits to round numbers to.


An integer. The number of p-value digits to report. Note that the p-value still rounded to the number of digits specified in .digits.


An object of class tbl_df (tibble) summarizing the provided object.

See also



data_lung <- lung |>
  mutate_at(vars(inst, status, sex), as.factor) |>
  mutate(status = case_when(status == 1 ~ 0, status == 2 ~ 1))

fit <- coxph(Surv(time, status) ~ sex +, data = data_lung)

fit |> build_table(Sex = sex, Calories =, .test = 'LRT')
#> Error in eval(.object$call$data): object 'data_lung' not found