## Proc Rank

Occasional Contributor
Posts: 18

# Proc Rank

Hi everyone,

I have a question regarding proc rank. I created quartiles in sas using proc rank and then ran phreg afterwards for my model. my output however has 2 parameter estimates instead of 3 (I set the lowest quartile as the reference) Can anyone explain to me why that I have only 2 parameter estimates? Thanks!

Occasional Contributor
Posts: 18

Anyone?

Super User
Posts: 23,776

## Re: Proc Rank

Post your code, based on what you've posted hard to say.

Occasional Contributor
Posts: 18

## Re: Proc Rank

proc rank data=temp4 out=temp4 groups=4;

var hisugbev;

ranks hisugbev4;

run;

proc phreg;

class hisugbev4 (ref='0');

model tpyrs*c5_1(0)= age hisugbev4/rl ties=efron;

run;

Occasional Contributor
Posts: 18

## Re: Proc Rank

In this case, I just get level 2 and level 3 parameter estimates and for some reason no level 1

Posts: 5,541

## Re: Proc Rank

Could it be that all level=1 cases are censored? - PG

PG
Occasional Contributor
Posts: 18

## Re: Proc Rank

Let me check my output and get back to you on that

Occasional Contributor
Posts: 18

## Re: Proc Rank

I have 36,945 total observations and 36,700 were censored leaving 245 actual cases, i personally don't think that's the reason

Posts: 5,541

## Re: Proc Rank

Try running

proc freq data=temp4 ;

table hisugbev4*c5_1;

run;

PG

PG
Occasional Contributor
Posts: 18

## Re: Proc Rank

When I run proc freq, for level=0 (reference) I have a total of 16,875 people, level=2 11,014 and level=3 9,086 for a grand total of 36,975...so level=1 doesn't show up. I guess there was no one that had a value that fell into that particular quartile?

Posts: 5,541

## Re: Proc Rank

You must have a large fraction of hisugbev values that are tied... You should reconsider the way you divide up that variable if you want to get a meaningful model.

PG

PG
Occasional Contributor
Posts: 18

## Re: Proc Rank

So are you saying try quintiles or tertiles instead of quartiles?

Super User
Posts: 23,776

## Re: Proc Rank

Take a look at your actual values in a histogram to decide a distribution. Sometimes there's genuine data intervals visible.

Make sure to add the param=ref option as well, sorry to repeat that.

Occasional Contributor
Posts: 18

## Re: Proc Rank

I ran proc univariate for the variable hisugbev and it is very left-skewed, about 65% of the observations have a value of 0 so that would probably explain the missing parameter estimate. My professor said I can still create quartiles even with the skewed data. Is there any sort of ideas you may have in mind? The data goes from 0-18 so i thought i could do maybe like 0-4, 4-8, 8-12, 12+

Posts: 5,541

## Re: Proc Rank

It would probably make sense. To be sure, try looking at the distribution of uncensored events:

ods graphics on;

Proc univariate data=temp4;

where c5_1 ne 0;

var hisugbev;

histogram;

run;

PG

PG
Discussion stats
• 22 replies
• 742 views
• 1 like
• 4 in conversation