
Stratified Cox PH Inference for Survival Responses
Source:R/inference_survival_strat_cox.R
InferenceSurvivalStratCoxPHRegr.RdFits 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
Public methods
+ inherited public methods from Inference
Inference$capabilities()Inference$compute_estimate()Inference$compute_exact_confidence_interval()Inference$compute_exact_two_sided_pval_for_treatment_effect()Inference$duplicate()Inference$get_analysis_data()Inference$get_covariates()Inference$get_design_object()Inference$get_model_formula()Inference$get_nonestimable_reason()Inference$get_nonestimable_stage()Inference$get_optimization_alg()Inference$get_response()Inference$get_response_type()Inference$get_treatment()Inference$is_nonestimable()Inference$set_optimization_alg()Inference$set_seed()Inference$supports()
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_objA completed
Designobject with a survival response.model_formulaOptional formula for covariate adjustment. If
NULL(default), covariates from the design object are included. Use~ 1for univariate.use_rcppLogical. If
TRUE(default), enable internal Rcpp score/information helpers for likelihood inference. Cox optimization uses survival::coxph.fit.optimization_algOptimization algorithm:
"newton_raphson"(default) or"lbfgs".verboseWhether to print progress messages.
smart_cold_start_defaultWhether to use smart cold start values.
InferenceSurvivalStratCoxPHRegr$compute_asymp_confidence_interval()
Computes an asymptotic confidence interval using the configured likelihood-backed test.
InferenceSurvivalStratCoxPHRegr$compute_asymp_two_sided_pval()
Computes an asymptotic two-sided p-value using the configured likelihood-backed test.
InferenceSurvivalStratCoxPHRegr$compute_estimate_with_bootstrap_weights()
Recomputes the stratified Cox PH treatment estimate under Bayesian-bootstrap weights.
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.