BookmarkSubscribeRSS Feed
newguy1580
Calcite | Level 5

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!

22 REPLIES 22
newguy1580
Calcite | Level 5

Anyone?

Reeza
Super User

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

newguy1580
Calcite | Level 5

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;

newguy1580
Calcite | Level 5

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

PGStats
Opal | Level 21

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

PG
newguy1580
Calcite | Level 5

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

newguy1580
Calcite | Level 5

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

PGStats
Opal | Level 21

Try running

proc freq data=temp4 ;

table hisugbev4*c5_1;

run;

PG

PG
newguy1580
Calcite | Level 5

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?

PGStats
Opal | Level 21

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
newguy1580
Calcite | Level 5

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

Reeza
Super User

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.

newguy1580
Calcite | Level 5

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+

PGStats
Opal | Level 21

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
What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 22 replies
  • 4527 views
  • 1 like
  • 4 in conversation