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;
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.