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;
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’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.