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!
Anyone?
Post your code, based on what you've posted hard to say.
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;
In this case, I just get level 2 and level 3 parameter estimates and for some reason no level 1
Could it be that all level=1 cases are censored? - PG
Let me check my output and get back to you on that
I have 36,945 total observations and 36,700 were censored leaving 245 actual cases, i personally don't think that's the reason
Try running
proc freq data=temp4 ;
table hisugbev4*c5_1;
run;
PG
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?
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
So are you saying try quintiles or tertiles instead of quartiles?
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.
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+
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
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.