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
- /
- Analytics
- /
- Stat Procs
- /
- Class statement in Proc PHReg

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
- Permalink
- Email to a Friend
- Report Inappropriate Content

07-09-2015 01:25 PM

Recently i had to use Proc Phreg and being a non stats programmer, I have some doubts which I'm sharing here so I can get some help from experts:

A variable ABC has 2 categorical values 0 and 1 sorted in ascending order within the treatment (TRT).

I wanted to understand how PHREG decides the Reference among these 2 values (0 & 1) for the Hazard Ratio in following cases when used in class statement: I understand that by default it considers LAST level. So REF= is used to explicitly tell the SAS the reference value and not decide by its own(correct me if i'm wrong).

So here what I want to understand is:

A) Does prior sorting of class variable matters even if REF= is used (as in ex. 1)

B) Does / DESC option makes difference if used along with REF= (as in ex 2)

C) If no CLASS statement is used, does PHREG sorts abc variable internally and consider LAST ordered value as reference (ex. 3)?

Please let me know if my question is not clear.

1) Proc phreg data = test;

BY trt;

CLASS abc(ref=’0’) ;

MODEL time*censor(1) = abc /ties=exact rl;

STRATA s1 s2;

Run;

2) Proc phreg data = test;

By TRT;

CLASS abc(ref=’0’) /DESC;

MODEL time*censor(1) = abc /ties=exact rl;

STRATA s1 s2;

RUN;

3) *Without CLASS Statement ;

Proc phreg data = test;

By TRT;

MODEL time*censor(1) = abc /ties=exact rl;

STRATA s1 s2;

RUN;

Accepted Solutions

Solution

07-09-2015
01:31 PM

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

Posted in reply to MannMishra

07-09-2015 01:31 PM

1) No

2) Not for calculations - only for presentation

3) No, it treats the value as numeric or generates an error if the variable is character.

You may also want to look into PARAM= option on the class statement that denotes how SAS codes the reference variables. The output will print out the design matrix that lets you know.

All Replies

Solution

07-09-2015
01:31 PM

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

Posted in reply to MannMishra

07-09-2015 01:31 PM

1) No

2) Not for calculations - only for presentation

3) No, it treats the value as numeric or generates an error if the variable is character.

You may also want to look into PARAM= option on the class statement that denotes how SAS codes the reference variables. The output will print out the design matrix that lets you know.

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

Posted in reply to Reeza

07-09-2015 02:02 PM

Reeza, Thanks for reply. I could not understand your reply for the 2nd question (i.e. Not for calculations - only for presentation).

My assumption was I should get same Hazard ratio from Ex.1 (without DESC option) and Ex. 2 (with DESC option). So can i say it impacts the output?

I'll try with PARAM= option to look how the design matrix is created. Thanks for suggesting.

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

Posted in reply to MannMishra

07-09-2015 03:20 PM

It may affects the order the results are presented/displayed in, but not the values.