BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
BTAinRVA
Quartz | Level 8
Ksharp,

Thanks for the reply! This looks interesting. I will try it out when I get
back to work on Tuesday.

btadams

##- Please type your reply above this line. Simple formatting, no
attachments. -##
BTAinRVA
Quartz | Level 8

Xia,

 

Yes, this works but it still give me output for all 12 months (CM) in 2014, even those that don't have any data in the dataset. My dataset has data for only the last three months of 2014 but the table output from the Tabulate procedure displays all 12 months of 2014. Is there some way to exclude columns in the output table where there are all zeros?

 

Thanks again for all your assistance!

 

Brian

BTAinRVA
Quartz | Level 8

Xia,

 

I think I figured out how to get what I want: I run the first Proc Tabulate with the PRINTMISS option that outputs all months for all sites. I store this in a table named TabData. I then delete all rows from TabData where the variable PctN_1011 equals ".". I then do another Proc Tabulate on this table as shown below.

 

title 'Monthly PPH by MTF';

proc tabulate data=Navy_PPIP_new missing out=tabdata;

  class Site_ID PPH CY CM;

  TABLE Site_ID * (PPH all) all, CY * CM * (N PCTN<PPH all>) all*(N PCTN<PPH all>) /printmiss MISSTEXT='0';

run;

 

Data temp;

  set tabdata;

  if PctN_1011 ne .;

run;

 

title 'Monthly PPH by MTF';

proc tabulate data=temp ;

  class Site_ID PPH CY CM;

  var N PctN_1011;

  TABLE Site_ID * (PPH all) all, CY * CM * (N PctN_1011="PCTN") all*(N PctN_1011="PCTN") / MISSTEXT='0';

run;

 

I appreciate all your help. I couldn't have figured it out without it!

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
  • 17 replies
  • 5360 views
  • 1 like
  • 4 in conversation