Test the Proportional Hazards Assumption of a Cox Regression
Test the proportional hazards assumption for a Cox regression model fit
cox.zph(fit, transform="km", global=T)
- the result of fitting a Cox regression model, using the
- a character string specifying how the survival times should be transformed
before the test is performed.
Possible values are
"identity"or a function of one argument.
- should a global chi-square test be done, in addition to the per-variable tests.
- if true, then the result will be a list containing the test table (a matrix),
y. If false then only the test table is returned.
- a matrix with one row for each variable, and optionally a last row for the global test. Columns of the matrix contain the correlation coefficient between transformed survival time and the scaled Schoenfeld residuals, a chi-square, and the two-sided p-valu
- the transformed time axis.
- the matrix of scaled Schoenfeld residuals. There will be one column per
variable and one row per event. The row labels contain the original event
times (for the identity transform, these will be the same as
- the calling sequence for the routine.
The computations require the original
xmatrix of the Cox model fit. Thus it saves time if the
x=Toption is used in
coxph. This function would usually be followed by both a pl
plot method requires the
P. Grambsch and T. Therneau (1994), Proportional hazards tests and diagnostics based on weighted residuals. Biometrika, 81, 515-26.
data(ovarian) fit <- coxph( Surv(futime, fustat) ~ age + rx, ovarian) temp<- cox.zph(fit) print(temp) #display the results plot(temp) #plot curves