BookmarkSubscribeRSS Feed
DavidsM
Calcite | Level 5

Hello Community,

 

 

I am requesting for assistance, I want to calculate Royston's D index for my cox model but I have failed to come across any procedure that I can use to calculate it. 

 

 

Thanks in advance. 

6 REPLIES 6
Rick_SAS
SAS Super FREQ

Please supply a reference for the statistic.

 

Please also let us know your version of SAS and whether you have a license for the SAS/IML product.

DavidsM
Calcite | Level 5
 
Hello Rick, 
 
Below is a brief summary about this statistic. 
 
 
Royston’s D-index is a measure of prognostic separation in survival data.  D measures prognostic separation of survival curves and is closely related to the standard deviation of the prognostic index. 
 
The prognostic index for each subject is defined to be the linear predictor from the fitted Cox proportional hazards model. Ranking the prognostic index across the sample, one assigns to the ith subject the ith expected standard normal order statistic in a sample of the same size. 
 
Using a Cox proportional hazards model, one then regresses the original time-to-event outcome on the expected standard normal order statistics. Royston’s D-index is defined to be the estimated regression coefficient multiplied by  √ 8/π
 
D can be interpreted as an estimate of the log hazard ratio comparing two prognostic groups of equal size (i.e. if one had dichotomized the linear predictor at the sample median).
 
 
The details can be found in the following two papers
 
1. Peter C Austin, Michael J Pencinca and Ewout W Steyerberg.(2017). Predictive accuracy of novel risk factors and markers: A simulation study of the sensitivity of different performance measures for the Cox proportional hazards regression model. 
 
2. M. Shafiqur Rahman, Gareth Ambler, Babak Choodari-Oskooei and Rumana Z. Omar. (2017)  .Review and evaluation of performance measures for survival prediction models in external validation settings.
 
 
 
I have attached screen shorts of the formulas also. 
 
 
I have a license for SAS 9.4 University Edition which is licensed to the University.
 
Rick_SAS
SAS Super FREQ

I hope that someone who knows more about survival analysis than I do will chime in, but it sounds like the main steps in this analysis are:

1. Use the PHREG procedure to fit a Cox regression model to the data and obtain the linear predictor.

2. Make a normal Q-Q plot of the linear predictor. Use OLS (PROC REG) to estimate the slope, sigma. 

3. D = sqrt(8/pi) * sigma.

 

I assume you know how to use the ODS OUTPUT statement to capture statistics from a table and put it in a SAS data set.

 

A note on creating the normal Q-Q plot. You can use PROC UNIVARIATE to compute the Q-Q plot and to output the quantiles. For example, the following gets the coordinates for a Q-Q plot and performs a linear regression:

 

proc univariate data=sashelp.class;
var weight;
qqplot weight;
ods output qqplot = qq;  /* put quantiles and data in QQ data set */
run;

proc reg data=QQ plots(only)=fitplot;
model data=quantile;
run;

 

DavidsM
Calcite | Level 5

Hello Rick,

 

 

I have attempted to do it as follow, I request for cross examination to know if am following the procedures well,

 

 

Proc phreg data=model;
class Sex(ref='1') AGE(ref='1');
model Years * censor (0)= Sex AGE/ rl
Output Out=Model survival=survest;
run;

proc univariate data=Model;
var survest;
qqplot survest;
ods output qqplot = qq; /* put quantiles and data in QQ data set */
run;

 

proc reg data=QQ plots(only)=fitplot;
model data=quantile;
run;

 

/* I got a standard deviation of 0.66196 which I presumed to be the Sigma you talked about and I replaced pi with its standard value of 3.14159265359, then I created the data below containing the desired statistics*/

 

Data Royston; set QQ;
Roystons_D = sqrt(8/3.14159265359) * 0.66196; 
run;

 

 

I have some question,

 

What is the purpose of the following statement in the procedure where I have the following 

 

model data=quantile;

 

 

I want to confirm whether I did it in the right way.

 

 

 

I will be glad for some clarifications.

 

Rick_SAS
SAS Super FREQ

I request for cross examination to know if am following the procedures well

 

You appear to have followied my suggestions, but as I said, I am not an expert in survival analysis, and I have never heard of Roysten's D.  What I would do is to rerun one of the examples in the references: get the data that they used and make sure you get the same answer.

 

> What is the purpose of the following statement in the procedure where I have the following: model data=quantile;

 

The ODS OUTPUT statement sends the data in the Q-Q plot to the 'QQ' data set. If you use PROC  PRINT, you will see that the X variable in the Q-Q plot is named 'QUANTILE' and the Y variable is named 'DATA'. Thus the statement MODEL DATA = QUANTILE

asks PROC REG to regress Y onto X, which are the observed rank-order statistics against the corresponding normal quantiles. The slope of the regression line is the parameter estimate that you want.  When Y is normally distributed, the slope of the Q-Q plot should be close to the standard deviation of Y.

sshetter
Fluorite | Level 6

I know I am 'late' to this conversation, but I was similarly looking to calculate the D-Index and had the advantage of R code created by another statistician to use as I was working through steps.  Royston and Sauerbrei's original article has a bit more detail than the description in Austin et. al. and it makes a difference in the final calculations.  I'll post the macro I created as soon as I am on the active enough on the community  to do so.... (Or if there is too much of a delay, I'll have a colleague do it for me 🙂 

 

 

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 6 replies
  • 3342 views
  • 0 likes
  • 3 in conversation