assess_phregr: Assess Proportional Hazards Assumption Based on Supremum Test

View source: R/assess_phregr.R

assess_phregrR Documentation

Assess Proportional Hazards Assumption Based on Supremum Test

Description

Obtains the standardized score processes and the simulated distribution under the null hypothesis as well as the p-values for the supremum tests.

Usage

assess_phregr(object, resample = 1000, seed = 12345)

Arguments

object

The output from the phregr call.

resample

The number of simulation samples for the supremem test.

seed

The random seed for the simulations.

Details

The supremum test corresponds to the ASSESS statement with ph option of SAS PROC PHREG.

Value

A list with the following components:

  • time the unique event times.

  • score_t the observed standardized score process.

  • score_t_list a list of simulated standardized score processes under the null hypothesis.

  • max_abs_value the supremum of the absolute value of the observed standardized score process for each covariate and the supremum of the sum of absolute values of the observed standardized score processes across all covariates.

  • p_value the p-values for the supremum tests for each covariate and the global test.

Author(s)

Kaifeng Lu, kaifenglu@gmail.com

References

D. Y. Lin, L. J. Wei, and Z. Ying. Checking the Cox model with cumulative sums of martingale-based residuals. Biometrika 1993; 80:557-572.

Examples


fit <- phregr(data = liver, time = "Time", event = "Status", 
              covariates = c("log(Bilirubin)", "log(Protime)", 
                             "log(Albumin)", "Age", "Edema"),
              ties = "breslow")
              
aph <- assess_phregr(fit, resample = 1000, seed = 314159)
  
aph

plot(aph, nsim = 20)


trtswitch documentation built on Jan. 10, 2026, 5:08 p.m.