Not applicable
Posts: 0

# Help!how to calculate hazard ratio in Cox model with frailty

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
Frequent Contributor
Posts: 81

## Re: Help!how to calculate hazard ratio in Cox model with frailty

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
Not applicable
Posts: 0

## Re: Help!how to calculate hazard ratio in Cox model with frailty

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
Frequent Contributor
Posts: 81

## Re: Help!how to calculate hazard ratio in Cox model with frailty

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
Contributor
Posts: 73

## Re: Help!how to calculate hazard ratio in Cox model with frailty

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?
Occasional Contributor
Posts: 7

## Re: Help!how to calculate hazard ratio in Cox model with frailty

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;

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