Code:

```
proc phreg data = analysis ;
class c diabetes /descending;
model days*ind(0) = c diabetes id/ rl ;
id= c *diabetes;
hazardratio id;
run;
```

Please help.

- Thread starter sandeep249
- Start date
- Tags cox proportional hazard phreg sas survival analysis

Code:

```
proc phreg data = analysis ;
class c diabetes /descending;
model days*ind(0) = c diabetes id/ rl ;
id= c *diabetes;
hazardratio id;
run;
```

Please help.

belonging to the group denoted by

belonging to the group indicated by

response; PH regression is sometimes called “relative risk regression”.

hypothesis that

rate at which response occurs in the group denoted by

rate at which response occurs at the same time in the group denoted by

plausible values for the log relative risk associated with the corresponding

explanatory variable.

See sas paper from global forum : #253-2010, for coding options.

I simply used the CONTRAST statement to calculate the log-hazard ratio with the 95% CI. There is no other easy way to do this in SAS. So one has to write out the contrast statement for every permutation and combination - and it does get complicated if you have interactions in your model.

Thanks again!

Code:

```
proc phreg data = analysis ;
class cat1 (ref="yes") cat2 (ref="yes") /descending;
model days*ind(0) = cat1 | cat2/ rl;
hazardratio cat1 /diff=ref ;
contrast 'test this value, should be same as that from hazratio statement' cat1 1 / estimate = both;
contrast 'cat1=yes for cat2=yes' cat1 1 cat1*cat2 1 / estimate = both;
run;
```