How to check proportional hazards assumption?
The proportional hazards (PH) assumption can be checked using statistical tests and graphical diagnostics based on the scaled Schoenfeld residuals. In principle, the Schoenfeld residuals are independent of time. A plot that shows a non-random pattern against time is evidence of violation of the PH assumption.
What are deviance residuals?
In R, the deviance residuals represent the contributions of individual samples to the deviance D. More specifically, they are defined as the signed square roots of the unit deviances. However, while the sum of squares is the residual sum of squares for linear models, for GLMs, this is the deviance.
How to calculate residuals for a Schoenfeld fit?
For score residuals it is a matrix with one row per subject and one column per variable. The row order will match the input data for the original fit. For Schoenfeld residuals, the returned object is a matrix with one row for each event and one column per variable.
How are the Schoenfeld residuals used in coxph?
For Schoenfeld residuals, the returned object is a matrix with one row for each event and one column per variable. The rows are ordered by time within strata, and an attribute strata is attached that contains the number of observations in each strata. The scaled Schoenfeld residuals are used in the cox.zph function.
How to calculate Resid function in applied survival analysis?
First we use the coxph function to obtain a cox model object. Then we can apply the resid function to the cox model object and obtain the score residuals by specifying the option type to equal “score”. The object score is a matrix and the columns of the matrix are the score residuals for the predictors in the cox model.
How are residuals calculated for martingale and deviance?
For martingale and deviance residuals, the returned object is a vector with one element for each subject (without collapse ). For score residuals it is a matrix with one row per subject and one column per variable. The row order will match the input data for the original fit.