turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- BI
- /
- Enterprise Guide
- /
- Help!how to calculate hazard ratio in Cox model wi...

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

07-25-2006 10:01 AM

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

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

07-25-2006 10:20 AM

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

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

07-25-2006 11:37 AM

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

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

07-26-2006 06:25 AM

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

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

07-26-2006 02:15 PM

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?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

02-04-2014 12:21 PM

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;**