I really request for assistance. I want to calculate the Nam-D'Agostino Test which is an extension of Hosmer Lemeshow test adapted to survival data.
Attached to this message is the formula I am supposed to use to calculate this statistic but I dont know how to write the code and I have not come across any code on internet for almost 3 month of searching. Community , I request for your assistance.
Thank you in advance.
See the article "Decile Calibration plots in SAS" for an example of logistic regression. You can use the same ideas to modify the code for survival analysis. I haven't done it myself, but if you know how to use the SAS survival analysis procedures, perhaps that article will help. As you read the article, however, please pay attention to the section that discusses why the Hosmer-Lemeshow test is not recommended by most experts.
Thank you Mr. Rick for the article about calibration plots. I have followed it and was able to get the concept for obtaining calibration plot using the Phreg procedure. However, I would be glad if am also assisted to find a way to calculating the associated Chi Square and P values using this formula modified by Nam-D'Agostino.
There are other people who have tried to search for the same calculating on this forum but they had no replies about this calculation, so i failed to get any ideas about how the coding should be done.
I will be glad to receive more additional assistance from you and other community advisors.
If you want help, please post example data and the code that you are using to run the PHREG procedure. Also specify how the PHREG output relates to the various terms in the formula. There are thousands of tests and formulas in statistics. The experts on this forum are experienced with SAS, but may not be familiar with a particular formula such as you the Nam-D'Agostino Test. You have to help us understand what you have and what you want.
This is what I have tried out so far.
/* USING PHREG PROCEDURE TO SAVE PREDICTED PROBABILITIES FROM THE COX MODEL */
Proc phreg data=Stone1.Development;
class SEX(ref='2') AGE (ref='1') SMOKING(ref='1') DRINKING(ref='1') CHOLESTEROL(ref='1') TRIGLYCERIDES(ref='1') OBESITY(ref='1') GLUCOSE(ref='1') SBP(ref='1');
model Years * Censor (0)=Sex AGE SMOKING DRINKING CHOLESTEROL TRIGLYCERIDES OBESITY GLUCOSE SBP/ rl;
output out=OutData Survival=PredProb; /* Saving predicted probabilities in data set */
/* IDENTIFICATION OF DECILES OF PREDICTED PROBABILITIES*/
Proc rank data=OutData out=Decile groups=10;
/* COMPUTATION OF THE MEAN PREDICTED PROBABILITIES AND THEIR CONFIDENCE INTERVALS*/
proc means data=Decile noprint;
output out=MeanDecileOut mean= PredProbMean
*/Desription of Variables in my data desription*/
*/Years=Varibale for time ot event or follow up time for each indivividual in the cohort*/
*/Censor=Censoring variable with censor(0) representing censored participant and Censor(1) representing participants who expereinced the outcome of interest*/
*/PredProb is the variable containing individual Survival probabilties that I obtained from the a multivariable Cox proportional Hazards model as seen above/*
*/Desription of Variables in Nam-D'Agostino Test formula*/
Below is the formula to calculate the statistics for each decile.
[KMg(t)- p(t)g]Squared *ng /p(t)g(1-p(t)g)
Then summation for all deciles to get the overal statistcis for the model.
*/KMg(t) represents the failure probability in g-th decile at time t*/
*/ p(t)g is the mean predicted probability of failure for subjects in g-th decile using any survival modelling technique [ I am using Cox model]/*
*/ng is number of observations in a group g/*
Thank you RICK for your continued assistance. Will be glad to receive your assistance again.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.