BookmarkSubscribeRSS Feed
jsberger
Obsidian | Level 7

Hi All,

Can someone help me figure out if I'm missing a subcommand or using the 'all' feature in proc tabulate inapproriately?  I'm creating a table summarizing rates across interactions between a number of student demographic variables.  I'm using the 'all' feature to get the subtotals for each demographic feature, which works fine in the SAS output (HTML or classic).  But, i'm using the out= feature to output the data to then export to Excel.  However, in doing so, the label i apply to 'all' does not come along for the ride, the cells are left blank.

It's obviously not a huge deal to use a data step to populate these cells, but it seems like this is something that's easily avoidable by bringing those labels along.  The code i'm using appears as follows:

proc tabulate data=cgraudit order=data out=summary;

     class school_id school_year school_name sex ethnic ed lep ec;

    var grad_flag;

    format grad_flag pmult.;

    table school_name=' '*(sex=' '(all={label='Total'}))*(ethnic=' '(all={label='Total'}))*(ed=' '(all={label='Total'}))*(lep=' '(all={label='Total'}))*(ec=' '(all={label='Total'})),

        school_year=' '*grad_flag=' '*(mean='%'*f=pmult.)//*misstext='Total'*/;

    run;

Thanks,

Jason

1 REPLY 1
ballardw
Super User

The 'Total' is only a value substitue for the class variables.Your original data does not have a value so is missing in the data set.

IF you use a format for the class variables that assigns the text 'Total' for missing values it will appear in the data due to the format. Which should export.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 682 views
  • 0 likes
  • 2 in conversation