CoxRegression
Cox-regression family for associate$regression()
Description
CoxRegression implements right-censored Cox proportional-hazards models. It supports covariates, split.by through the engine fit grid, and predictor-by-modifier interactions in the Cox formula.
In the user-facing associate$regression() call, outcomes is the biological or clinical endpoint being modeled and is supplied as the event indicator. time is the observed age or follow-up time at endpoint or censoring.
Summary rows follow the cox association schema on the log-hazard scale. Returned artifacts are:
-
observed.curves, the overall observed survival curve for the fit cell -
predicted.curves, adjusted survival curves for predictor profiles -
prediction.grid, the profile values used for adjusted curves -
risk.table, the plotting-ready risk table -
group.summary, survival summary values for the analysis curve
Super class
PolyGenius::RegressionFamily -> CoxRegression
Methods
Public methods
Inherited methods
Method new()
Register the canonical family key used by the engine.
Usage
CoxRegression$new()
Returns
The initialized family object with family.name = “cox”.
Method validate.frame()
Ensure one survival time column is available.
Usage
CoxRegression$validate.frame(frame, cell, fit.specs, conf.level)
Arguments
-
frame -
Cell-specific
PolyGeniusFrame. -
cell -
Named fit-grid cell.
-
fit.specs -
Additional family-specific fitting arguments.
-
conf.level -
Confidence level for intervals.
Returns
Invisibly TRUE when validation succeeds.
Method prepare.frame()
Build the complete-case Cox fit payload.
Usage
CoxRegression$prepare.frame(frame, cell, fit.specs, conf.level)
Arguments
-
frame -
Cell-specific
PolyGeniusFrame. -
cell -
Named fit-grid cell.
-
fit.specs -
Additional family-specific fitting arguments.
-
conf.level -
Confidence level for intervals.
Returns
A model-ready survival fit payload.
Method build.formula()
Build the Cox formula for one fit payload.
Usage
CoxRegression$build.formula(frame)
Arguments
-
frame -
Fit payload returned by
prepare.frame().
Returns
A model formula object.
Method fit.model()
Fit the Cox proportional-hazards model for one cell.
Usage
CoxRegression$fit.model(formula, frame, ...)
Arguments
-
formula -
Model formula returned by
build.formula(). -
frame -
Fit payload returned by
prepare.frame(). -
… -
Additional arguments passed to
survival::coxph().
Returns
A fitted survival::coxph object.
Method build.summary.rows()
Convert fitted Cox coefficients to regression-schema rows.
Usage
CoxRegression$build.summary.rows( fit, fit.data, cell, fit.specs, conf.level, formula )
Arguments
-
fit -
Fitted
survival::coxphobject. -
fit.data -
Fit payload returned by
prepare.frame(). -
cell -
Named fit-grid cell.
-
fit.specs -
Additional family-specific fitting arguments.
-
conf.level -
Confidence level for intervals.
-
formula -
Display formula string.
Returns
A data.table following the concrete association schema.
Method build.artifacts()
Return observed and adjusted survival-curve artifacts.
Usage
CoxRegression$build.artifacts( fit, fit.data, cell, fit.specs, conf.level, formula )
Arguments
-
fit -
Fitted
survival::coxphobject. -
fit.data -
Fit payload returned by
prepare.frame(). -
cell -
Named fit-grid cell.
-
fit.specs -
Additional family-specific fitting arguments.
-
conf.level -
Confidence level for intervals.
-
formula -
Display formula string.
Returns
A named list with observed curves, predicted curves, prediction profiles, risk table, and group summary.
Method clone()
The objects of this class are cloneable with this method.
Usage
CoxRegression$clone(deep = FALSE)
Arguments
-
deep -
Whether to make a deep clone.