interaction_scan {clinpubr} | R Documentation |
Scan for interactions between variables
Description
Scan for interactions between variables and output results. Both logistic and Cox proportional hazards regression models are supported. The predictor variables in the model are can be used both in linear form or in restricted cubic spline form.
Usage
interaction_scan(
data,
y,
time = NULL,
predictors = NULL,
group_vars = NULL,
covars = NULL,
try_rcs = TRUE,
p_adjust_method = "BH",
save_table = FALSE,
filename = NULL
)
Arguments
data |
A data frame. |
y |
A character string of the outcome variable. |
time |
A character string of the time variable. If |
predictors |
The predictor variables to be scanned for interactions. If |
group_vars |
The group variables to be scanned for interactions. If |
covars |
A character vector of covariate names. |
try_rcs |
A logical value indicating whether to perform restricted cubic spline interaction analysis. |
p_adjust_method |
The method to use for p-value adjustment for pairwise comparison. Default is "BH".
See |
save_table |
A logical value indicating whether to save the results as a table. |
filename |
The name of the file to save the results. File will be saved in |
Value
A data frame containing the results of the interaction analysis.
Examples
data(cancer, package = "survival")
interaction_scan(cancer, y = "status", time = "time", save_table = FALSE)