| zph_phregr | R Documentation |
Obtains the scaled Schoenfeld residuals and tests the proportional hazards assumption using a score test for the interaction between each covariate and a transformed time variable.
zph_phregr(object, transform = "km")
object |
The output from the |
transform |
A character string indicating how survival times should be transformed before the test is performed. Supported values include "identity", "log", "rank", and "km" (default). |
This corresponds to the cox.zph function from the survival
package with terms = FALSE and global = TRUE.
A list with the following components:
table A matrix with one row for each parameter and a final
row for the global test. The columns contain the score test
for adding the time-dependent term, the degrees of freedom,
and the two-sided p-value.
x The transformed time values.
time The original (untransformed) event times, with tied event
times repeated.
strata The stratum index for each event.
y The matrix of scaled Schoenfeld residuals, with one column
for each parameter and one row for each event. Column names correspond
to the parameter names.
var An approximate covariance matrix of the scaled Schoenfeld
residuals, used to construct an approximate standard error band for
plots.
transform the transformation applied to the time values.
Kaifeng Lu, kaifenglu@gmail.com
Patricia M. Grambsch and Terry M. Therneau. Proportional hazards tests and diagnostics based on weighted residuals. Biometrika 1994; 81:515-26.
fit <- phregr(data = liver, time = "Time", event = "Status",
covariates = c("log(Bilirubin)", "log(Protime)",
"log(Albumin)", "Age", "Edema"),
ties = "breslow")
zph <- zph_phregr(fit, transform = "log")
zph$table
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.