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

I'd like to find the median within each tertile of my dataset (0-33.33%, 33.34-66.67%, 66.68-100%). I know what the values of the tertiles are (33.33=5, 66.67=18) and the min and max in my dataset (0.2, 96). Is there a way to write code to get the three medians? I might be overthinking this. Any help is much appreciated. Thanks! 

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

Tertile medians would be the same as if you split the data into 6 groups, the boundary between groups 1 and 2 being the median of the lower tertile, and so on.

--
Paige Miller

View solution in original post

2 REPLIES 2
PaigeMiller
Diamond | Level 26

Tertile medians would be the same as if you split the data into 6 groups, the boundary between groups 1 and 2 being the median of the lower tertile, and so on.

--
Paige Miller
joachimg
Obsidian | Level 7
Perfect! Thanks a million.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

Develop Code with SAS Studio

Get started using SAS Studio to write, run and debug your SAS programs.

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
  • 2 replies
  • 1479 views
  • 2 likes
  • 2 in conversation