The proportional hazards assumption is a fundamental tenet of the Cox proportional hazards
regression model. It posits that the hazard ratios between groups remain constant over time.
Violations of this assumption can lead to biased or misleading results. Thus, assessing the validity
of this assumption is crucial in survival analysis.
The function begins by validating the provided model to ensure it belongs to the Coxmos class. If
the model is valid, the function then evaluates the proportional hazards assumption using the
survival::cox.zph
function. The results of this evaluation are then visualized using the
survminer::ggcoxzph
function, producing a ggplot2
graph.
The resulting plot provides a visual representation of the Schoenfeld residuals against time,
allowing for an intuitive assessment of the proportional hazards assumption. Each variable or
factor level from the model is represented in the plot, and the global test for the proportional
hazards assumption is also provided.
This function is instrumental in ensuring the robustness and validity of survival analysis results,
offering a comprehensive visualization that aids in the interpretation and validation of the Coxmos
model's assumptions.