
Marginal Event Probability / Relative Hazard Diagnostic Plot
Source:R/plot_cox.R
plot_cox_marginal.RdPlots a continuous predictor against a model-derived curve, with a 95
for scale = "prob", overlaid actual binary event observations.
Usage
plot_cox_marginal(
fit,
data,
feature = NULL,
status_col = "status",
scale = c("prob", "hr", "log_hr"),
color = "#9D2235",
base_size = 12
)Arguments
- fit
A fitted
survival::coxphmodel or acbe_coxobject.- data
Data frame containing survival inputs.
- feature
Character name of continuous predictor column.
- status_col
Character name of status/event column (0 = censored, 1 = event; default: "status"). Only used when
scale = "prob".- scale
One of
"prob"(default; predicted probability of the event),"hr"(relative hazard, i.e.exp()of the centered linear predictor), or"log_hr"(the centered linear predictor itself).- color
Primary color for the fitted curve and CI band (default: Temple Cherry
"#9D2235").- base_size
Base font size (default: 12).