CoxComparison

Cox-model comparison family

Description

CoxComparison implements nested, heterogeneity, group, and pairwise comparison workflows for right-censored survival outcomes using survival::coxph().

Summary rows follow associate.schema.comparison. Survival artifacts use the same curves, risk.table, and group.summary names as survival regression.

Super class

PolyGenius::ComparisonFamily -> CoxComparison

Methods

Public methods

Inherited methods

Method new()

Register the canonical family key for Cox comparisons.

Usage
CoxComparison$new()
Returns

The initialized family object with family.name = “cox”.


Method prepare.frame()

Build the complete-case right-censored comparison frame for one Cox comparison cell.

Usage
CoxComparison$prepare.frame(frame, cell, options)
Arguments
frame

Resolved analysis frame restricted to the current fit cell.

cell

Named list describing the current fit-grid cell.

options

Normalized comparison options from the engine.

Returns

A plain data frame ready for survival::coxph().


Method validate.frame()

Validate the resolved frame for the requested Cox comparison type.

Usage
CoxComparison$validate.frame(frame, cell, options)
Arguments
frame

Resolved analysis frame restricted to the current fit cell.

cell

Named list describing the current fit-grid cell.

options

Normalized comparison options from the engine.

Returns

Invisibly TRUE when the frame is compatible with the requested comparison.


Method fit.comparison()

Fit the base and full Cox models required by the requested comparison.

Usage
CoxComparison$fit.comparison(frame, cell, options, ...)
Arguments
frame

Prepared comparison frame returned by prepare.frame().

cell

Named list describing the current fit-grid cell.

options

Normalized comparison options from the engine.

Additional fitting arguments passed to survival::coxph().

Returns

A named list of fitted Cox model objects and comparison metadata.


Method build.summary.rows()

Convert fitted Cox comparison objects to shared comparison-schema rows.

Usage
CoxComparison$build.summary.rows(fit, frame, cell, options)
Arguments
fit

Fitted comparison object returned by fit.comparison().

frame

Prepared comparison frame.

cell

Named list describing the current fit-grid cell.

options

Normalized comparison options from the engine.

Returns

A data.table of rows following associate.schema.comparison.


Method build.artifacts()

Return grouped survival-curve artifacts for downstream visualization.

Usage
CoxComparison$build.artifacts(fit, frame, cell, options)
Arguments
fit

Fitted comparison object returned by fit.comparison().

frame

Prepared comparison frame.

cell

Named list describing the current fit-grid cell.

options

Normalized comparison options from the engine.

Returns

A named list with curves, risk.table, and group.summary.


Method clone()

The objects of this class are cloneable with this method.

Usage
CoxComparison$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.