09-29-2013 09:55 AM
I have a question regarding proc rank. I am working with a set of data and trying to create three quartiles or tertiles. However, the three groups that result do not have the same size or relatively similar sizes. Like my first tertile has 1229, second has 246, and three has 737 for a total of 2210. Can anyone explain to me why that is? I obviously was expecting the three groups to have roughly the same number of people. Is it because of the default settings? Thanks!
09-29-2013 11:33 AM
This is likely caused by the presence of lots of tied values in the variable you are ranking by. Unfortunately, none of the TIES= options in proc rank can really solve this problem. How you want to assign tied values to groups will determine what other solutions are available.
09-29-2013 11:56 AM
Yeah, I can be more specific with that, I'm looking at amount of ethanol consumed per week and 1229 of the 2210 subjects have a value of 0, meaning they don't drink. Is there any reason you could give me as to why exactly all of the 1229 subjects went into the first tertile and no one else? Thank you so much for the help so far. I appreciate it.
09-29-2013 12:39 PM
For GROUPS=3, you would expect ranked observations 1 to 737 to end up in group 0, observations 738 to 1473 to be assigned to group 1 and the rest to group 2. With TIES=MEAN (the default), all your 1229 subjects with value=0 end up with mean rank 615 which belongs to group 0. With TIES=LOW they would have low rank=1 and be assigned to group 0 and with TIES=HIGH they would have high rank =1229 and thus end up in group 1. None of that would solve your problem.
The problem boils down to : How exactly do you want the non drinking subjects to be assigned to groups 0 and 1?
09-29-2013 01:27 PM
Thank you very much for your help! I've another question that I keep coming across that maybe you can help me with. I'm trying to create a dichotomous exposure variable (call it alcoholic). If you have a value greater than 0, alcoholic = 1 and for everyone else alcoholic = 0. I'm trying to create 2x2 tables to look at associations but for some reason I get the outcome variable to have its values of 1 and 0 in that order but for the exposure alcoholic sas keeps giving me 0,1. Basically I want in the upper left hand corner those who are positive for both exposure and outcome. Do you know what you have to do in sas to make that work?
09-29-2013 02:26 PM
This is a new question, unrelated to "Proc rank question". You should start a new discussion with this question and if possible give an example of SAS code that displays the problem. That always attracts more answers.