Skip to contents

Hazard-ratio table from Cox model components

Usage

hazard_ratio_table(
  params,
  se,
  pvalues,
  confidence = 0.95,
  digits = 3L,
  apa = FALSE,
  output_format = "dataframe",
  title = "Hazard Ratios"
)

Arguments

params

Named numeric vector of log-HR coefficients.

se

Named numeric vector of standard errors.

pvalues

Named numeric vector of p-values.

confidence

Confidence level.

digits

Decimal places.

apa

APA formatting.

output_format

Output target.

title

Title.

Value

A character string.

Examples

params <- c(treat = 0.5, age = 0.02)
se <- c(treat = 0.1, age = 0.005)
pv <- c(treat = 0.001, age = 0.0001)
hazard_ratio_table(params, se, pv)
#>          HR         95% CI p.value  X.
#> treat 1.649 (1.355, 2.006)   0.001  **
#> age   1.020 (1.010, 1.030)  <0.001 ***