nt_multiple_cox: Proportional Hazards Cox regression table

nt_multiple_coxR Documentation

Proportional Hazards Cox regression table

Description

Tabulating results from fitted Proportional Hazards Cox models.

Usage

nt_multiple_cox(
  fit,
  ci_type = "wald",
  contrast_qt = "one-unit",
  user_contrast = NULL,
  user_contrast_interaction = NULL,
  table_reference = TRUE,
  format = TRUE,
  labels = NULL,
  digits = 2,
  digits_p = 3,
  save = FALSE,
  file = "nt_multiple_cox"
)

Arguments

fit

a coxph object.

ci_type

a character value indicating the procedure to calculate confidence intervals: likelihood ratio (lr) or wald (wald).

contrast_qt

a character value "quartiles", "one-unit", "user" to indicate the contrast for all covariates.

user_contrast

a variable named list of numerical vectors indicating contrast for a given covariate.

user_contrast_interaction

a variable named list of numerical vectors indicating a contrast for a given interaction.

table_reference

a logical value indicating whether the output should be presented with a line indicating the reference category.

format

a logical value indicating whether the output should be formatted.

labels

a list of labels with components given by their variable names.

digits

a numerical value defining of digits to present the results.

digits_p

a numerical value defining number of digits to present the p-values.

save

a logical value indicating whether the output should be saved as a csv file.

file

a character indicating the name of output file in csv format to be saved.

Examples

library(survival)
library(dplyr)

data(ovarian)
dt <- ovarian |> mutate(resid.ds = factor(resid.ds,
                                               levels = 1:2,
                                               labels = c("no", "yes")),
                             ecog.ps = factor(ecog.ps,
                                              levels = 1:2,
                                              labels  = c("I", "II")),
                             rx = factor(rx,
                                         levels = 1:2,
                                         labels = c("t1", "t2")))


fit <- coxph(Surv(futime, fustat) ~ age + ecog.ps*rx, data = dt)

nt_multiple_cox(fit)


dnzmarcio/ntimes documentation built on Feb. 5, 2025, 8:57 a.m.