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.
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.
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;
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.
> 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.
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 🙂
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.