I am not at all familiar with Stata, but I do know how to calculate a hazard ratio using a frailty model in SAS:
'proc phreg' is for survival analysis and the 'random' statement introduces the frailty term (the ID or participant name
the option 'RL' requests the confidence intervals for the hazard ratio
with 'groupe' the treatment variable
the code will be:
proc phreg data=table;
class groupe id;
model time*Status(0)=groupe /RL ;
random id;
run;
In case you have other covariates (age gender...), the code will be (you want the adjusted hazard ratio for the variable 'groupe'):
proc phreg data=table;
class groupe id gender;
model time*Status(0)=groupe gender age/RL ;
random id;
hazardratio groupe;
run;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.