BookmarkSubscribeRSS Feed
andydcutler
Calcite | Level 5

Hi,

 

I'm (very) new to SAS and I'm trying to perform some analysis on data using (potentially) PROC TABULATE.  I'll provide a very truncated view of this data here to illustrate and try to explain:

 

ProductName, ProductPrice

Product A         5

Product B         5

Product C         6

Product D         8

Product E         9

 

I'd like to display various stats by grouping the Products into 2 groups: 1 group where the ProductPrice is less than or equal to the median and another group where the ProductPrice is greater than the median.

 

Am I able to complete the above just using PROC TABULATE?  I'm trying to work out how I compare each ProductPrice to the median (6) and put that product in one of the 2 groups.

 

Many thanks

1 REPLY 1
Reeza
Super User
I don't think you can. You'll need to calculate the median externally and create a grouping variable to specify the groups. You can then use proc report/tabluate to generate your report/output.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 1 reply
  • 789 views
  • 0 likes
  • 2 in conversation