Hi there,
As printed in the log:
NOTE: Model assessment is not available with the counting process style of input. The ASSESS statement is ignored.
You can however still calculate the Martingale and Schoenfeld residuals by using the OUTPUT statement:
proc phreg data=data1; Model(start,stop)*event(0)=x1 x2 x3 x4 x5 x6; output out=output_dsn resmart=Mart RESSCH=schoenfeld; run;
Next you will have to plot it for each variable, for example using PROC LOESS which plots us a nice smoothing spline to help discover the (residual) functional form of the covariate:
ods output on; proc loess data=Out1 plots(only)=(fit); model Mart=x1 /CLM smooth=0.5; ods output OutputStatistics=Results; run;
You can do the same thing for plotting Schoenfeld residuals over time. If you need a formal test you can perform a simple linear regression where the dependent variable is the Schoenfeld residual and the independent variable is time. As an extra caveat introduced by working with time dependent covariates, you will have to reweight the rows in the dataset based on which proportion of the patient survival time they represen. Otherwise you would be introducing bias by having clustered rows belonging to the same patient.
Me personally I like to test covariates before I enter them in the model by fitting a null model and plotting the residuals. This allows you to gain insight in the true functional form of the covariate. To throw that all together it would look something like this:
data _dummy_abt;
set &table;
dummy=0;
keep dummy &var_time &var_event &var;
run;
proc phreg data=_dummy_abt;
model &var_time*&var_event(0)=dummy;
output out=_out resmart=rr
/order=data;
run;
ods graphics on;
proc loess data=Out1 plots(only)=(fit);
model resmart=x1 /CLM smooth=0.5;
ods output OutputStatistics=Results;
run;
proc datasets lib=work;
delete _dummy_abt _out;
run;
You can write a macro to loop over the variables.
For more details on model assessment see Thomas R Fleming and David P Harrington. Counting processes and survival analysis, volume 8. Wiley Online Library, 1991.
... View more