Skip to contents

Cox regression with additive model with interaction

Usage

wrapper_cox_regression_core_interaction(
  data,
  tte_var,
  censor_var,
  interaction1_vars,
  interaction2_var,
  covariate_vars = NULL,
  strata_vars = NULL,
  keep_obs = TRUE,
  variable_names = NULL,
  caption = NULL,
  print_pvalues = TRUE,
  print_adjpvalues = TRUE
)

wrapper_cox_regression_core_interaction_strat(
  data,
  tte_var,
  censor_var,
  interaction1_vars,
  interaction2_var,
  covariate_vars = NULL,
  strata_vars = NULL,
  strat1_var = NULL,
  strat2_var = NULL,
  variable_names = NULL,
  caption = NULL,
  print_pvalues = TRUE,
  print_adjpvalues = TRUE
)

Arguments

data

Data frame.

tte_var

Name of the time-to-event variable. This variable must be numeric.

censor_var

Name of the censor variable. It has to be numeric and encode 1 for event and 0 for censor.

interaction1_vars

Names of the first interaction variables. They would correspond to biomarkers.

interaction2_var

Name of the second interaction variable. It would correspond to the treatment arm.

covariate_vars

Vector with names of covariates that are included in the formula of the simple additive model: `~ covariate_vars[1] + covariate_vars[2] + covariate_vars[3] + ....`

strata_vars

Vector with names of covariates that are used as strata.

variable_names

Named vector with variable names. If not supplied, variable names are created by replacing in column names underscores with spaces.

caption

Caption for the table with results.

print_pvalues

Logical. Whether to print p-values.

print_adjpvalues

Logical. Whether to print adjusted p-values.

strat1_var

Name of the second stratification variable.

strat2_var

Name of the second stratification variable used for splitting the data.

Examples


data(bdata)

data <- bdata

data$GeneA_cat2 <- wrapper_cut_2groups(data$GeneA)
data$GeneB_cat2 <- wrapper_cut_2groups(data$GeneB)

tte_var <- "PFS"
censor_var <- "PFS_Event"

interaction1_vars <- c("GeneA_cat2", "GeneB_cat2")
interaction2_var <- "Treatment_Arm"
covariate_vars <- c("IPI", "Cell_Of_Origin")

x <- wrapper_cox_regression_core_interaction(data, tte_var = tte_var, censor_var = censor_var, interaction1_vars = interaction1_vars, interaction2_var = interaction2_var, covariate_vars = covariate_vars)

boutput(x)
#>   Covariate1     Effect1    Covariate2     Effect2 Total N   HR     HR 95% CI
#> 1 GeneA cat2 high vs low Treatment Arm TRT vs CTRL     391 1.02 (0.54 - 1.91)
#> 2 GeneB cat2 high vs low Treatment Arm TRT vs CTRL     391 0.66 (0.35 - 1.25)
#>   P-value Adj. P-value
#> 1  0.9595       0.9595
#> 2  0.2000       0.4000