
Step: Cox Proportional Hazards Model
step_cox.RdPerform survival analysis by fitting a Cox proportional hazards model
using glystats::gly_cox() for each variable.
This step identifies variables associated with survival outcomes.
Arguments
- on
Name of the experiment to run Cox regression on. Can be "exp", "sig_exp", "trait_exp", "sig_trait_exp", "motif_exp", "sig_motif_exp".
- time_col
Column name in sample information containing survival time. Default is "time".
- event_col
Column name in sample information containing event indicator (1 for event, 0 for censoring). Default is "event".
- p_adj_method
Method for adjusting p-values. See
p.adjust.methods. Default is "BH". If NULL, no adjustment is performed.- ...
Additional arguments passed to
glystats::gly_cox().
Details
Data required:
exp(ifon = "exp"): The experiment to run Cox regression ontrait_exp(ifon = "trait_exp"): The trait experiment to run Cox regression onmotif_exp(ifon = "motif_exp"): The motif experiment to run Cox regression on
The experiment must contain survival data with time_col and event_col columns
in the sample information.
Tables generated (with suffixes):
cox: A table containing Cox regression results with columns:variable: Variable namecoefficient: Regression coefficient (log hazard ratio)std.error: Standard error of the coefficientstatistic: Wald test statisticp_val: Raw p-value from Wald testhr: Hazard ratio (exp(coefficient))p_adj: Adjusted p-value (if p_adj_method is not NULL)
AI Prompt
This section is for AI in inquire_blueprint() only.
Include this step when users want to identify variables associated with survival outcomes.
This step requires survival data (time and event columns) in the sample information.
Always ask for the column names for survival data, unless explicitly provided.
Examples
step_cox()
#> <step "step_cox()"> Cox proportional hazards model
step_cox(time_col = "survival_time", event_col = "death")
#> <step "step_cox(time_col = \"survival_time\", event_col = \"death\")"> Cox
#> proportional hazards model
step_cox(on = "sig_exp", p_adj_method = "bonferroni")
#> <step "step_cox(on = \"sig_exp\", p_adj_method = \"bonferroni\")"> Cox
#> proportional hazards model of significant variables