Test the proportional hazards assumption for a Cox regression model fit
(
coxph).
USAGE:
cox.zph(fit, transform="km", global=T)
REQUIRED ARGUMENTS:
fit
the result of fitting a Cox regression model, using the
coxph function.
OPTIONAL ARGUMENTS:
transform
a character string specifying how the survival times should be transformed
before the test is performed.
Possible values are
"km",
"rank",
"identity" or a
function of one argument.
global
should a global chi-square test be done, in addition to the
per-variable tests.
x
a logical value. If
TRUE, then the result is
a list containing the test table (a matrix), x and y. If
FALSE, then only the test table is returned.
VALUE:
an object of class
"cox.zph", with components:
table
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-value.
For the global test there is no appropriate correlation, so an
NA
is
entered into the matrix as a placeholder.
x
the transformed time axis.
y
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, which will be the same as
x for the identity transform.
call
the calling sequence for the routine.
The computations require the original
x matrix of the Cox model fit.
Thus it saves time if the
x=T option is used in
coxph.
This function would usually be followed by both a plot and a print of
the result.
The plot gives an estimate of the time-dependent coefficient beta(t).
If the proportional hazards assumption is true, beta(t) will be a
horizontal line. The printout gives a test for slope=0.
REFERENCES:
Grambsch, P. and Therneau, T. (1994),
Proportional hazards tests and diagnostics based on weighted residuals.
Biometrika,81, 515-26.
SEE ALSO:
,
.
EXAMPLES:
fit <- coxph(Surv(futime, fustat) ~ age + ecog.ps,
data=ovarian, x=T)
temp <- cox.zph(fit)
print(temp) # display the results
plot(temp) # plot curves