BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.

Hello,

 

I have a question about quintiles please. I divided a score into quintiles. In SAS how can I get the exact cut offs of each quintile and then how can I calculate the median value of each quintile please?

 

I would appreciate any help!

Thank you 

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

@anonymous_user wrote:

 

I have a question about quintiles please. I divided a score into quintiles. In SAS how can I get the exact cut offs of each quintile and then how can I calculate the median value of each quintile please?

Since the median of a quintile is itself a percentile, you want the 10, 20, 30, 40 ... percentiles. So you really want 

 

proc means data=new min p10 p20 p30 p40 p50 p60 p70 p80 p90 max;
--
Paige Miller

View solution in original post

5 REPLIES 5

Would this be acceptable?

 

proc means data=new min p20 p40 p60 p80 max median ;

class quintiles;

var Score ;

run;

PaigeMiller
Diamond | Level 26

@anonymous_user wrote:

 

I have a question about quintiles please. I divided a score into quintiles. In SAS how can I get the exact cut offs of each quintile and then how can I calculate the median value of each quintile please?

Since the median of a quintile is itself a percentile, you want the 10, 20, 30, 40 ... percentiles. So you really want 

 

proc means data=new min p10 p20 p30 p40 p50 p60 p70 p80 p90 max;
--
Paige Miller

Thank you ver much!

Ksharp
Super User
Use PROC RANK to get quantitle.
proc rank data=have out=temp;
var variable;
ranks group;
run;

Use PROC SQL to get min max or cut off value and median.
proc sql;
select group,min(variable) as min,max(variable) as max,median(variable) as median
from temp
group by group;
quit;

Thank you very much!

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 1561 views
  • 2 likes
  • 3 in conversation