CompetingRiskRegression
Fine-Gray regression family for associate$regression()
Description
CompetingRiskRegression implements Fine-Gray subdistribution-hazards models through the suggested {cmprsk} package.
The class prepares a competing-risk analysis frame, converts the event and competing indicators to the status coding required by {cmprsk}, fits the Fine-Gray model, extracts predictor coefficient rows on the log-subdistribution-hazard scale, and derives analysis-level cumulative-incidence artifacts for downstream plotting.
In the user-facing associate$regression() call, outcomes is the biological or clinical endpoint being modeled and is supplied as the event indicator for the event of interest. time is the observed age or follow-up time at endpoint, competing event, or censoring. competing is the separate indicator for an event that prevents later observation of the endpoint. A dementia-onset analysis with death before dementia therefore uses dementia onset as outcomes, age at onset/death/last observation as time, and non-demented death as competing.
Summary rows follow the crr association schema. Competing-risk artifacts include observed.curves, predicted.curves, prediction.grid, and group.summary.
Super class
PolyGenius::RegressionFamily -> CompetingRiskRegression
Methods
Public methods
Inherited methods
Method new()
Register the canonical family key used by the engine and summary rows.
Usage
CompetingRiskRegression$new()
Returns
The initialized family object with family.name = “crr”.
Method validate.frame()
Validate competing-risk-specific inputs and package availability.
Usage
CompetingRiskRegression$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 Fine-Gray inputs are valid.
Method prepare.frame()
Build the complete-case competing-risk payload and design matrix for one fit.
Usage
CompetingRiskRegression$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 raw data, design matrix, and retained row ids.
Method build.formula()
Build the symbolic Fine-Gray formula for one fit payload.
Usage
CompetingRiskRegression$build.formula(frame)
Arguments
-
frame -
Fit payload returned by
prepare.frame().
Returns
A model formula object.
Method fit.model()
Fit the Fine-Gray regression using the prepared payload.
Usage
CompetingRiskRegression$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 fitted cmprsk::crr object.
Method build.summary.rows()
Convert fitted Fine-Gray coefficients to standardized regression summary rows.
Usage
CompetingRiskRegression$build.summary.rows( fit, fit.data, cell, fit.specs, conf.level, formula )
Arguments
-
fit -
Fitted
cmprsk::crrobject. -
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 data.table of regression summary rows for the focal predictor.
Method build.artifacts()
Return observed and adjusted cumulative-incidence artifacts.
Usage
CompetingRiskRegression$build.artifacts( fit, fit.data, cell, fit.specs, conf.level, formula )
Arguments
-
fit -
Fitted
cmprsk::crrobject. -
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 observed curves, predicted curves, prediction profiles, and group summary.
Method clone()
The objects of this class are cloneable with this method.
Usage
CompetingRiskRegression$clone(deep = FALSE)
Arguments
-
deep -
Whether to make a deep clone.