KaplanMeierRegression

Kaplan-Meier regression family for associate$regression()

Description

KaplanMeierRegression fits grouped Kaplan-Meier curves and reports omnibus log-rank statistics in the summary table. Group-specific curve steps, risk tables, and group summaries are exposed through artifacts.

This family is intentionally different from coefficient-based models: the summary table contains one omnibus log-rank row per fit, while the detailed group-specific survival information lives in artifacts.

Summary rows follow the km association schema. Artifacts include observed.curves, risk.table, and group.summary.

Super class

PolyGenius::RegressionFamily -> KaplanMeierRegression

Methods

Public methods

Inherited methods

Method new()

Register the canonical family key used by the engine and summary rows.

Usage
KaplanMeierRegression$new()
Returns

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


Method validate.frame()

Ensure the input is already grouped and includes exactly one survival time column.

Usage
KaplanMeierRegression$validate.frame(frame, cell, fit.specs, conf.level)
Arguments
frame

Resolved analysis frame restricted to the current fit cell.

cell

Named list describing the current fit-grid cell.

fit.specs

Additional family-specific fitting arguments.

conf.level

Confidence level for intervals.

Returns

Invisibly TRUE when the Kaplan-Meier inputs are valid.


Method prepare.frame()

Build the complete-case grouped survival payload for one Kaplan-Meier fit.

Usage
KaplanMeierRegression$prepare.frame(frame, cell, fit.specs, conf.level)
Arguments
frame

Resolved analysis frame restricted to the current fit cell.

cell

Named list describing the current fit-grid cell.

fit.specs

Additional family-specific fitting arguments.

conf.level

Confidence level for intervals.

Returns

A compact list with grouped survival data and retained row ids.


Method build.formula()

Build the Kaplan-Meier grouping formula for one fit payload.

Usage
KaplanMeierRegression$build.formula(frame)
Arguments
frame

Fit payload returned by prepare.frame().

Returns

A model formula object.


Method fit.model()

Fit both the survival curves and the omnibus log-rank comparison.

Usage
KaplanMeierRegression$fit.model(formula, frame, ...)
Arguments
formula

Model formula returned by build.formula().

frame

Family-specific payload returned by prepare.frame().

Additional family-specific fitting arguments.

Returns

A list with survfit and survdiff results.


Method build.summary.rows()

Report a single omnibus log-rank row in the regression summary table.

Usage
KaplanMeierRegression$build.summary.rows(
  fit,
  fit.data,
  cell,
  fit.specs,
  conf.level,
  formula
)
Arguments
fit

List containing survfit and survdiff outputs.

fit.data

Family-specific payload returned by prepare.frame().

cell

Named list describing the current fit-grid cell.

fit.specs

Additional family-specific fitting arguments.

conf.level

Confidence level for intervals.

formula

Display formula string.

Returns

A one-row data.frame describing the omnibus log-rank result.


Method build.artifacts()

Return curve, risk-table, group-summary, and profile artifacts for plotting.

Usage
KaplanMeierRegression$build.artifacts(
  fit,
  fit.data,
  cell,
  fit.specs,
  conf.level,
  formula
)
Arguments
fit

List containing survfit and survdiff outputs.

fit.data

Family-specific payload returned by prepare.frame().

cell

Named list describing the current fit-grid cell.

fit.specs

Additional family-specific fitting arguments.

conf.level

Confidence level for intervals.

formula

Display formula string.

Returns

A named list of Kaplan-Meier plotting artifacts.


Method clone()

The objects of this class are cloneable with this method.

Usage
KaplanMeierRegression$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.