LinearComparison

Linear-model comparison family

Description

LinearComparison implements nested, heterogeneity, group, and pairwise comparison workflows for continuous outcomes using stats::lm().

Summary rows follow associate.schema.comparison.

Super class

PolyGenius::ComparisonFamily -> LinearComparison

Methods

Public methods

Inherited methods

Method new()

Register the canonical family key for linear comparisons.

Usage
LinearComparison$new(family.name = "lm")
Arguments
family.name

Canonical family key.

Returns

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


Method prepare.frame()

Build the complete-case comparison frame for one linear comparison cell.

Usage
LinearComparison$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 stats::lm().


Method validate.frame()

Validate the resolved frame for the requested linear comparison type.

Usage
LinearComparison$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 linear models required by the requested comparison.

Usage
LinearComparison$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 stats::lm().

Returns

A named list of fitted model objects and any family-specific metadata needed downstream.


Method build.summary.rows()

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

Usage
LinearComparison$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 compact model-comparison artifacts for downstream tables and visual summaries.

Usage
LinearComparison$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 containing a model.comparison artifact.


Method clone()

The objects of this class are cloneable with this method.

Usage
LinearComparison$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.