BookmarkSubscribeRSS Feed
DavidKaib
Fluorite | Level 6

I have a few series of variables, each with a particular set of value options, where I need to display one of the answer options for each one (percent with that option), as a cross tab against another variable. While this is relatively easy to do using proc freq or proc tabulate, rather than a series of tables that shows all the options,  I would like to display this, one table for each set of variable (those sharing value options). Something like this:

 

 % F    
 TotalAdminLibrary MaintenanceSupport
Sat0.40.50.50.30.3
Engage0.40.50.50.30.3
Clear0.30.50.00.30.3
OnTime0.41.00.50.30.0
Overall0.30.00.00.70.3
      
 % AS    
 TotalAdminLibrary MaintenanceSupport
Better0.40.50.50.30.3
Compare0.00.00.00.00.0
Space0.20.50.00.00.3
Pitch0.10.00.00.00.3
Staff0.40.50.00.70.3


A had a similar question about displaying the results compactly without the cross tabs that was resolved here:

https://communities.sas.com/t5/SAS-Programming/Compact-Descriptive-Stats/m-p/864154#M341288

2 REPLIES 2
ballardw
Super User

Data.

Starting data in the form of a data step.

 

Likely make a data set where your current variable name becomes a the value of a variable and the the value into a single variable (maybe proc transpose or a data step equivalent- without existing data hard to tell which will work)

 

Then tabulate.

 

If those 0.3 are supposed to be percentages, sort of implied by the "%F" or "%AS" (and just what the heck is an F or AS??????, is that supposed to be a row percentage, table percentage or column percentage.

DavidKaib
Fluorite | Level 6

Correct, it's the % with the value of F (as opposed to not F) by each Unit. Currently I would use an array to make the values F or X (not F). It would be the column percentage here:

proc freq;
tables Sat * Unit;
run;

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 2 replies
  • 329 views
  • 0 likes
  • 2 in conversation