BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Dear all:

Now I'm doing the calculation of Hazard Ratio and Slope estimator of Schoenfeld residuals in Cox PH model with frailty effect. I knew Stata could run all of this easily. But my manager just allowed me to use SAS. Does anyone could help? Thanks for everyone.

Chin
5 REPLIES 5
prholland
Fluorite | Level 6
Chin,

I'm a SAS programmer, not a statistician, and I do not understand the question. Please could you paste in the STATA code you used, and we may be able to see what it is you want to do and then convert it to SAS?

.......Phil
deleted_user
Not applicable
Dear Phil:

This is the code i found from stata journal. There are 2 part:
(1)-code
use kidney, clear
. streg age gender, dist(weibull) frailty(gamma) shared(patient) time nohr nolog
(2)-code
use kidney, clear
. stset time1 fail1
(output omitted )
. streg age gender, dist(weibull) frailty(gamma) shared(patient) nolog

All of the questions are based on Cox proportion hazard model with shared frailty effect, Survival Analysis.
And i want to calculate the "hazard ratio" and "the coef" and revelent statistics.

Could you help me to convert it?
Sorry about my expression wasn't so clearly.

Many Thanks.

Chin
prholland
Fluorite | Level 6
Chin,

I can't say that I've worked out how to solve your problem in SAS, but I've found references to some of your STATA code features in the documentation for PROC LIFEREG:

http://support.sas.com/onlinedoc/913/getDoc/en/statug.hlp/lifereg_index.htm

However, there was no mention of Frailty. Also PROC LIFETEST is supported in Enterprise Guide, but PROC LIFEREG is not. The omission of PROC LIFEREG support in EG is understandable though, as the documentation made my head hurt! 😉

.......Phil
JohnH
Fluorite | Level 6
I am also interested in hazard estimates with frailty! I am working with economists who use STATA. Unfortunately, STATA chokes when the data set is large. Has anyone converted the STATA code to SAS? I know there is a COBOL2SAS macro. Is there a STATA2SAS macro?
Fabie10
Calcite | Level 5

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;

sas-innovate-2024.png

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.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 1775 views
  • 0 likes
  • 4 in conversation