Skip to contents

Fits an auto-stratified Cox proportional hazards regression: rather than the plain single-baseline-hazard model of InferenceSurvivalCoxPHRegr, this class allows a separate baseline hazard per stratum, \(\lambda(t \mid x_i, s_i) = \lambda_{0,s_i}(t) \exp(x_i^\top\beta)\), relaxing the proportional-hazards assumption across strata while keeping it within each. Stratification variables are chosen automatically from the recorded low-cardinality (categorical-like) covariates (compute_survival_strata_ids_cpp) — no stratification variables are specified explicitly by the caller. If no suitable stratification covariates are found, the fit falls back to the corresponding standard (unstratified) Cox PH model. Fitting uses survival::coxph.fit()/survival::coxph() with strata passed through when applicable. This is a partial-likelihood class (likelihood_tier = "partial") supporting Wald, score, gradient, and likelihood-ratio tests, plus parametric likelihood-ratio bootstrap calibration. Randomization confidence intervals are not supported (the log-hazard-ratio estimator units are not commensurate with the randomization CI bisection algorithm's log-time-ratio/AFT-effect null search).

Super class

Inference -> InferenceSurvivalStratCoxPHRegr

Methods

+ inherited public methods from Inference


InferenceSurvivalStratCoxPHRegr$new()

Uses the shared randomization two-sided p-value contract; see InferenceRand. Pinned from InferenceRand for the same traced reason as InferenceSurvivalCoxPHRegr (see that factory call's comment): InferenceRandCI's richer override calls super$...(), which resolves against Inference once flattened, and its only other behavior is an incidence-only Zhang special case that never applies to survival data.

Initialize stratified Cox proportional-hazards inference and prepare the partial-likelihood fit used by InferenceSurvivalStratCoxPHRegr.

Usage

InferenceSurvivalStratCoxPHRegr$new(
  des_obj,
  model_formula = NULL,
  use_rcpp = TRUE,
  optimization_alg = "lbfgs",
  verbose = FALSE,
  smart_cold_start_default = NULL
)

Arguments

des_obj

A completed Design object with a survival response.

model_formula

Optional formula for covariate adjustment. If NULL (default), covariates from the design object are included. Use ~ 1 for univariate.

use_rcpp

Logical. If TRUE (default), enable internal Rcpp score/information helpers for likelihood inference. Cox optimization uses survival::coxph.fit.

optimization_alg

Optimization algorithm: "newton_raphson" (default) or "lbfgs".

verbose

Whether to print progress messages.

smart_cold_start_default

Whether to use smart cold start values.


InferenceSurvivalStratCoxPHRegr$compute_asymp_confidence_interval()

Computes an asymptotic confidence interval using the configured likelihood-backed test.

Usage

InferenceSurvivalStratCoxPHRegr$compute_asymp_confidence_interval(alpha = 0.05)

Arguments

alpha

Significance level 1 - alpha. Default 0.05.


InferenceSurvivalStratCoxPHRegr$compute_asymp_two_sided_pval()

Computes an asymptotic two-sided p-value using the configured likelihood-backed test.

Usage

InferenceSurvivalStratCoxPHRegr$compute_asymp_two_sided_pval(delta = 0)

Arguments

delta

Null treatment effect to test against. Default 0.


InferenceSurvivalStratCoxPHRegr$compute_estimate_with_bootstrap_weights()

Recomputes the stratified Cox PH treatment estimate under Bayesian-bootstrap weights.

Usage

InferenceSurvivalStratCoxPHRegr$compute_estimate_with_bootstrap_weights(
  subject_or_block_weights,
  estimate_only = FALSE
)

Arguments

subject_or_block_weights

Subject-, block-, cluster-, or matched-set bootstrap weights.

estimate_only

If TRUE, compute only the weighted point estimate.


InferenceSurvivalStratCoxPHRegr$compute_rand_confidence_interval()

Compute a randomization-based confidence interval for the stratified Cox treatment effect by inverting the class-specific randomization p-value. See InferenceRandCI.

Usage

InferenceSurvivalStratCoxPHRegr$compute_rand_confidence_interval(
  alpha = 0.05,
  r = 501,
  pval_epsilon = 0.005,
  show_progress = TRUE,
  ci_search_control = NULL
)

Arguments

alpha

The significance level (default 0.05).

r

Number of vectors to draw.

pval_epsilon

The bisection convergence tolerance.

show_progress

Whether to show a progress bar.

ci_search_control

Unused.


InferenceSurvivalStratCoxPHRegr$clone()

The objects of this class are cloneable with this method.

Usage

InferenceSurvivalStratCoxPHRegr$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples