BookmarkSubscribeRSS Feed
daszlosek
Quartz | Level 8

Hello Everyone!

I have a 24 level ordinal variable that I am trying to create a 5 level variable from based on percentiles (50th, 70th, 85th, 90th, and 95th). I have not been able to find any good example online to work off of.

Thank you!

5 REPLIES 5
ballardw
Super User

Examples of what your data currently looks like for that variable?

daszlosek
Quartz | Level 8

For example if you ran a proc freq

Variable_name         Frequency

0                                  758

1                                  854

2                                  975

3                                  257

4                                  651

5                                  475

6                                  358

7                                  842

.                                  .

.                                  .

.                                   .

24:                               758

Reeza
Super User

I'm not sure how an ordinal variable maps to percentiles makes a lot of sense.

In your proc freq output there should be a variable called cumulative percentage. You can use that to recode to 5 categories based on your cutoffs.

daszlosek
Quartz | Level 8

Me neither, but my boss wants them this and and stated she has seen it in literature before. I am only familiar with doing percentiles on continuous variables.

SteveDenham
Jade | Level 19

Well, 24 is kind of, sort of, like a lot of ordinal categories, and with that many observations, you should get a fairly interesting cumulative distribution.  Maybe you could fit an empirical distribution function to the data, and use that to get the percentile cutpoints.

Steve Denham

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!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 5 replies
  • 1629 views
  • 0 likes
  • 4 in conversation