Lecture 10. Diagnostics. Statistics Survival Analysis. Presented March 1, 2016

Similar documents
Lecture 9. Statistics Survival Analysis. Presented February 23, Dan Gillen Department of Statistics University of California, Irvine

Residuals and model diagnostics

Cox s proportional hazards/regression model - model assessment

Lecture 8 Stat D. Gillen

Lecture 7 Time-dependent Covariates in Cox Regression

Analysis of Time-to-Event Data: Chapter 6 - Regression diagnostics

Goodness-Of-Fit for Cox s Regression Model. Extensions of Cox s Regression Model. Survival Analysis Fall 2004, Copenhagen

Lecture 12. Multivariate Survival Data Statistics Survival Analysis. Presented March 8, 2016

Time-dependent coefficients

The coxvc_1-1-1 package

Part [1.0] Measures of Classification Accuracy for the Prediction of Survival Times

Part III Measures of Classification Accuracy for the Prediction of Survival Times

MAS3301 / MAS8311 Biostatistics Part II: Survival

Faculty of Health Sciences. Cox regression. Torben Martinussen. Department of Biostatistics University of Copenhagen. 20. september 2012 Slide 1/51

Survival Regression Models

Survival Analysis Math 434 Fall 2011

Survival analysis in R

Chapter 4 Regression Models

Survival Analysis. STAT 526 Professor Olga Vitek

Survival analysis in R

Outline. Cox's regression model Goodness-of-t methods. Cox's proportional hazards model: Survival analysis

Proportional hazards regression

TMA 4275 Lifetime Analysis June 2004 Solution

Survival Model Predictive Accuracy and ROC Curves

Lecture 7. Proportional Hazards Model - Handling Ties and Survival Estimation Statistics Survival Analysis. Presented February 4, 2016

Lecture 11. Interval Censored and. Discrete-Time Data. Statistics Survival Analysis. Presented March 3, 2016

Exam Applied Statistical Regression. Good Luck!

REGRESSION ANALYSIS FOR TIME-TO-EVENT DATA THE PROPORTIONAL HAZARDS (COX) MODEL ST520

Lecture 6 PREDICTING SURVIVAL UNDER THE PH MODEL

Checking model assumptions with regression diagnostics

β j = coefficient of x j in the model; β = ( β1, β2,

LSS: An S-Plus/R program for the accelerated failure time model to right censored data based on least-squares principle

Relative-risk regression and model diagnostics. 16 November, 2015

Log-linearity for Cox s regression model. Thesis for the Degree Master of Science

In contrast, parametric techniques (fitting exponential or Weibull, for example) are more focussed, can handle general covariates, but require

Linear Regression. In this lecture we will study a particular type of regression model: the linear regression model

Statistical Methods III Statistics 212. Problem Set 2 - Answer Key

Chapter 7: Hypothesis testing

1 Introduction. 2 Residuals in PH model

Multistate models and recurrent event models

ADVANCED STATISTICAL ANALYSIS OF EPIDEMIOLOGICAL STUDIES. Cox s regression analysis Time dependent explanatory variables

Tied survival times; estimation of survival probabilities

ST745: Survival Analysis: Cox-PH!

Chapter 7 Fall Chapter 7 Hypothesis testing Hypotheses of interest: (A) 1-sample

Multistate models and recurrent event models

Multilevel Models in Matrix Form. Lecture 7 July 27, 2011 Advanced Multivariate Statistical Methods ICPSR Summer Session #2

Ph.D. course: Regression models

UNIVERSITY OF MASSACHUSETTS. Department of Mathematics and Statistics. Basic Exam - Applied Statistics. Tuesday, January 17, 2017

Statistics 262: Intermediate Biostatistics Non-parametric Survival Analysis

Generalized Linear Models with Functional Predictors

Chapter 1 Statistical Inference

Package hds. December 31, 2016

Survival Analysis I (CHL5209H)

Ph.D. course: Regression models. Introduction. 19 April 2012

Package shrink. August 29, 2013

4 Testing Hypotheses. 4.1 Tests in the regression setting. 4.2 Non-parametric testing of survival between groups

Ph.D. course: Regression models. Regression models. Explanatory variables. Example 1.1: Body mass index and vitamin D status

Statistics 135 Fall 2008 Final Exam

SSUI: Presentation Hints 2 My Perspective Software Examples Reliability Areas that need work

Generalized Linear Models

Variable Selection in Cox s Proportional Hazards Model Using a Parallel Genetic Algorithm

Multinomial Logistic Regression Models

Quantitative Methods for Stratified Medicine

LOGISTIC REGRESSION Joseph M. Hilbe

Section IX. Introduction to Logistic Regression for binary outcomes. Poisson regression

Philosophy and Features of the mstate package

Survival Analysis. Lu Tian and Richard Olshen Stanford University

Review of Multiple Regression

Multivariable Fractional Polynomials

Introduction to Statistical Analysis

Generalised linear models. Response variable can take a number of different formats

( t) Cox regression part 2. Outline: Recapitulation. Estimation of cumulative hazards and survival probabilites. Ørnulf Borgan

Introduction to Linear Regression Rebecca C. Steorts September 15, 2015

Statistics in medicine

Definitions and examples Simple estimation and testing Regression models Goodness of fit for the Cox model. Recap of Part 1. Per Kragh Andersen

Extensions of Cox Model for Non-Proportional Hazards Purpose

The practical utility of incorporating model selection uncertainty into prognostic models for survival data

Acknowledgements. Outline. Marie Diener-West. ICTR Leadership / Team INTRODUCTION TO CLINICAL RESEARCH. Introduction to Linear Regression

11. Generalized Linear Models: An Introduction

Density Temp vs Ratio. temp

Lecture 4 Multiple linear regression

Other Survival Models. (1) Non-PH models. We briefly discussed the non-proportional hazards (non-ph) model

Typical Survival Data Arising From a Clinical Trial. Censoring. The Survivor Function. Mathematical Definitions Introduction

UNIVERSITY OF CALIFORNIA, SAN DIEGO

More on Cox-regression

Survival Analysis. 732G34 Statistisk analys av komplexa data. Krzysztof Bartoszek

BIOS 312: Precision of Statistical Inference

Quantile Regression for Residual Life and Empirical Likelihood

STAT 6350 Analysis of Lifetime Data. Failure-time Regression Analysis

Unit 6 - Simple linear regression

Lecture 14: Introduction to Poisson Regression

Modelling counts. Lecture 14: Introduction to Poisson Regression. Overview

Beyond GLM and likelihood

ESP 178 Applied Research Methods. 2/23: Quantitative Analysis

Contents. 1 Review of Residuals. 2 Detecting Outliers. 3 Influential Observations. 4 Multicollinearity and its Effects

1 Introduction to Minitab

LINEAR REGRESSION ANALYSIS. MODULE XVI Lecture Exercises

Lecture 22 Survival Analysis: An Introduction

Introduction to Linear regression analysis. Part 2. Model comparisons

Unit 6 - Introduction to linear regression

Transcription:

Statistics 255 - Survival Analysis Presented March 1, 2016 Dan Gillen Department of Statistics University of California, Irvine 10.1

Are model assumptions correct? Is the proportional hazards assumption correct? Should covariates be left as is, or should they be transformed? Are there observations that are not well-captured by the model?? Are there observations with unduly-strong influence on the fitted model? 10.2

Some of these questions can be addressed with hypothesis tests In addition, these questions can be addressed graphically with residual plots: and delta-beta residuals Here, consider only time-fixed (baseline) covariates; extensions exist 10.3

Function Form Recall: data for each subject is (yi, δ i, x i ) δi counts the number of events for the ith subject (0 or 1) Λ0 (t) is an estimate of the baseline cumulative hazard function Therefore, Λi (t x i ) = Λ 0 (t) exp( β T x i ) Taking the ith subjects total observation time y i : Λ i (y i x i ) = Λ 0 (y i ) exp( β T x i ) is an estimate of the expected value of δ i 10.4

Function Form compare observed to expected : r Mi = δ i Λ i (y i x i ) They are motivated by the fact that, for large samples, the quantity δ i Λ i (Y i x i ) would be a martingale evaluated at the time Y i In particular, under correct model specification they: have mean zero are uncorrelated with one another across subjects 10.5

Function Form Interpretation: δi is the observed number of events for the ith person (either 1 or 0) EYi {Λ i (Y i x i )} is the expected number of events for the ith person, accounting for censoring So rmi is like the excess number of events for the ith subject It is like observed expected In fact, these residuals sum to zero The residuals r Mi can be used to examine overall model fit and whether transformation is needed in covariates, after other covariates have already been entered in the model 10.6

Function Form are very similar to residuals in linear regression In particular, the functional form of covariate xk is very close to the regression of r Mi on x ik (or, the residual of x ik after regression onto the other x il s) We can use martingale residuals to examine graphically whether certain covariates are important and what their functional form might be 10.7

Function Form (Fleming and Harrington, 1991) There were 424 patients referred to the Mayo Clinic with primary biliary cirrhosis (PBC) between January 1974 and May 1984. 312 of these were randomized to to treatment with D-penicillamine (DPCA). Clinical, biochemical, serologic and histologic measures were taken at intake. Subjects were followed up for mortality through July 1986. Censoring events were the end of study, LTFU or liver transplantation. 11 deaths are not attributable to PBC, but are apparently included as failures. We use the data here to develop a natural history model, ignoring treatment, to describe how survival depends on baseline status. 10.8

Function Form (Fleming and Harrington, 1991) 1.0 0.8 Survival 0.6 0.4 0.2 0.0 0 1000 2000 3000 4000 Time from Randomization (days) 10.9

Function Form (Fleming and Harrington, 1991) The covariates of interest are Albumin in g/dl Serum bilirubin in mg/dl Prothrombin time, in sec Presence of edema > summary(pbc[,c("age", "album", "protime", "bilir", "edema" )]) age album protime Min. :26.3 Min. :1.96 Min. : 9.0 1st Qu.:42.2 1st Qu.:3.31 1st Qu.:10.0 Median :49.8 Median :3.55 Median :10.6 Mean :49.9 Mean :3.52 Mean :10.7 3rd Qu.:56.6 3rd Qu.:3.80 3rd Qu.:11.1 Max. :76.7 Max. :4.64 Max. :15.2 bilir edema Min. : 0.30 Min. :0.000 1st Qu.: 0.80 1st Qu.:0.000 Median : 1.35 Median :0.000 Mean : 3.26 Mean :0.119 3rd Qu.: 3.42 3rd Qu.:0.000 Max. :28.00 Max. :1.000 10.10

Function Form (Fleming and Harrington, 1991) We will consider albumin, and prothrombin time on the log scale and consider doing so for bilirubin The starting model is one without bilirubin > ## > ##### Fit model without bilirubin > ## > fit <- coxph( Surv(time,death) ~ age + log(album) + log(protime) + edema, data=pbc ) > summary(fit) Call: coef exp(coef) se(coef) z Pr(> z ) age 0.02764 1.02802 0.00961 2.88 0.004 ** log(album) -4.02771 0.01782 0.65717-6.13 8.8e-10 *** log(protime) 5.99803 402.63670 1.04634 5.73 9.9e-09 *** edema 0.56680 1.76262 0.23396 2.42 0.015 * exp(coef) exp(-coef) lower.95 upper.95 age 1.0280 0.97274 1.00885 1.05e+00 log(album) 0.0178 56.13238 0.00491 6.46e-02 log(protime) 402.6367 0.00248 51.79220 3.13e+03 edema 1.7626 0.56734 1.11432 2.79e+00 10.11

Function Form (Fleming and Harrington, 1991) Now, what is the correct functional form for bilirubin in the context of this model (that is, for predicting mortality risk, adjusting for the other covariates)? Martingale residual plot for bilirubin: need to adjust for other covariates use a smoother include regression line > mresids <- residuals( fit, type="martingale" ) > lmfit <- lm( bilir ~ age + log(album) + log(protime) + edema, data=pbc ) > rbili <- lmfit$resid > ord <- order( rbili ) > mresids <- mresids[ ord ] > rbili <- rbili[ ord ] > plot( rbili, mresids ) > lines( smooth.spline( rbili, mresids, df=6 ), col="red", lwd=2 ) > lines( rbili, fitted(lm( mresids ~ rbili )), col="blue", lwd=2 ) 10.12

Function Form (Fleming and Harrington, 1991) Martingale Residual 5 4 3 2 1 0 1 10 5 0 5 10 15 20 25 LM Residual for Bilirubin 10.13

Function Form (Fleming and Harrington, 1991) Now, let s consider a log-transformation for biliruibin > lmfit <- lm( log(bilir) ~ age + log(album) + log(protime) + edema, data=pbc ) > rlogbili <- lmfit$resid > ord <- order( rlogbili ) > mresids <- mresids[ ord ] > rlogbili <- rlogbili[ ord ] > plot( rlogbili, mresids ) > lines( smooth.spline( rlogbili, mresids, df=6 ), col="red", lwd=2 ) > lines(rlogbili, fitted(lm( mresids ~ rlogbili )), col="blue", lwd=2) 10.14

Function Form (Fleming and Harrington, 1991) Martingale Residual 5 4 3 2 1 0 1 2 1 0 1 2 3 LM Residual for Log Bilirubin 10.15

Function Form (Fleming and Harrington, 1991) Conclusion: In the context of this model, with the other 4 covariates, the effect of log(bilirubin) on the log mortality hazard is approximately linear 10.16

Outlier (Y X-space): an unusual failure-time observation (y i, δ i ), given the covariate value, x i : large (positive or negative) martingale or large deviance residual The martingale residual r Mi is a measure of the degree to which the ith subject is an outlier, after adjusting for the effect of x i But note: While martingale residuals are uncorrelated and have mean zero, their disadvantage is that: 1. their maximum is +1, but their minimum is 2. their distribution is quite skewed (left) The heavily skewed distribution of martingale residuals makes them hard to use to identify outliers 10.17

For this, we have deviance residuals: r Di = sign(r Mi ) [ 2 {r Mi + δ i log(δ i r Mi )}] 1/2 Why are they called deviance residuals? From GLMs, the deviance of a model is defined as dev(model) = 2[log L(saturated model) log L(model)] where a saturated model is one that perfectly reproduces the data are created in the same spirit. Namely, dev(model) = i r 2 Di 10.18

Behavior of deviance residuals r Di has the same sign as r Mi : The quantity inside the [ ] s is positive (so we can take the square root), while sign( ) assures that the deviance residual has the same sign as the martingale residual What happens when... rmi 0? rmi is close to 1 rmi is large and negative 10.19

Behavior of deviance residuals Compared to r Mi, r Di has a shorter left and a longer right tail r Di is more symmetrical around zero The distribution of the deviance residual is better approximated by a Gaussian distribution than is the distribution of the martingale residuals Because they are approximately normally distributed, you can think of outliers as values outside of the range of ( 3, +3) or even ( 2.5, 2.5) 10.20

(Fleming and Harrington, 1991) Goal: Determine if there are any outliers in the model with all covariates, plus log(bilirubin) Approach: Plot residuals versus the risk scores β T x i : Start by fitting the model with log(bilirubin), then obtain linear predictor estimates and the deviance residuals... > ## > ##### Consider outliers (in the X-space) > fit <- coxph( Surv(time,death) ~ age + log(album) + log(protime) + edema + log(bilir), data=pbc ) > summary(fit) exp(coef) exp(-coef) lower.95 upper.95 age 1.0415 0.9602 1.0226 1.061 log(album) 0.0441 22.6812 0.0109 0.178 log(protime) 42.5586 0.0235 4.7547 380.937 edema 1.5055 0.6643 0.9450 2.398 log(bilir) 2.4623 0.4061 2.0257 2.993 > dresids <- residuals( fit, type="deviance" ) > lp <- predict( fit, type="lp" ) > plot(lp, dresids, xlab="linear Predictor", ylab="deviance Residual") 10.21

10.22 (Fleming and Harrington, 1991) 2 0 2 4 2 1 0 1 2 3 Linear Predictor Deviance Residual

(Fleming and Harrington, 1991) Let s investigate the three outliers... > summary(pbc[,c("age", "album", "protime", "bilir", "edema" )]) age album protime bilir Min. :26.3 Min. :1.96 Min. : 9.0 Min. : 0.30 1st Qu.:42.2 1st Qu.:3.31 1st Qu.:10.0 1st Qu.: 0.80 Median :49.8 Median :3.55 Median :10.6 Median : 1.35 Mean :49.9 Mean :3.52 Mean :10.7 Mean : 3.26 3rd Qu.:56.6 3rd Qu.:3.80 3rd Qu.:11.1 3rd Qu.: 3.42 Max. :76.7 Max. :4.64 Max. :15.2 Max. :28.00 edema Min. :0.000 1st Qu.:0.000 Median :0.000 Mean :0.119 3rd Qu.:0.000 Max. :1.000 > cbind( dresids,pbc[,c("time", "death", "age", "album", "protime", "bilir", "edema" )] )[ abs(dresids) >= 2.5, ] dresids time death age album protime bilir edema 87 3.2003 198 1 37.279 4.40 10.7 1.1 0 103 2.7535 110 1 48.964 3.67 11.1 2.5 1 119 2.8327 515 1 54.256 3.83 9.5 0.6 0 10.23

Consider only time-fixed (baseline) covariates Outlier: unusual (extreme) failure-time observation (y i, δ i ), given the covariate value, x i : large martingale or large deviance residual High leverage observation: an unusual observation with respect to the covariate (vector) x i an outlier in X-space High influence observation: An observation for which the combination of the degree to which it is an outlier and its leverage means that it strongly influences estimates of β 10.24

How influence is operationalized Recall that the martingale residual is... r Mi = δ i Λ i (Y i x i ) The martingale residual r Mi is a measure of the degree to which the ith subject is an outlier, after adjusting for the effect of x i... and note that the martingale residual could be rewritten as r Mi = t (k) Y i r Mi = { δ i (t (k) ) e β T x i [ Λ 0 (t (k) ) Λ } 0 (t (k 1) )] { } δ i (t (k) ) e β T x i d Λ 0 (t (k) ) t (k) Y i r Mi = t (k) Y i r Mik 10.25

How influence is operationalized Here, δ i (t) = 0 for t < Y i and δ i (Y i ) = δ i, since Y i is the exit time" δ i (t) counts the number of failure events for the ith subject, up to time t Also, d Λ 0 (t (k) ) = Λ 0 (t (k) ) Λ 0 (t (k 1) ) is the jump in the baseline CHF at time t (k) The piece of martingale residual r Mik is a measure of the degree to which the ith subject is an outlier at time t (k), after adjusting for the effect of x i 10.26

How influence is operationalized Leverage defined: The weighted average of covariate xl at the observation time t (k) can be written x l (t (k) ) = i R (k) x il exp( β T x i ) i R (k) exp( β T x i ) Then the leverage of the ith subject for the lth covariate at time t (k) is x il x l (t (k) ) This is the distance between xil and the average x l at t (k) This quantity is a measure of the degree to which the ith subject differs from the others in the risk set, with respect to covariate x l, at time t (k) 10.27

How influence is operationalized is then operationalized as the integral of leverage times the martingale residuals: r Sli = { } (x il x l (t (k) )) δ i (t (k) ) e β T x i d Λ 0 (t (k) ) }{{} t (k) Y i }{{} leverage Martingale residual Qualitatively, influence is the product of leverage and outlying tendency The quantities rsli are called score residuals There is one set of score residuals for each covariate xil in the model, l = 1,..., p Large values of rsli imply large influence of the ith subject on the estimate of β l, the coefficient for x l Obtain in R with residuals(fit, type="score") 10.28

How influence is operationalized : suppose βl is the estimate of β l from the whole data set and, suppose βl(i) is the estimate of β l from the data set with the ith subject removed the quantity (called a delta-beta): β li = β l β l(i) is a measure of the influence of the ith subject on the estimate of β l 10.29

How influence is operationalized As it turns out, β li can be approximated by: where r Si is the vector β li = β l β l(i) V l r Si r Si = (r S1i,..., r Spi ) of score residuals for the ith subject (across all covariates)and V l is the lth row of the estimated variance-covariance matrix of β Each subject i has one β value for each covariate in the model 10.30

(Fleming and Harrington, 1991 Goal: Investigate the influence of observations on the coefficients of in the 5-variable model which we have been investigating > ## > ##### A look at delta-betas for influential points > ## > dfbeta <- residuals( fit, type="dfbeta" ) > colnames( dfbeta ) <- names(fit$coef) > summary( dfbeta ) age log(album) log(protime) Min. :-4.49e-03 Min. :-1.96e-01 Min. :-4.43e-01 1st Qu.:-6.50e-05 1st Qu.:-1.07e-02 1st Qu.:-1.15e-02 Median : 4.75e-05 Median :-1.67e-03 Median : 3.25e-03 Mean : 1.72e-18 Mean :-4.58e-17 Mean : 1.10e-16 3rd Qu.: 1.86e-04 3rd Qu.: 6.30e-03 3rd Qu.: 1.82e-02 Max. : 2.28e-03 Max. : 1.95e-01 Max. : 3.09e-01 edema log(bilir) Min. :-1.08e-01 Min. :-6.55e-02 1st Qu.:-7.98e-04 1st Qu.:-4.07e-04 Median : 4.52e-05 Median : 8.29e-04 Mean :-7.09e-16 Mean : 1.65e-17 3rd Qu.: 1.72e-03 3rd Qu.: 2.10e-03 Max. : 5.48e-02 Max. : 2.58e-02 10.31

(Fleming and Harrington, 1991 Conclusion: For log(albumin), log(protime) and edema, no single very influential observations. For age, one observation has a large negative influence. For log(bilirubin), one has a large negative influence. Let s plot and print out the influential observation > plot( pbc$id, dfbeta[,5], xlab="patient ID", ylab="log(bilirugin) delta-beta" ) 10.32

(Fleming and Harrington, 1991 log(bilirugin) delta beta 0.06 0.04 0.02 0.00 0.02 0 50 100 150 200 250 300 Patient ID > pbc[ dfbeta[,5] < -.04, ] age album alkph ascites bilir chol edema edematx hepat 81 63.264 3.65 1218 0 14.4 448 0 0 1 time plate protime sex sgot spiders stage death treat trigl 81 2540 385 11.7 1 60.45 1 4 1 1 318 ucopp rand id 81 34 1 81 10.33

(Fleming and Harrington, 1991 Conclusion: Subject 81 is older and has a high serum bilirubin (2 sd above mean on log scale). Bilirubin is an important predictor of high risk, yet subject is in the 40th (or so) percentile of survival times Recommendation: If interest is on assessing the effect of bilirubin, might do a sensitivity analysis (ie. present results with this case and without) Important: Unless it is very, very clear that there is some sort of data entry error causing a problem, it is generally never a good idea to permanently remove an observation from your data! 10.34

Recall: If we have proportional hazards, then for all t, so that λ 1 (t) = φλ 0 (t) log Λ 1 (t) = log(φ) + log Λ 0 (t) Thus, the log cumulative hazards should be parallel if the proportional hazards assumption holds. We looked at unadjusted and adjusted versions of these plots for categorical variables earlier (See Lectures 4 and 8) 10.35

Let s consider whether edema exhibits a non-proportional hazards effect > fit <- coxph( Surv(time,death) ~ age + log(album) + log(protime) + log(bilir) + strata(edema), data=pbc ) > plot( survfit(fit), fun="cloglog", lty=1:2, + xlab="time from Randomization (days)", + ylab="log-cumulative Hazard Function" ) > legend( 50, 0, lty=1:2, legend=c("no Edema", "Edema"), bty="n" ) 10.36

Log Cumulative Hazard Function 6 5 4 3 2 1 0 No Edema Edema 50 100 200 500 1000 2000 5000 Time from Randomization (days) 10.37

Clearly the log cumulative hazards are not parallel This suggests that the proportional hazards assumption may be violated, ie. The hazard ratio associated with edema may be changing with respect to time. We have looked at one test of this assumption using time dependent covariates. Another relies upon the Schoenfeld residuals... 10.38

Recall: Under the Cox model the probability that any particular member j of R(t k ) fails at t k, given that one does, is w j (β, t k ) = e βt x j l R(t k ) eβt x l The (weighted) average of the covariate values for members of R(t k ), with weights proportional to w j (β, t k ), is x(β, t k ) = j R(t k ) x j w j (β, t k ) 10.39

The Schoenfeld residual for any subject i D(t k ) (the set of d k failures at time t k ) is the difference between the covariate for that subject and the weighted average of covariates in the risk set, namely x i x(β, t k ) The sum of the over all d k subjects who fail at t k, also known as the Schoenfeld residual corresponding to t k, is r S,k = r S,k (β) = i R(t k ) δ ik [x i x(β, t k )] where δ ik equals one if subject i fails at t k and zero otherwise. 10.40

Provided the PH model holds and β is the true regression coefficient, the r S,k (β) are uncorrelated and have mean zero. In practice the are calculated as ˆr S,k = r S,k ( β) where ˆβ is the partial likelihood estimate of the regression coefficients. are also known as partial score residuals, because their total equals the partial likelihood score, or estimating equation, whose solution is ˆβ: r S,k ( ˆβ) = 0 k 10.41

Scaled Schoefeld residuals are residuals after multiplication by the inverse weighted covariance matrix of ˆβ: r S,k = r S,k (β) = V 1 (β)r S,k (β) 10.42

Key Point: When the scaled, ˆr S,k are plotted against any transformation g(t k ) of time t k, for example log(t k ) or t k itself, the smooth curve through the plotted points approximates the manner in which the associated coefficients depend on time. If a specific covariate has a time-varying coffecient (effect): β(t) = β + γg(t) where g(t) is a specified function of time t, such as g(t) = t or g(t) = log(t), then the approximate expectation of the scaled Schoenfeld residual at time t k is E[ˆr S,k ] γg(t) 10.43

This suggests: Plotting ˆr S,k against g(t k ) and examining trends Slope of linear regression gives numerator of the score statistic, ˆγ for testing H 0 : γ = 0 (proportionality) This test is implemented in R via the cox.zph() command 10.44

Goal: Test each covariate in the PBC data to determine if any significantly violate the PH assumption This can be done using the function cox.zph() First let s plot the scaled for edema and prothrombin vs. time > fit <- coxph( Surv(time,death) ~ age + log(album) + log(protime) + log(bilir) + edema, data=pbc ) > sresids <- residuals( fit, type="scaledsch" ) > colnames( sresids ) <- names( fit$coef ) > time <- as.numeric( rownames( sresids ) ) > plot( time, sresids[,5], xlab="time", ylab="scaled Schoenfeld Residual (Edema)" ) > lines( smooth.spline( time, sresids[,5] ), col="red", lwd=2 ) > plot( time, sresids[,3], xlab="time", ylab="scaled Schoenfeld Residual (Log-Prothrombin Time)" ) > lines( smooth.spline( time, sresids[,3] ), col="red", lwd=2 ) 10.45

Scaled Schoenfeld Residual (Edema) 4 2 0 2 4 6 8 0 1000 2000 3000 4000 Time 10.46

Scaled Schoenfeld Residual (Log Prothrombin Time) 20 10 0 10 20 30 40 0 1000 2000 3000 4000 Time 10.47

Now, let s test the slopes using cox.zph() > cox.zph( fit, transform="identity" ) rho chisq p age -0.0610 0.461 0.4971 log(album) -0.0431 0.237 0.6262 log(protime) -0.1570 2.967 0.0850 log(bilir) 0.1154 1.563 0.2112 edema -0.2195 5.407 0.0201 GLOBAL NA 12.197 0.0322 10.48

In each case smoother certainly appears to have a pattern and we reject the proportionality assumption with our hypothesis test. But does the effect really change linearly in time? The smoother is not linear in either case. Let s explore the relationship between edema (and log(prothrombin)) and log(time)? > plot( log(time), sresids[,5], xlab="log-time", ylab="scaled Schoenfeld Residual (Edema)" ) > lines( smooth.spline( log(time), sresids[,5], df=6 ), col="red", lwd=2 ) > plot( log(time), sresids[,3], xlab="log-time", ylab="scaled Schoenfeld Residual (Log-Prothrombin Time)" ) > lines( smooth.spline( log(time), sresids[,3], df=6 ), col="red", lwd=2 ) 10.49

Scaled Schoenfeld Residual (Edema) 4 2 0 2 4 6 8 4 5 6 7 8 Log Time 10.50

Scaled Schoenfeld Residual (Log Prothrombin Time) 20 10 0 10 20 30 40 4 5 6 7 8 Log Time 10.51

Again, let s test the slopes using cox.zph() > cox.zph( fit, transform=log ) rho chisq p age -0.0878 0.955 0.32857 log(album) -0.0313 0.125 0.72334 log(protime) -0.2005 4.844 0.02774 log(bilir) 0.1068 1.338 0.24747 edema -0.2809 8.853 0.00293 GLOBAL NA 20.221 0.00114 10.52

Conclusion: We reject the null hypothesis of proportional hazards for both log(prothombin)and edema, and conclude that their effect varies as a function of log(time). Compare the results for edema with what we found looking at time-varying covariates! Note: We are attempting to disprove the proportional hazards assumption. Just because we fail to reject the null hypothesis does not guarantee proportional hazards, our test may just be underpowered. 10.53

Model : Model: Proportional hazards assumption: Functional form of covariates (log, square-root, etc.): 10.54

Model : Observations: Observations not well-described by the model (outliers): Observations with undue influence on results: (here, results refers to one β at a time) 10.55