estimate_censoring_score_cox: Estimate Censoring Scores Using Cox Regression

View source: R/U04-censoring-scores.R

estimate_censoring_score_coxR Documentation

Estimate Censoring Scores Using Cox Regression

Description

Estimate Censoring Scores Using Cox Regression

Usage

estimate_censoring_score_cox(
  data,
  time_var,
  treatment_var,
  formula,
  control = list(),
  ties = "efron"
)

Arguments

data

Data frame.

time_var

Name of time variable.

treatment_var

Name of treatment variable.

formula

Censoring model formula. Use Surv(time, censor_indicator) ~ X1 + X2 where censor_indicator = 1 indicates censoring. If event is coded canonically (event=1, censored=0), use I(1-event). Otherwise, use the appropriate transformation. Treatment is automatically removed if included.

control

Control parameters for coxph(). Default list().

ties

Tie handling method. Default "efron".

Details

Fits Cox models within each treatment group. Censoring scores computed as:

K_c^{(j)}(t, X) = \exp(-H_0^{(j)}(t) \cdot \exp(\beta_j' X))

where H_0^{(j)}(t) is cumulative baseline hazard. Baseline hazards evaluated at nearest time point for each individual.

Value

List with class "censoring_score_cox":

censoring_models

Fitted coxph objects by treatment level.

censoring_scores

P(C >= T_i | Z_i, X_i) for observed treatment.

censoring_matrix

(n x J) matrix of P(C >= T_i | Z=j, X_i).

n_levels

Number of treatment levels.

treatment_levels

Sorted treatment values.

model_type

"cox".

baseline_hazards

Baseline cumulative hazards by treatment level.

coef_list

Coefficient vectors by treatment level.

vcov_list

Variance-covariance matrices by treatment level.

linear_predictors_matrix

(n x J) matrix of linear predictors.


PSsurvival documentation built on Dec. 9, 2025, 9:07 a.m.